ClickHouse/tests/queries/0_stateless/03220_replace_formatting.reference
Azat Khuzhin 8bca80f4dd Fix REPLACE modifier formatting (forbid omitting brackets)
It is too tricky to verify does brackets required or not, i.e. "SELECT *
REPLACE(1/3/3 AS dummy)" will be formatted to "SELECT * REPLACE (1/3)/3 AS dummy"
which is already invalid query.

So let's simply always print them.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
v2: move the fix into correct place ASTColumnsReplaceTransformer::formatImpl() instead of ASTColumnsReplaceTransformer::Replacement::formatImpl()
2024-08-05 08:59:28 +02:00

17 lines
284 B
Plaintext

SELECT * REPLACE ((1 / 3) / 3 AS dummy)
SELECT * REPLACE ((1 / 3) / 3 AS dummy)
SELECT * REPLACE STRICT (1 AS id, 2 AS value)
FROM
(
SELECT
0 AS id,
1 AS value
)
SELECT * REPLACE STRICT (1 AS id, 2 AS value)
FROM
(
SELECT
0 AS id,
1 AS value
)