summaryrefslogtreecommitdiff
path: root/mysql-test/r/cte_recursive.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-09-30 17:39:55 -0700
committerIgor Babaev <igor@askmonty.org>2016-09-30 17:40:43 -0700
commit3b314ec6339e391f1e0670a3d584dbc3a5a5cb29 (patch)
treef321ccc09898c749828a63f0ad36cba16d85cd50 /mysql-test/r/cte_recursive.result
parent6681a4998e6c05f6350f9160012a6b6ef84ff513 (diff)
downloadmariadb-git-3b314ec6339e391f1e0670a3d584dbc3a5a5cb29.tar.gz
Fixed bug mdev-10933.
The bug was caused by a misplaced construct opt_with_clause for one of the variants of CREATE ... SELECT.
Diffstat (limited to 'mysql-test/r/cte_recursive.result')
-rw-r--r--mysql-test/r/cte_recursive.result30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result
index ac48bf0847c..f22370870c2 100644
--- a/mysql-test/r/cte_recursive.result
+++ b/mysql-test/r/cte_recursive.result
@@ -1693,6 +1693,36 @@ id name dob father mother
8 Grandpa Ben 1940-10-21 NULL NULL
6 Grandgrandma Martha 1923-05-17 NULL NULL
drop table my_ancestors;
+#
+# MDEV-10933: WITH clause together with SELECT in parenthesis
+# CREATE SELECT
+#
+create table my_ancestors
+(
+with recursive
+ancestor_ids (id)
+as
+(
+select father from folks where name = 'Me'
+ union
+select mother from folks where name = 'Me'
+ union
+select father from folks, ancestor_ids a where folks.id = a.id
+union
+select mother from folks, ancestor_ids a where folks.id = a.id
+)
+select p.* from folks as p, ancestor_ids as a where p.id = a.id
+);
+select * from my_ancestors;
+id name dob father mother
+20 Dad 1970-02-02 10 9
+30 Mom 1975-03-03 8 7
+10 Grandpa Bill 1940-04-05 NULL NULL
+9 Grandma Ann 1941-10-15 NULL NULL
+7 Grandma Sally 1943-08-23 NULL 6
+8 Grandpa Ben 1940-10-21 NULL NULL
+6 Grandgrandma Martha 1923-05-17 NULL NULL
+drop table my_ancestors;
drop table folks;
#
# MDEV-10372: [bb-10.2-mdev9864 tree] EXPLAIN with recursive CTE enters endless recursion