summaryrefslogtreecommitdiff
path: root/mysql-test/suite/compat
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-11-15 14:42:04 +0400
committerAlexander Barkov <bar@mariadb.org>2017-11-15 14:42:04 +0400
commit7663773e56e64098b1126651a6ff3cbc41192329 (patch)
tree70676cb39626c3a32c68cce8c521949da94db709 /mysql-test/suite/compat
parentac8e0507fe0983ed16472f98dd9f5e138aa8be6f (diff)
downloadmariadb-git-7663773e56e64098b1126651a6ff3cbc41192329.tar.gz
MDEV-11160 "Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"
This problem was earlier fixed in bb-10.2-ext. Adding tests only.
Diffstat (limited to 'mysql-test/suite/compat')
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result28
-rw-r--r--mysql-test/suite/compat/oracle/t/sp.test27
2 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
index 53411e80251..2bf4f50e6d5 100644
--- a/mysql-test/suite/compat/oracle/r/sp.result
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -2404,3 +2404,31 @@ t1 CREATE TABLE "t1" (
"aa_timestamp5" timestamp(5) NULL DEFAULT NULL,
"aa_date0" datetime DEFAULT NULL
)
+#
+# MDEV-11160 "Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"
+#
+CREATE TABLE t1 (x INT);
+INSERT INTO t1 VALUES (10);
+CREATE VIEW v1 AS SELECT x+1 AS a,x+1 AS b FROM t1;
+CREATE PROCEDURE p1
+AS
+a INT := 1;
+b INT := 2;
+BEGIN
+CREATE TABLE t2 AS SELECT a,b FROM v1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+END;
+$$
+CALL p1();
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" int(11) DEFAULT NULL,
+ "b" int(11) DEFAULT NULL
+)
+a b
+1 2
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test
index 61a37459483..e7adbb5403a 100644
--- a/mysql-test/suite/compat/oracle/t/sp.test
+++ b/mysql-test/suite/compat/oracle/t/sp.test
@@ -2233,3 +2233,30 @@ BEGIN
END;
$$
DELIMITER ;$$
+
+
+--echo #
+--echo # MDEV-11160 "Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"
+--echo #
+
+
+CREATE TABLE t1 (x INT);
+INSERT INTO t1 VALUES (10);
+CREATE VIEW v1 AS SELECT x+1 AS a,x+1 AS b FROM t1;
+DELIMITER $$;
+CREATE PROCEDURE p1
+AS
+ a INT := 1;
+ b INT := 2;
+BEGIN
+ CREATE TABLE t2 AS SELECT a,b FROM v1;
+ SHOW CREATE TABLE t2;
+ SELECT * FROM t2;
+ DROP TABLE t2;
+END;
+$$
+DELIMITER ;$$
+CALL p1();
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;