Skip to content
Permalink
Browse files
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.
  • Loading branch information
igorbabaev committed Jul 23, 2021
1 parent 742b3a0 commit 2820ad1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
@@ -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 #

0 comments on commit 2820ad1

Please sign in to comment.