Debian Codegraph @

mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test

raw
1 # Test for BUG#43249 "Innodb returns zero time for the time column
2 # with <=> NULL order by limit"
3
4 --source include/have_debug.inc
5 --source include/have_innodb.inc
6
7 SET @saved_dbug = @@SESSION.debug_dbug;
8 set session debug_dbug="+d,optimizer_innodb_icp";
9
10 CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 DATE, PRIMARY
11 KEY(c1), UNIQUE INDEX(c2)) engine=innodb;
12 INSERT INTO t1 VALUES('8:29:45',NULL,'2009-02-01');
13 # first time, good results:
14 SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
15 # second time, bad results:
16 SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
17
18 drop table `t1`;
19 SET debug_dbug= @saved_dbug;