Open leiysky opened 3 years ago
mysql> desc select cot(0) as field from t where a = 1 order by field limit 1;
+--------------------------------+---------+--------------+---------------+--------------------------------+
| id | estRows | task | access object | operator info |
+--------------------------------+---------+--------------+---------------+--------------------------------+
| Projection_7 | 1.00 | root | | cot(0)->Column#3 |
| └─Limit_12 | 1.00 | root | | offset:0, count:1 |
| └─TableReader_30 | 1.00 | root | | data:Limit_29 |
| └─Limit_29 | 1.00 | cop[tiflash] | | offset:0, count:1 |
| └─Selection_28 | 1.00 | cop[tiflash] | | eq(topn.t.a, 1) |
| └─TableFullScan_27 | 1000.00 | cop[tiflash] | table:t | keep order:false, stats:pseudo |
+--------------------------------+---------+--------------+---------------+--------------------------------+
6 rows in set (0.06 sec)
mysql> select cot(0) as field from t where a = 1 order by field limit 1;
Empty set (0.11 sec)
cannot reproduce,may be fixed.
@fzhedu I can still reproduce this with latest nightly.
MySQL [test]> select cot(0) as field from t where a = 1 order by field limit 1;
ERROR 1105 (HY000): DB::TiFlashException: TopN executor without order by exprs
MySQL [test]> explain select cot(0) as field from t where a = 1 order by field limit 1;
+----------------------------------+----------+-------------------+---------------+--------------------------------+
| id | estRows | task | access object | operator info |
+----------------------------------+----------+-------------------+---------------+--------------------------------+
| Projection_7 | 1.00 | root | | cot(0)->Column#3 |
| └─TopN_11 | 1.00 | root | | , offset:0, count:1 |
| └─TableReader_31 | 1.00 | root | | data:ExchangeSender_30 |
| └─ExchangeSender_30 | 1.00 | batchCop[tiflash] | | ExchangeType: PassThrough |
| └─TopN_29 | 1.00 | batchCop[tiflash] | | , offset:0, count:1 |
| └─Selection_28 | 10.00 | batchCop[tiflash] | | eq(test.t.a, 1) |
| └─TableFullScan_27 | 10000.00 | batchCop[tiflash] | table:t | keep order:false, stats:pseudo |
+----------------------------------+----------+-------------------+---------------+--------------------------------+
7 rows in set (0.001 sec)
MySQL [test]> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0-alpha-179-ga0b97b0c9
Edition: Community
Git Commit Hash: a0b97b0c962de646f05f42f67ca7d53d630eb9ad
Git Branch: master
UTC Build Time: 2021-06-29 08:12:37
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
With the latest nightly, I get a different error message.
Minimal reproduce:
The perquisite of this issue:
cot(0)
)TopN
executor which will order by the expression mentioned in1