summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/subselect.result15
-rw-r--r--mysql-test/r/subselect_no_mat.result15
-rw-r--r--mysql-test/r/subselect_no_opts.result15
-rw-r--r--mysql-test/r/subselect_no_scache.result15
-rw-r--r--mysql-test/r/subselect_no_semijoin.result15
-rw-r--r--mysql-test/t/subselect.test18
6 files changed, 93 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 87c5a3da69d..e49baeadcb0 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -5748,6 +5748,21 @@ b a b
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
#
+# LP bug #885162 Got error 124 from storage engine with UNION inside
+# subquery and join_cache_level=3..8
+# (IN/ALL/ANY optimizations should not be applied to fake_select)
+#
+CREATE TABLE t1 (
+f1 varchar(1) DEFAULT NULL
+);
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+f1
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+#
# LP BUG#747278 incorrect values of the NULL (no rows) single
# row subquery requested via element_index() interface
#
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index a7625db5ff3..d315a16d2ce 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -5747,6 +5747,21 @@ b a b
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
#
+# LP bug #885162 Got error 124 from storage engine with UNION inside
+# subquery and join_cache_level=3..8
+# (IN/ALL/ANY optimizations should not be applied to fake_select)
+#
+CREATE TABLE t1 (
+f1 varchar(1) DEFAULT NULL
+);
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+f1
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+#
# LP BUG#747278 incorrect values of the NULL (no rows) single
# row subquery requested via element_index() interface
#
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index d7c67131970..d6212c756cf 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -5743,6 +5743,21 @@ b a b
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
#
+# LP bug #885162 Got error 124 from storage engine with UNION inside
+# subquery and join_cache_level=3..8
+# (IN/ALL/ANY optimizations should not be applied to fake_select)
+#
+CREATE TABLE t1 (
+f1 varchar(1) DEFAULT NULL
+);
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+f1
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+#
# LP BUG#747278 incorrect values of the NULL (no rows) single
# row subquery requested via element_index() interface
#
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index ef1b268f5ba..e1e0317c815 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -5752,6 +5752,21 @@ b a b
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
#
+# LP bug #885162 Got error 124 from storage engine with UNION inside
+# subquery and join_cache_level=3..8
+# (IN/ALL/ANY optimizations should not be applied to fake_select)
+#
+CREATE TABLE t1 (
+f1 varchar(1) DEFAULT NULL
+);
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+f1
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+#
# LP BUG#747278 incorrect values of the NULL (no rows) single
# row subquery requested via element_index() interface
#
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index 9f50a975b84..6438f06e179 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -5743,6 +5743,21 @@ b a b
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
#
+# LP bug #885162 Got error 124 from storage engine with UNION inside
+# subquery and join_cache_level=3..8
+# (IN/ALL/ANY optimizations should not be applied to fake_select)
+#
+CREATE TABLE t1 (
+f1 varchar(1) DEFAULT NULL
+);
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+f1
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+#
# LP BUG#747278 incorrect values of the NULL (no rows) single
# row subquery requested via element_index() interface
#
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 92df79d7777..26ba75a6f46 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -4855,6 +4855,24 @@ WHERE t2.b IN (
set @@join_cache_level= @save_join_cache_level;
drop table t1,t2;
+
+--echo #
+--echo # LP bug #885162 Got error 124 from storage engine with UNION inside
+--echo # subquery and join_cache_level=3..8
+--echo # (IN/ALL/ANY optimizations should not be applied to fake_select)
+--echo #
+
+CREATE TABLE t1 (
+ f1 varchar(1) DEFAULT NULL
+ );
+INSERT INTO t1 VALUES ('c');
+set @save_join_cache_level=@@join_cache_level;
+SET SESSION join_cache_level=8;
+SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' );
+set @@join_cache_level= @save_join_cache_level;
+drop table t1;
+
+
--echo #
--echo # LP BUG#747278 incorrect values of the NULL (no rows) single
--echo # row subquery requested via element_index() interface