2020-10-28 22:00:04 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-09-12 12:35:27 +00:00
|
|
|
# Tags: no-parallel, no-fasttest
|
|
|
|
# Tag no-fasttest: Checks system.errors
|
2020-10-28 22:00:04 +00:00
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-10-28 22:00:04 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
2021-03-08 19:05:51 +00:00
|
|
|
# local
|
|
|
|
prev="$(${CLICKHOUSE_CLIENT} -q "SELECT value FROM system.errors WHERE name = 'FUNCTION_THROW_IF_VALUE_IS_NON_ZERO' AND NOT remote")"
|
2020-10-28 22:00:04 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q 'SELECT throwIf(1)' >& /dev/null
|
2021-03-08 19:05:51 +00:00
|
|
|
cur="$(${CLICKHOUSE_CLIENT} -q "SELECT value FROM system.errors WHERE name = 'FUNCTION_THROW_IF_VALUE_IS_NON_ZERO' AND NOT remote")"
|
|
|
|
echo local=$((cur - prev))
|
|
|
|
|
|
|
|
# remote
|
|
|
|
prev="$(${CLICKHOUSE_CLIENT} -q "SELECT value FROM system.errors WHERE name = 'FUNCTION_THROW_IF_VALUE_IS_NON_ZERO' AND remote")"
|
|
|
|
${CLICKHOUSE_CLIENT} -q "SELECT * FROM remote('127.2', system.one) where throwIf(not dummy)" >& /dev/null
|
|
|
|
cur="$(${CLICKHOUSE_CLIENT} -q "SELECT value FROM system.errors WHERE name = 'FUNCTION_THROW_IF_VALUE_IS_NON_ZERO' AND remote")"
|
|
|
|
echo remote=$((cur - prev))
|