risingwavelabs / risingwave

Best-in-class stream processing, analytics, and management. Perform continuous analytics, or build event-driven applications, real-time ETL pipelines, and feature stores in minutes. Unified streaming and batch. PostgreSQL compatible.
https://go.risingwave.com/slack
Apache License 2.0
6.88k stars 569 forks source link

duplicated CTE names are allowed #12513

Open xxchan opened 1 year ago

xxchan commented 1 year ago

Describe the bug

dev=> with cte1 as (select 42), cte1 as (select 43) select * FROM cte1;
 ?column? 
----------
       43
(1 row)

Error message/log

No response

To Reproduce

No response

Expected behavior

error: WITH query name "cte1" specified more than once

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

found in https://github.com/risingwavelabs/risingwave/issues/5987

xxchan commented 1 year ago

It seems this occurs after supporting #7212

# refer to same-named CTE in a subquery expression
query I
with cte as (Select i as j from a) select * from cte where j = (with cte as (select max(j) as j from cte) select j from cte);
----
42
github-actions[bot] commented 3 months ago

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.