From 43903745e5af676db1fe813ab8e2ba7190353f83 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sun, 5 Mar 2017 10:58:05 +0530 Subject: MDEV-11078: NULL NOT IN (non-empty subquery) should never return results Disabling the cond guards during the creation of Tricond Item for constant and NULL left expression items --- mysql-test/t/subselect4.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t/subselect4.test') diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 7a7dd7e492e..056152cc706 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2000,5 +2000,24 @@ EXECUTE stmt; drop table t1, t2, t3; +--echo # +--echo # MDEV-11078: NULL NOT IN (non-empty subquery) should never return results +--echo # + +create table t1(a int,b int); +create table t2(a int,b int); +insert into t1 value (1,2); +select (NULL) in (select 1 from t1); +select (null) in (select 1 from t2); +select 1 in (select 1 from t1); +select 1 in (select 1 from t2); +select 1 from dual where null in (select 1 from t1); +select 1 from dual where null in (select 1 from t2); +select (null,null) in (select * from t1); +select (null,null) in (select * from t2); +select 1 from dual where null not in (select 1 from t1); +select 1 from dual where null not in (select 1 from t2); +drop table t1,t2; + SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; -- cgit v1.2.1