ClickHouse/dbms/tests/queries/0_stateless/00568_compile_catch_throw.sh
Vitaliy Lyudvichenko ed7cd86f09 Fixed several bug. Trun on --server_logs_level=warning in tests. [#CLICKHOUSE-2910]
Fixed several test to be compatible with --server_logs_level=warning.
2018-06-08 22:50:15 +03:00

14 lines
677 B
Bash
Executable File

#!/usr/bin/env bash
[ -z "$CLICKHOUSE_CLIENT" ] && CLICKHOUSE_CLIENT="clickhouse-client"
SETTINGS="--compile=1 --min_count_to_compile=0 --max_threads=1 --max_memory_usage=8000000 --server_logs_file=/dev/null"
output=$($CLICKHOUSE_CLIENT -q "SELECT length(groupArray(number)) FROM (SELECT * FROM system.numbers LIMIT 1000000)" $SETTINGS 2>&1)
[[ $? -eq 0 ]] && echo "Expected non-zero RC"
if ! echo "$output" | grep -Fc -e 'Memory limit (for query) exceeded' -e 'Cannot compile code' ; then
echo -e 'There is no expected exception "Memory limit (for query) exceeded: would use..." or "Cannot compile code..."' "Whereas got:\n$output"
fi
$CLICKHOUSE_CLIENT -q "SELECT 1"