同样的查询条件,展示字段不同,得出来结果不一样。

复现了

TiDB root@10.18.13.224:test> show variables like '%tidb_partition_prune_mode%'
+---------------------------+---------+
| Variable_name             | Value   |
+---------------------------+---------+
| tidb_partition_prune_mode | dynamic |
+---------------------------+---------+
1 row in set
Time: 0.027s
TiDB root@10.18.13.224:test> show variables like 'tidb_enable_clustered_index%'
+-----------------------------+-------+
| Variable_name               | Value |
+-----------------------------+-------+
| tidb_enable_clustered_index | ON    |
+-----------------------------+-------+
1 row in set
Time: 0.021s
TiDB root@10.18.13.224:test> select
                          ->     c.occur_amount
                          ->     from capital_history c
                          ->     join txn_account_info t
                          ->     on c.txt_account_id=t.txn_account_id
                          ->     and c.capital_sub_class='CUST'
                          ->     and t.account_id='1142927' and t.broker='0009'
                          ->     and c.occur_trade_date = '2022-11-17';
+--------------+
| occur_amount |
+--------------+
+--------------+
0 rows in set
Time: 0.030s
TiDB root@10.18.13.224:test> select
                          ->     c.serial_id, c.occur_amount
                          ->     from capital_history c
                          ->     join txn_account_info t
                          ->     on c.txt_account_id=t.txn_account_id
                          ->     and c.capital_sub_class='CUST'
                          ->     and t.account_id='1142927' and t.broker='0009'
                          ->     and c.occur_trade_date = '2022-11-17';
+------------------+--------------+
| serial_id        | occur_amount |
+------------------+--------------+
| 2022111700196920 | -2.01        |
+------------------+--------------+
1 row in set
Time: 0.029s
TiDB root@10.18.13.224:test> select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v6.1.2 |
+--------------------+
1 row in set
Time: 0.019s
TiDB root@10.18.13.224:test>
1 个赞