diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-11-17 13:55:54 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-11-17 13:55:54 +0200 |
commit | 9962cda52722b77c2a7e0314bbaa2e4f963f55c1 (patch) | |
tree | 576d56bc2ddf7f644ce56c4a1ef27ca59cc42290 /mysql-test/main/cte_nonrecursive.result | |
parent | 7ea12742d30be7b56120f1bf66d91f777b1da450 (diff) | |
parent | ed0a224b3d42423699d977c338e3da05fccafaf2 (diff) | |
download | mariadb-git-9962cda52722b77c2a7e0314bbaa2e4f963f55c1.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/cte_nonrecursive.result')
-rw-r--r-- | mysql-test/main/cte_nonrecursive.result | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result index 2c3555755cd..eacc742b544 100644 --- a/mysql-test/main/cte_nonrecursive.result +++ b/mysql-test/main/cte_nonrecursive.result @@ -2086,6 +2086,56 @@ a b a b 1 3 1 3 drop procedure sp; drop table t1; +# +# MDEV-26825: query with two usage of CTE that refers to another CTE +# with stored function using a base table. +# +create table t1 (id int primary key); +insert into t1 values +(1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +create function f(in_id int) returns integer +return (select id from t1 where t1.id = in_id); +with c1 as (select id from t1 where f(id)=id group by id), +c2 as (select id from c1 as pt group by id) +select id from c2 as s1 union select id from c2 as s2; +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +with c1 as (select id from t1 as r where f(id)=id group by id), +c2 as (select id from c1 as pt group by id) +select id from c2 as s1 union select id from c2 as s2; +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +create function g() returns int return (select count(*) from t1); +create procedure sp1() +with c1 as (select id from t1 a where g() > 10), +c2 as (select id from c1) +select id from c2 as s1 union select id from c2 as s2; +call sp1(); +id +call sp1(); +id +drop procedure sp1; +drop function g; +drop function f; +drop table t1; # End of 10.2 tests # # MDEV-21673: several references to CTE that uses |