2018-02-12 14:57:25 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-02-15 15:48:26 +00:00
|
|
|
[ -z "$CLICKHOUSE_CLIENT" ] && CLICKHOUSE_CLIENT="clickhouse-client"
|
|
|
|
|
2018-02-13 09:58:42 +00:00
|
|
|
SETTINGS="--compile=1 --min_count_to_compile=0 --max_threads=1 --max_memory_usage=8000000"
|
2018-02-15 15:48:26 +00:00
|
|
|
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 'Memory limit (for query) exceeded' ; then
|
|
|
|
echo -e 'There is no expected exception "Memory limit (for query) exceeded: would use...". Got:' "\n$output"
|
2018-02-12 14:57:25 +00:00
|
|
|
fi
|
2018-02-15 15:48:26 +00:00
|
|
|
|
2018-02-12 14:57:25 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "SELECT 1"
|