summaryrefslogtreecommitdiff
path: root/mysql-test/r/cte_recursive.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-11-13 14:46:33 -0800
committerIgor Babaev <igor@askmonty.org>2016-11-13 14:56:29 -0800
commit92bcb906a01515874eb3095eabfde7057f4f8d50 (patch)
tree4f124b2b4a93bf141534f25479d32875f1d139b8 /mysql-test/r/cte_recursive.result
parentf2219c8d3fb4a54da1fff74b8849c74b9a7de0c6 (diff)
downloadmariadb-git-92bcb906a01515874eb3095eabfde7057f4f8d50.tar.gz
Fixed bug mdev-11278.
If a recursive CTE referred to a materialized view/derived table then the query that used this CTE returned a bogus error message.
Diffstat (limited to 'mysql-test/r/cte_recursive.result')
-rw-r--r--mysql-test/r/cte_recursive.result26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result
index f22370870c2..a624b5453b8 100644
--- a/mysql-test/r/cte_recursive.result
+++ b/mysql-test/r/cte_recursive.result
@@ -1836,3 +1836,29 @@ id select_type table type possible_keys key key_len ref rows Extra
4 RECURSIVE UNION t2 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL
drop table t1,t2;
+#
+# MDEV-11278: non-mergeable view in the spec of recursive CTE
+#
+create table t1 (a int);
+insert into t1 values
+(0), (1), (2), (3), (4);
+create table t2 (a int);
+insert into t2 values
+(1), (2), (3), (4), (5);
+create view v1 as
+select a from t2 where a < 3
+union
+select a from t2 where a > 4;
+with recursive
+t1 as
+(
+select a from v1 where a=1
+union
+select v1.a from t1,v1 where t1.a+1=v1.a
+)
+select * from t1;
+a
+1
+2
+drop view v1;
+drop table t1,t2;