-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: Unexpected error when using recursive CTE #45869
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Description
REPRO:
root@:26257/defaultdb> with recursive x(a) as
((values ('a'), ('b'))
union all
(with z as (select * from x)
select z.a || z.a as a from z cross join z as z1
where length(z.a) < 3))
select * from x;
ERROR: couldn't find WITH expression "x" with ID 1
HINT: references to WITH expressions from correlated subqueries are unsupported
EXPECTED: No error, PG is able to run this query.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.