Description:
I found a query execution inconsistency in MySQL where two semantically identical SELECT statements return different results.
The only difference between the two queries is the SELECT list, while the FROM, JOIN, and ON conditions are exactly the same.
SELECT t1.c1 FROM t1 INNER JOIN t0 ON (t0.c0) LIKE ( EXISTS (SELECT 1));
c1 |
---+
127|
SELECT t1.c1,t0.c0 FROM t1 INNER JOIN t0 ON (t0.c0) LIKE ( EXISTS (SELECT 1));
Empty set (0 rows)
How to repeat:
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
USE test;
CREATE TABLE `t0` (
`c0` tinytext,
KEY `i2` (`c0`(1))
) ENGINE=MyISAM ;
CREATE TABLE `t1` (
`c0` decimal(10,0) DEFAULT NULL,
`c1` tinyint DEFAULT NULL,
`c2` decimal(10,0) DEFAULT NULL
) ENGINE=MEMORY ;
INSERT IGNORE INTO t1(c1) VALUES(127);
INSERT IGNORE INTO t0(c0) VALUES(795212044);
REPLACE INTO t0(c0) VALUES(1937691733);
SELECT t1.c1 FROM t1 INNER JOIN t0 ON (t0.c0) LIKE ( EXISTS (SELECT 1));
SELECT t1.c1,t0.c0 FROM t1 INNER JOIN t0 ON (t0.c0) LIKE ( EXISTS (SELECT 1));