2018-03-10 00:18:57 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2018-03-10 00:18:57 +00:00
|
|
|
|
2019-08-04 23:24:16 +00:00
|
|
|
default_exception_message="Value passed to 'throwIf' function is non zero"
|
|
|
|
custom_exception_message="Number equals 1000000"
|
2018-03-10 00:18:57 +00:00
|
|
|
|
2019-08-04 23:24:16 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --server_logs_file /dev/null --query="SELECT throwIf(number = 1000000) FROM system.numbers" 2>&1 | grep -cF "$default_exception_message"
|
2021-09-10 18:02:31 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --server_logs_file /dev/null --query="SELECT throwIf(number = 1000000, '$custom_exception_message') FROM system.numbers" 2>&1 | grep -v '^(query: ' | grep -cF "$custom_exception_message"
|
2019-08-06 14:26:51 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --server_logs_file /dev/null --query="SELECT sum(x = 0) FROM (SELECT throwIf(number = 1000000) AS x FROM numbers(1000000))" 2>&1
|