summaryrefslogtreecommitdiff
path: root/mysql-test/r/cte_nonrecursive.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-11-06 12:18:36 -0800
committerIgor Babaev <igor@askmonty.org>2017-11-06 12:18:36 -0800
commit8128ae48eff6029d29d6c1c509f04994614a0571 (patch)
tree2531932d8934f9ed60a63c68663c6937d4e5d46c /mysql-test/r/cte_nonrecursive.result
parent343bcb152f87a0ec44f940b73993d684d04def43 (diff)
downloadmariadb-git-8128ae48eff6029d29d6c1c509f04994614a0571.tar.gz
Test case for mdev-13753 CTE is not visible during view creation
The bug was fixed by the patch for the bug mdev-13780.
Diffstat (limited to 'mysql-test/r/cte_nonrecursive.result')
-rw-r--r--mysql-test/r/cte_nonrecursive.result19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index 36982d3673b..ebe1aae1e8f 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -1128,3 +1128,22 @@ NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
drop table t1;
+#
+# MDEV-13753: embedded CTE in a VIEW created in prepared statement
+#
+SET @sql_query = "
+ CREATE OR REPLACE VIEW cte_test AS
+ WITH cte1 AS ( SELECT 1 as a from dual )
+ , cte2 AS ( SELECT * FROM cte1 )
+ SELECT * FROM cte2;
+";
+PREPARE stmt FROM @sql_query;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SHOW CREATE VIEW cte_test;
+View Create View character_set_client collation_connection
+cte_test CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `cte_test` AS with cte1 as (select 1 AS `a`), cte2 as (select `cte1`.`a` AS `a` from `cte1`)select `cte2`.`a` AS `a` from `cte2` latin1 latin1_swedish_ci
+SELECT * FROM cte_test;
+a
+1
+DROP VIEW cte_test;