diff --git a/tests/queries/0_stateless/02006_use_constants_in_with_and_select.sql b/tests/queries/0_stateless/02006_use_constants_in_with_and_select.sql new file mode 100644 index 00000000000..91171c9ab7b --- /dev/null +++ b/tests/queries/0_stateless/02006_use_constants_in_with_and_select.sql @@ -0,0 +1,36 @@ +SELECT + 1 AS max_size, + groupArray(max_size)(col) +FROM + ( + SELECT 1 AS col + UNION ALL + SELECT 2 + ); + +WITH 1 AS max_size +SELECT groupArray(max_size)(col) +FROM + ( + SELECT 1 as col + UNION ALL + SELECT 2 + ); + +WITH 0.1 AS level +SELECT quantile(level)(number) +FROM numbers(1000); + +SELECT 0.1 AS level, quantile(level)(number) +FROM numbers(1000); + +WITH + 0.1 AS level, + 1 AS max_size +SELECT groupArray(max_size)(col) +FROM + ( + SELECT quantile(level)(number) AS col + FROM numbers(1000) + ); +