Comment 3 for bug 601156

Revision history for this message
Timour Katchaounov (timour) wrote :

Simplified test case:

--disable_warnings
DROP TABLE /*! IF EXISTS */ t2;
DROP TABLE /*! IF EXISTS */ t1;
--enable_warnings

CREATE TABLE t1 (a1 int DEFAULT NULL, a2 int DEFAULT NULL);
INSERT INTO t1 VALUES (NULL,2);
INSERT INTO t1 VALUES (4,NULL);
CREATE TABLE t2 (b1 int DEFAULT NULL, b2 int DEFAULT NULL);
INSERT INTO t2 VALUES (6,NULL);
INSERT INTO t2 VALUES (NULL,0);

SET @@optimizer_switch='materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on';

EXPLAIN EXTENDED
SELECT * FROM (SELECT * FROM t1 WHERE a1 NOT IN (SELECT b2 FROM t2)) table1;

DROP TABLE t2;
DROP TABLE t1;