mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #70191 from ClickHouse/backport/24.8/69676
Backport #69676 to 24.8: fix bug about `CREATE ... AS WITH RECURSIVE`
This commit is contained in:
commit
81b4accf1e
@ -121,7 +121,10 @@ private:
|
||||
{
|
||||
if (select.recursive_with)
|
||||
for (const auto & child : select.with()->children)
|
||||
with_aliases.insert(child->as<ASTWithElement>()->name);
|
||||
{
|
||||
if (typeid_cast<ASTWithElement *>(child.get()))
|
||||
with_aliases.insert(child->as<ASTWithElement>()->name);
|
||||
}
|
||||
|
||||
if (select.tables())
|
||||
tryVisit<ASTTablesInSelectQuery>(select.refTables());
|
||||
|
@ -0,0 +1,10 @@
|
||||
drop table if exists t;
|
||||
SET enable_analyzer = 1;
|
||||
create table t1 (a Int64, s DateTime('Asia/Istanbul')) Engine = MergeTree() ORDER BY a;
|
||||
create view t AS (
|
||||
WITH RECURSIVE 42 as ttt,
|
||||
toDate(s) as start_date,
|
||||
_table as (select 1 as number union all select number + 1 from _table where number < 10)
|
||||
SELECT a, ttt from t1 join _table on t1.a = _table.number and start_date = '2024-09-23'
|
||||
);
|
||||
drop table t;
|
Loading…
Reference in New Issue
Block a user