summaryrefslogtreecommitdiff
path: root/mysql-test/t/null_key.test
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2008-03-03 20:35:44 +0300
committerunknown <sergefp@mysql.com>2008-03-03 20:35:44 +0300
commitcd9f2d1c285d1bc5f5115e517da806ccb2bd1d28 (patch)
tree2a14a7b3a838192c9191d0591e5a4a88d17d963f /mysql-test/t/null_key.test
parent2cb35cd680d70f3e1e26b5672f2125d6fdff4921 (diff)
downloadmariadb-git-cd9f2d1c285d1bc5f5115e517da806ccb2bd1d28.tar.gz
BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql"
- Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call to before the late NULLs filtering code. - Backport function comments from 6.0. mysql-test/r/null_key.result: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Testcase mysql-test/t/null_key.test: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Testcase sql/sql_select.cc: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call to before the late NULLs filtering code. - Backport function comments from 6.0
Diffstat (limited to 'mysql-test/t/null_key.test')
-rw-r--r--mysql-test/t/null_key.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test
index e15aec01d2a..1400c643203 100644
--- a/mysql-test/t/null_key.test
+++ b/mysql-test/t/null_key.test
@@ -240,3 +240,26 @@ SHOW STATUS LIKE "handler_read%";
DROP TABLE t1,t2,t3,t4;
# End of 4.1 tests
+
+#
+# BUG#34945 "ref_or_null queries that are null_rejecting and have a null value crash mysql"
+#
+CREATE TABLE t1 (
+ a int(11) default NULL,
+ b int(11) default NULL,
+ KEY a (a,b)
+);
+INSERT INTO t1 VALUES (0,10),(0,11),(0,12);
+
+CREATE TABLE t2 (
+ a int(11) default NULL,
+ b int(11) default NULL,
+ KEY a (a)
+);
+INSERT INTO t2 VALUES (3,NULL),(3,11),(3,12);
+
+SELECT * FROM t2 inner join t1 WHERE ( t1.a = 0 OR t1.a IS NULL) AND t2.a = 3 AND t2.b = t1.b;
+
+drop table t1, t2;
+-- echo End of 5.0 tests
+