summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test')
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
new file mode 100644
index 00000000..c647b777
--- /dev/null
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
@@ -0,0 +1,19 @@
+# Test for BUG#43249 "Innodb returns zero time for the time column
+# with <=> NULL order by limit"
+
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+SET @saved_dbug = @@SESSION.debug_dbug;
+set session debug_dbug="+d,optimizer_innodb_icp";
+
+CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 DATE, PRIMARY
+KEY(c1), UNIQUE INDEX(c2)) engine=innodb;
+INSERT INTO t1 VALUES('8:29:45',NULL,'2009-02-01');
+# first time, good results:
+SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
+# second time, bad results:
+SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
+
+drop table `t1`;
+SET debug_dbug= @saved_dbug;