Commit 2160a851 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Update subselect test results to pass on 10.0

One query was removed due to inconsistent behaviour with subquery cache
enabled vs disabled. MDEV-13399 has been created to track this change
and fix.
parent af40426f
...@@ -7174,8 +7174,15 @@ drop table t1,t2; ...@@ -7174,8 +7174,15 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1) (SELECT MAX(sq.f2) FROM t1)
NULL NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2; drop table t1, t2;
...@@ -7171,6 +7171,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; ...@@ -7171,6 +7171,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row ERROR 21000: Subquery returns more than 1 row
drop view v1; drop view v1;
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
set optimizer_switch=default; set optimizer_switch=default;
select @@optimizer_switch like '%exists_to_in=off%'; select @@optimizer_switch like '%exists_to_in=off%';
@@optimizer_switch like '%exists_to_in=off%' @@optimizer_switch like '%exists_to_in=off%'
......
...@@ -7167,10 +7167,17 @@ drop table t1,t2; ...@@ -7167,10 +7167,17 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1) (SELECT MAX(sq.f2) FROM t1)
NULL NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2; drop table t1, t2;
set optimizer_switch=default; set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%'; select @@optimizer_switch like '%materialization=on%';
......
...@@ -7165,9 +7165,16 @@ drop table t1,t2; ...@@ -7165,9 +7165,16 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1) (SELECT MAX(sq.f2) FROM t1)
NULL NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2; drop table t1, t2;
set @optimizer_switch_for_subselect_test=null; set @optimizer_switch_for_subselect_test=null;
...@@ -7180,10 +7180,17 @@ drop table t1,t2; ...@@ -7180,10 +7180,17 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1) (SELECT MAX(sq.f2) FROM t1)
NULL NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2; drop table t1, t2;
set optimizer_switch=default; set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%'; select @@optimizer_switch like '%subquery_cache=on%';
......
...@@ -7165,10 +7165,17 @@ drop table t1,t2; ...@@ -7165,10 +7165,17 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1) (SELECT MAX(sq.f2) FROM t1)
NULL NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2; drop table t1, t2;
set @optimizer_switch_for_subselect_test=null; set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL; set @join_cache_level_for_subselect_test=NULL;
...@@ -6059,6 +6059,13 @@ drop table t1,t2; ...@@ -6059,6 +6059,13 @@ drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8); INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM; CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6),(9); INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
--echo #
--echo # Disable this query till MDEV-13399 is resolved
--echo #
--echo # INSERT t2 VALUES (9);
--echo # --error ER_SUBQUERY_NO_1_ROW
--echo # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
--echo #
drop table t1, t2; drop table t1, t2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment