diff options
| author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-31 23:19:51 +0200 |
|---|---|---|
| committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-31 23:19:51 +0200 |
| commit | ae6bdc6769646a09a8d4d08a42a69174ea677768 (patch) | |
| tree | c80afdd0e3238dc5092fdcb1439f1390f9a9040b /mysql-test/main/cte_nonrecursive.test | |
| parent | a49f5525bbe1bb1f4320bd0db066068a81af62d9 (diff) | |
| parent | 7841a7eb09208f52fcbab7e80e38c7ca29b1339e (diff) | |
| download | mariadb-git-ae6bdc6769646a09a8d4d08a42a69174ea677768.tar.gz | |
Merge branch '10.4' into 10.5
Diffstat (limited to 'mysql-test/main/cte_nonrecursive.test')
| -rw-r--r-- | mysql-test/main/cte_nonrecursive.test | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test index ad03b25ceb6..8ab3bddc410 100644 --- a/mysql-test/main/cte_nonrecursive.test +++ b/mysql-test/main/cte_nonrecursive.test @@ -1504,6 +1504,56 @@ drop procedure sp3; drop table t1; +--echo # +--echo # MDEV-26095: missing RECURSIVE for the recursive definition of CTE +--echo # embedded into another CTE definition +--echo # + +create table t1 (a int); +insert into t1 values (5), (7); + +with cte_e as ( + with recursive cte_r as ( + select a from t1 union select a+1 as a from cte_r r where a < 10 + ) select * from cte_r +) select * from cte_e; + +--ERROR ER_NO_SUCH_TABLE +with cte_e as ( + with cte_r as ( + select a from t1 union select a+1 as a from cte_r r where a < 10 + ) select * from cte_r +) select * from cte_e; + +drop table t1; + +--echo # +--echo # MDEV-26025: query with two usage of a CTE executing via PS /SP +--echo # + +create table t1 (a int, b int); +insert into t1 value (1,3), (3,2), (1,3), (4,1); + +let $q= +with + cte1 as ( select a,b from t1 where a = 1 AND b = 3 ), + cte2 as ( select a,b from cte1 ), + cte3 as ( select a,b from cte2 ) +select * from cte3, cte2; + +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +eval create procedure sp() $q; + +call sp(); +call sp(); + +drop procedure sp; +drop table t1; + --echo # End of 10.2 tests --echo # |
