ClickHouse/tests/queries/0_stateless/02992_analyzer_group_by_const.sql
Azat Khuzhin b11b732e43 Add a test from #60046
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-12 12:32:19 +01:00

13 lines
770 B
SQL

SET allow_experimental_analyzer=1;
-- Illegal column String of first argument of function concatWithSeparator. Must be a constant String.
SELECT concatWithSeparator('a', 'b') GROUP BY 'a';
-- use-of-uninitialized-value
SELECT concatWithSeparator('|', 'a', concatWithSeparator('|', CAST('a', 'LowCardinality(String)'))) GROUP BY 'a';
SELECT concatWithSeparator('|', 'a', concatWithSeparator('|', CAST('x', 'LowCardinality(String)'))) GROUP BY 'a';
-- should be const like for the query w/o GROUP BY
select dumpColumnStructure('x') GROUP BY 'x';
select dumpColumnStructure('x');
-- from https://github.com/ClickHouse/ClickHouse/pull/60046
SELECT cityHash64('limit', _CAST(materialize('World'), 'LowCardinality(String)')) FROM system.one GROUP BY GROUPING SETS ('limit');