ClickHouse/tests/queries/0_stateless/01881_negate_formatting.sql
Azat Khuzhin 9242654231 negate: replace special case with parens
v0: negate: add parens for negative values
    Before this patch -(-1) was formatted to --1, but this is not valid
    syntax.
v2: replace special case with parens, otherwise formatting of -(-(-1))
    will be unstable, in v0 it was formatted to -(1) but -(1) is
    formatted to -1 [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/24427/4512460aeb02fec557c558eee3f8291a6297efb2/fuzzer_asan/fuzzer.log
2021-06-17 10:07:03 +03:00

8 lines
205 B
SQL

-- { echo }
EXPLAIN SYNTAX SELECT -1;
EXPLAIN SYNTAX SELECT -(1);
EXPLAIN SYNTAX SELECT -(-(1));
EXPLAIN SYNTAX SELECT -(-(-(1)));
EXPLAIN SYNTAX SELECT -(-(-1));
EXPLAIN SYNTAX SELECT -(-toUInt64(-(1)));