summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_sj.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-08-16 21:42:25 +0400
committerSergey Petrunya <psergey@askmonty.org>2011-08-16 21:42:25 +0400
commitc9494dc42d6cf68fb20fb8e54e6cb6367336271e (patch)
treedf71aba1b8ae51112ace0ae225aed5baf6550f48 /mysql-test/t/subselect_sj.test
parentd2206ad14920e85907c965256e1ce061633c36ee (diff)
downloadmariadb-git-c9494dc42d6cf68fb20fb8e54e6cb6367336271e.tar.gz
BUG#818280: crash in do_copy_not_null() in maria-5.3 with semijoin
- Make simplify_joins() set maybe_null=FALSE for tables that were on the inner sides of inner joins and then were moved to the inner sides of semi-joins.
Diffstat (limited to 'mysql-test/t/subselect_sj.test')
-rw-r--r--mysql-test/t/subselect_sj.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index 4930a79acd4..66c7b1bc549 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -1555,5 +1555,21 @@ SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3 ) WHERE IFNULL(t2.f3,'foo') IN (SELEC
DROP TABLE t1, t2, t3, t4;
set @tmp803457=@@optimizer_switch;
+--echo #
+--echo # BUG#818280: crash in do_copy_not_null() in maria-5.3 with semijoin
+--echo #
+CREATE TABLE t1 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
+INSERT IGNORE INTO t1 VALUES (2,7),(1,3),(5,6);
+
+CREATE TABLE t3 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
+INSERT IGNORE INTO t3 VALUES (2,7),(1,3),(5,6);
+
+CREATE TABLE t2 ( c1 int NOT NULL , c5 int NOT NULL );
+INSERT IGNORE INTO t2 VALUES (2,2),(2,2),(5,6);
+
+SELECT * FROM t1 WHERE c1 IN ( SELECT t3.c1 FROM t3 LEFT JOIN t2 ON t2 .c1 = t3 .c1 WHERE t2.c5 != 0 );
+
+DROP TABLE t1, t2, t3;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;