diff options
author | Igor Babaev <igor@askmonty.org> | 2018-05-17 22:56:27 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-05-17 22:58:21 -0700 |
commit | de86997160ea5e02e7fc6eb877d5823e96b64523 (patch) | |
tree | d841fc4cad41d13437fbce025151b5b68cdeccd3 /mysql-test/r | |
parent | 52c98bf830cc14948f6a950961c77d64d20677a6 (diff) | |
download | mariadb-git-de86997160ea5e02e7fc6eb877d5823e96b64523.tar.gz |
MDEV-15581 Incorrect result (missing row) with UNION DISTINCT in anchor parts
The current code does not support recursive CTEs whose specifications
contain a mix of ALL UNION and DISTINCT UNION operations.
This patch catches such specifications and reports errors for them.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/cte_recursive.result | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index b7516b88f9a..2e93e9f6ff8 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -3243,3 +3243,23 @@ SELECT 1 FROM qn ORDER BY (SELECT * FROM qn)) SELECT count(*) FROM qn; ERROR 42000: This version of MariaDB doesn't yet support 'global ORDER_BY/LIMIT in recursive CTE spec' +# +# MDEV-15581: mix of ALL and DISTINCT UNION in recursive CTE +# +create table t1(a int); +insert into t1 values(1),(2); +insert into t1 values(1),(2); +set @c=0, @d=0; +WITH RECURSIVE qn AS +( +select 1,0 as col from t1 +union distinct +select 1,0 from t1 +union all +select 3, 0*(@c:=@c+1) from qn where @c<1 +union all +select 3, 0*(@d:=@d+1) from qn where @d<1 +) +select * from qn; +ERROR 42000: This version of MariaDB doesn't yet support 'mix of ALL and DISTINCT UNION operations in recursive CTE spec' +drop table t1; |