summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_sj_jcl6.result
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-02-15 01:21:46 +0400
committerSergey Petrunya <psergey@askmonty.org>2014-02-15 01:21:46 +0400
commit8c9b2f3429fd385ded604ec048f1fcbd89c3a846 (patch)
treec114042bfa4eacc2c7afb3b54aba319fe11715f7 /mysql-test/r/subselect_sj_jcl6.result
parent9d5731ef1b5a3f879d4234cddc694b629d823106 (diff)
downloadmariadb-git-8c9b2f3429fd385ded604ec048f1fcbd89c3a846.tar.gz
MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
- The problem was that JOIN::prepare() tried to set TABLE::maybe_null for a table in join. Non-merged semi-join tables 1) are present as join's base tables on second EXECUTE, but 2) do not yet have a TABLE object. Worked around the problem by putting mixed_implicit_grouping into JOIN object, and then passing it to JTBM tables in setup_jtbm_semi_joins().
Diffstat (limited to 'mysql-test/r/subselect_sj_jcl6.result')
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 55068ce257a..bc8fb3cf04a 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2796,6 +2796,22 @@ db
information_schema
mysql
DROP TABLE t1;
+#
+# MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (2),(3);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (8),(9);
+CREATE TABLE t3 (c INT, INDEX(c));
+INSERT INTO t2 VALUES (5),(6);
+PREPARE stmt FROM
+"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )";
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off