From bd77908c9319ca66581f64e4aa62725836679621 Mon Sep 17 00:00:00 2001 From: dgrr Date: Wed, 13 May 2020 18:31:23 +0200 Subject: [PATCH] Added multiline test --- .../01278_format_multiple_queries.reference | 16 ++++++++++++++++ .../01278_format_multiple_queries.sh | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/queries/0_stateless/01278_format_multiple_queries.reference create mode 100755 tests/queries/0_stateless/01278_format_multiple_queries.sh diff --git a/tests/queries/0_stateless/01278_format_multiple_queries.reference b/tests/queries/0_stateless/01278_format_multiple_queries.reference new file mode 100644 index 00000000000..cba2cc7b320 --- /dev/null +++ b/tests/queries/0_stateless/01278_format_multiple_queries.reference @@ -0,0 +1,16 @@ +SELECT + a, + b AS x +FROM table AS t +INNER JOIN table2 AS t2 ON t.id = t2.t_id +WHERE 1 = 1 +; + +SELECT + a, + b AS x, + if(x = 0, a, b) +FROM table2 AS t +WHERE t.id != 0 +; + diff --git a/tests/queries/0_stateless/01278_format_multiple_queries.sh b/tests/queries/0_stateless/01278_format_multiple_queries.sh new file mode 100755 index 00000000000..090e1f9d664 --- /dev/null +++ b/tests/queries/0_stateless/01278_format_multiple_queries.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +set -e + +format="$CLICKHOUSE_FORMAT -n" + +$format <