summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect2.result
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-16 03:18:14 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-16 03:18:14 +0200
commit8e15768731c52b6bbb29d7bfe27bdd71c025a3a3 (patch)
tree3148e77619dba81f92ab25d604079b46689e58b8 /mysql-test/r/subselect2.result
parentebb8c9fb26f86cff8c0d81bd2415f415cef952bb (diff)
parent66744f4540c464413055a79111c34449e8381618 (diff)
downloadmariadb-git-8e15768731c52b6bbb29d7bfe27bdd71c025a3a3.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test/r/subselect2.result')
-rw-r--r--mysql-test/r/subselect2.result45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index 75e8c084026..a54080f6cb4 100644
--- a/mysql-test/r/subselect2.result
+++ b/mysql-test/r/subselect2.result
@@ -348,4 +348,49 @@ where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 );
a a a
FRA FRA FRA
drop table t1,t2,t3;
+#
+# MDEV-10148: Database crashes in the query to the View
+#
+CREATE TABLE t1 (
+key_code INT(11) NOT NULL,
+value_string VARCHAR(50) NULL DEFAULT NULL,
+PRIMARY KEY (key_code)
+) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
+CREATE TABLE t2 (
+key_code INT(11) NOT NULL,
+target_date DATE NULL DEFAULT NULL,
+PRIMARY KEY (key_code)
+) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
+CREATE TABLE t3 (
+now_date DATE NOT NULL,
+PRIMARY KEY (now_date)
+) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
+CREATE VIEW v1
+AS
+SELECT
+B.key_code,
+B.target_date
+FROM
+t2 B INNER JOIN t3 C ON
+B.target_date = C.now_date
+;
+SET @s = 'SELECT A.* FROM t1 A WHERE A.key_code IN (SELECT key_code FROM v1)';
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+key_code value_string
+EXECUTE stmt;
+key_code value_string
+DEALLOCATE PREPARE stmt;
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect2_test_tmp;
+create table t1 (a int);
+create table t2 (a int);
+create table t3(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+insert into t2 select a from t1;
+insert into t3 select a from t1;
+select null in (select a from t1 where a < out3.a union select a from t2 where
+(select a from t3) +1 < out3.a+1) from t3 out3;
+ERROR 21000: Subquery returns more than 1 row
+drop table t1, t2, t3;