Open zhangysh1995 opened 4 years ago
It is even more weird on master branch:
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 2 |
| 0 |
| 1 |
+------+
3 rows in set (0.00 sec)
mysql> select * from t0 group by id desc;
+------+
| id |
+------+
| 1 |
| 0 |
| 2 |
+------+
3 rows in set (0.00 sec)
In MySQL, it produces correct order:
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 0 |
| 1 |
| 2 |
+------+
3 rows in set, 1 warning (0.00 sec)
mysql> select * from t0 group by id desc;
+------+
| id |
+------+
| 2 |
| 1 |
| 0 |
+------+
3 rows in set, 1 warning (0.00 sec)
/bug P1
Bug Report
1. What did you do?
2. What did you expect to see?
3. What did you see instead?
No warnings.
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)Reproducible on master branch: