Commit 2820ad1c authored by Igor Babaev's avatar Igor Babaev

MDEV-26202 Unexpected failure with query using indirectly a recursive CTE twice

This bug was fixed by the patch for bug MDEV-26025.
Only a new test case is added here.
parent 742b3a0d
......@@ -4519,5 +4519,27 @@ drop procedure sp1;
drop procedure sp2;
drop table t1;
#
# MDEV-26202: Recursive CTE used indirectly twice
# (fixed by the patch forMDEV-26025)
#
with recursive
rcte as ( SELECT 1 AS a
UNION ALL
SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
cte1 AS (SELECT a FROM rcte),
cte2 AS (SELECT a FROM cte1),
cte3 AS ( SELECT a FROM cte2)
SELECT * FROM cte2, cte3;
a a
1 1
2 1
3 1
1 2
2 2
3 2
1 3
2 3
3 3
#
# End of 10.2 tests
#
......@@ -2884,6 +2884,20 @@ drop procedure sp2;
drop table t1;
--echo #
--echo # MDEV-26202: Recursive CTE used indirectly twice
--echo # (fixed by the patch forMDEV-26025)
--echo #
with recursive
rcte as ( SELECT 1 AS a
UNION ALL
SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
cte1 AS (SELECT a FROM rcte),
cte2 AS (SELECT a FROM cte1),
cte3 AS ( SELECT a FROM cte2)
SELECT * FROM cte2, cte3;
--echo #
--echo # End of 10.2 tests
--echo #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment