Added more tests

This commit is contained in:
Alexey Milovidov 2019-05-16 22:26:32 +03:00
parent c9343c81b3
commit 842d62463b
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,12 @@
SELECT 1 IN (1)
SELECT 1 IN (1)
SELECT 1 IN (1, 2)
SELECT 1 IN (f(1))
SELECT 1 IN (f(1))
SELECT 1 IN (f(1), f(2))
SELECT 1 IN (f(1, 2))
SELECT 1 IN ((1 + 1))
SELECT 1 IN ('hello')
SELECT 1 IN (f('hello'))
SELECT 1 IN ('hello', 'world')
SELECT 1 IN (f('hello', 'world'))

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
set -e
echo "SELECT 1 IN 1" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN (1)" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN (1, 2)" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN f(1)" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN (f(1))" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN (f(1), f(2))" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN f(1, 2)" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN 1 + 1" | $CLICKHOUSE_FORMAT # This is quite strange
echo "SELECT 1 IN 'hello'" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN f('hello')" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN ('hello', 'world')" | $CLICKHOUSE_FORMAT
echo "SELECT 1 IN f('hello', 'world')" | $CLICKHOUSE_FORMAT

View File

@ -22,6 +22,10 @@ export CLICKHOUSE_CONFIG_CLIENT=${CLICKHOUSE_CONFIG_CLIENT:="/etc/clickhouse-cli
[ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_EXTRACT_CONFIG=${CLICKHOUSE_EXTRACT_CONFIG:="$CLICKHOUSE_BINARY extract-from-config --config=$CLICKHOUSE_CONFIG"}
export CLICKHOUSE_EXTRACT_CONFIG=${CLICKHOUSE_EXTRACT_CONFIG:="$CLICKHOUSE_BINARY-extract-from-config --config=$CLICKHOUSE_CONFIG"}
[ -x "${CLICKHOUSE_BINARY}-format" ] && CLICKHOUSE_FORMAT=${CLICKHOUSE_FORMAT=:="$CLICKHOUSE_BINARY-format"}
[ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_FORMAT=${CLICKHOUSE_FORMAT:="$CLICKHOUSE_BINARY format"}
export CLICKHOUSE_FORMAT=${CLICKHOUSE_FORMAT:="$CLICKHOUSE_BINARY-format"}
export CLICKHOUSE_CONFIG_GREP=${CLICKHOUSE_CONFIG_GREP:="/etc/clickhouse-server/preprocessed/config.xml"}
export CLICKHOUSE_HOST=${CLICKHOUSE_HOST:="localhost"}