An example that demonstrates that the wrong result is reproducible without constant tables:
CREATE TABLE t1 (c int) ; INSERT INTO t1 VALUES (5),(6);
CREATE TABLE t2 (a int, b int) ; INSERT INTO t2 VALUES (20,9),(20,9);
create table t3 (d int, e int); insert into t3 values (2, 9), (3,10);
EXPLAIN SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE ( t2.b , t1.c ) NOT IN ( SELECT * from t3);
SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN ( SELECT * from t3);
An example that demonstrates that the wrong result is
reproducible without constant tables:
CREATE TABLE t1 (c int) ;
INSERT INTO t1 VALUES (5),(6);
CREATE TABLE t2 (a int, b int) ;
INSERT INTO t2 VALUES (20,9),(20,9);
create table t3 (d int, e int);
insert into t3 values (2, 9), (3,10);
EXPLAIN
SELECT t2.b , t1.c
FROM t2 LEFT JOIN t1 ON t1.c < 3
WHERE ( t2.b , t1.c ) NOT IN ( SELECT * from t3);
SELECT t2.b , t1.c
FROM t2 LEFT JOIN t1 ON t1.c < 3
WHERE (t2.b, t1.c) NOT IN ( SELECT * from t3);