mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #65081 from ClickHouse/fix-64849
Fix infinite query duration in case of cyclic aliases.
This commit is contained in:
commit
fe4c4db6ac
@ -75,7 +75,12 @@ struct ScopeAliases
|
|||||||
if (jt == transitive_aliases.end())
|
if (jt == transitive_aliases.end())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
key = &(getKey(jt->second, find_option));
|
const auto & new_key = getKey(jt->second, find_option);
|
||||||
|
/// Ignore potential cyclic aliases.
|
||||||
|
if (new_key == *key)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
key = &new_key;
|
||||||
it = alias_map.find(*key);
|
it = alias_map.find(*key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
1 2 3
|
1 2 3
|
||||||
1 5
|
1 5
|
||||||
|
300
|
||||||
|
@ -30,3 +30,7 @@ WHERE (time_stamp_utc >= toDateTime('2024-04-25 00:00:00')) AND (time_stamp_utc
|
|||||||
GROUP BY time_stamp_utc
|
GROUP BY time_stamp_utc
|
||||||
ORDER BY Impressions DESC
|
ORDER BY Impressions DESC
|
||||||
LIMIT 1000;
|
LIMIT 1000;
|
||||||
|
|
||||||
|
drop table test_table;
|
||||||
|
create table test_table engine MergeTree order by sum as select 100 as sum union all select 200 as sum;
|
||||||
|
select sum as sum from (select sum(sum) as sum from test_table);
|
||||||
|
Loading…
Reference in New Issue
Block a user