mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bugs: mdev-13780 CTE not found, mdev-14184 recursive CTE not found
The support of embedded CTEs was not correct in the cases when embedded CTEs were used multiple times. The problems occurred with both non-recursive (bug mdev-13780) and recursive (bug mdev-14184) embedded CTEs.
This commit is contained in:
@ -1928,3 +1928,22 @@ set standard_compliant_cte=default;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # mdev-14184: recursive CTE embedded into CTE with multiple references
|
||||
--echo #
|
||||
|
||||
WITH
|
||||
cte1 AS (
|
||||
SELECT n FROM (
|
||||
WITH RECURSIVE rec_cte(n) AS (
|
||||
SELECT 1 as n1
|
||||
UNION ALL
|
||||
SELECT n+1 as n2 FROM rec_cte WHERE n < 3
|
||||
) SELECT n FROM rec_cte
|
||||
) AS X
|
||||
),
|
||||
cte2 as (
|
||||
SELECT 2 FROM cte1
|
||||
)
|
||||
SELECT *
|
||||
FROM cte1;
|
||||
|
Reference in New Issue
Block a user