Description:
After running some sqls, the row counts retrieved from the same table are inconsistent.
mysql> SELECT t0.c0 FROM t0 WHERE ((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)));
+-----------+
| c0 |
+-----------+
| P{}^ |
| .?C!輠^?? |
| |
| |
+-----------+
4 rows in set (0.00 sec)
mysql> SELECT (((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)))) FROM t0;
+----------------------------------------------------+
| (((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)))) |
+----------------------------------------------------+
| 18446744073334821647 |
| 18446744073334821647 |
| 18446744073334821647 |
| 18446744073334821647 |
| 18446744073334821647 |
| 18446744073334821647 |
+----------------------------------------------------+
6 rows in set (0.00 sec)
mysql> EXPLAIN FORMAT=TREE SELECT t0.c0 FROM t0 WHERE ((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)));
+------------------------------------------+
| EXPLAIN |
+------------------------------------------+
| -> Table scan on t0 (cost=0.65 rows=4)
|
+------------------------------------------+
1 row in set (0.00 sec)
mysql> EXPLAIN FORMAT=TREE SELECT (((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)))) FROM t0;
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| -> Covering index scan on t0 using i0 (cost=0.65 rows=4)
-> Select #2 (subquery in projection; run only once)
-> Zero rows (Impossible WHERE) (cost=0..0 rows=0)
|
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
How to repeat:
SELECT t0.c0 FROM t0 WHERE ((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)));
SELECT (((-374729969)<<( EXISTS (SELECT 1 WHERE FALSE)))) FROM t0;
Execute the statements in the repeat.sql file, then run the query above.