summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-04-29 00:38:10 +0200
committerSergei Golubchik <serg@mariadb.org>2018-04-29 00:38:10 +0200
commitc4499a03917aecfc2d86142c469d02618cbec54b (patch)
tree9cd51b7c8d2274300165840204ae3eb19401942f /mysql-test/r
parentd6dbe8e2071bf9fdc21b5530abce88ff01b40e25 (diff)
parent5cfe52314e29386e1867fad1b44eace2b9d0be7e (diff)
downloadmariadb-git-c4499a03917aecfc2d86142c469d02618cbec54b.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/sp-innodb.result34
-rw-r--r--mysql-test/r/subselect_sj.result26
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result26
3 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result
index b3405705698..8dee74040b3 100644
--- a/mysql-test/r/sp-innodb.result
+++ b/mysql-test/r/sp-innodb.result
@@ -130,3 +130,37 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved;
#
# BUG 16041903: End of test case
#
+#
+# MDEV-15035: SP using query with outer join and a parameter
+# in ON expression
+#
+CREATE TABLE t1 (
+id int NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+CREATE TABLE t2 (
+id int NOT NULL,
+id_foo int NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, 1);
+DROP PROCEDURE IF EXISTS test_proc;
+CREATE PROCEDURE test_proc(IN param int)
+LANGUAGE SQL
+READS SQL DATA
+BEGIN
+SELECT DISTINCT f.id
+FROM t1 f
+LEFT OUTER JOIN t2 b ON b.id_foo = f.id
+WHERE (param <> 0 OR b.id IS NOT NULL);
+END|
+CALL test_proc(0);
+id
+1
+CALL test_proc(1);
+id
+1
+2
+DROP PROCEDURE IF EXISTS test_proc;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 79a98b3efa1..fd9a66d8ef1 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -3155,4 +3155,30 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and <in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t3`.`c3` from `test`.`t3` where (<cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1
DROP TABLE t1,t2,t3,t4;
+#
+# MDEV-13699: Assertion `!new_field->field_name.str ||
+# strlen(new_field->field_name.str) == new_field->field_name.length'
+# failed in create_tmp_table on 2nd execution of PS with semijoin
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT);
+CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
+INSERT INTO t3 VALUES (5),(6);
+PREPARE stmt FROM
+"SELECT * FROM t1
+ WHERE EXISTS (
+ SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 )
+ )";
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+drop view v3;
+drop table t1,t2,t3;
+# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 2bc72acd478..71493df594f 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -3169,6 +3169,32 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and <in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t3`.`c3` from `test`.`t3` where (<cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1
DROP TABLE t1,t2,t3,t4;
+#
+# MDEV-13699: Assertion `!new_field->field_name.str ||
+# strlen(new_field->field_name.str) == new_field->field_name.length'
+# failed in create_tmp_table on 2nd execution of PS with semijoin
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT);
+CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
+INSERT INTO t3 VALUES (5),(6);
+PREPARE stmt FROM
+"SELECT * FROM t1
+ WHERE EXISTS (
+ SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 )
+ )";
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+drop view v3;
+drop table t1,t2,t3;
+# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off