diff options
Diffstat (limited to 'mysql-test/t/explain.test')
-rw-r--r-- | mysql-test/t/explain.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 7b7bdd3563c..18f1145a25d 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -148,3 +148,23 @@ EXPLAIN SELECT DISTINCT 1 FROM t1, DROP TABLE t1; # End of 5.0 tests. + +--echo # +--echo # Bug#37870: Usage of uninitialized value caused failed assertion. +--echo # +create table t1 (dt datetime not null, t time not null); +create table t2 (dt datetime not null); +insert into t1 values ('2001-01-01 1:1:1', '1:1:1'), +('2001-01-01 1:1:1', '1:1:1'); +insert into t2 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1'); +flush tables; +EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL ); +flush tables; +SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL ); +flush tables; +EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' ); +flush tables; +SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' ); +drop tables t1, t2; + +--echo End of 5.1 tests. |