-
Notifications
You must be signed in to change notification settings - Fork 411
Description
The query: SELECT (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) FROM t1 WHERE (a>b-2 AND a<b+2) OR c>d ORDER BY 1; return wrong result when select from tiflash:
+-----------------------------------------------+
| (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) |
+-----------------------------------------------+
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
+-----------------------------------------------+
When select from tikv, it's result is
+-----------------------------------------------+
| (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) |
+-----------------------------------------------+
| 0 |
| 2 |
| 3 |
| 4 |
| 6 |
| 7 |
| 8 |
| 11 |
| 13 |
| 14 |
| 16 |
| 17 |
| 18 |
| 19 |
| 20 |
| 21 |
| 22 |
| 24 |
| 25 |
| 28 |
+-----------------------------------------------+