ClickHouse/tests/queries/0_stateless/02560_tuple_format.sh
Salvatore Mesoraca 8f65dc4ff7
ASTFunction: avoid rewriting tuple function as literal when not safe
It is not always safe to implicitly rewrite a `tuple` function
call to a literal. Even when the tuple has more then one element
e.g.
`SELECT (tuple(1, 2, 3) AS x).1` is not equivalent to
`SELECT ((1, 2, 3) AS x).1`, the latter is interpreted as
`SELECT tuple((1, 2, 3) AS x).1`.
2023-02-10 14:01:25 +01:00

11 lines
381 B
Bash
Executable File

#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
echo "select (tuple(1, 2, 3));" | "$CLICKHOUSE_FORMAT"
echo "select (tuple(1, 2, 3) as x);" | "$CLICKHOUSE_FORMAT"
echo "select (tuple(1, 2, 3)).1;" | "$CLICKHOUSE_FORMAT"
echo "select (tuple(1, 2, 3) as x).1;" | "$CLICKHOUSE_FORMAT"