2018-10-23 20:14:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2018-10-23 20:14:43 +00:00
|
|
|
|
|
|
|
export SQL_FUZZY_FILE_FUNCTIONS=${CLICKHOUSE_TMP}/clickhouse-functions
|
2020-08-01 00:56:32 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "select name from system.functions format TSV;" > "$SQL_FUZZY_FILE_FUNCTIONS"
|
2018-10-23 20:14:43 +00:00
|
|
|
|
|
|
|
export SQL_FUZZY_FILE_TABLE_FUNCTIONS=${CLICKHOUSE_TMP}/clickhouse-table_functions
|
2020-08-01 00:56:32 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "select name from system.table_functions format TSV;" > "$SQL_FUZZY_FILE_TABLE_FUNCTIONS"
|
2018-10-23 20:14:43 +00:00
|
|
|
|
|
|
|
# This is short run for ordinary tests.
|
|
|
|
# if you want long run use: env SQL_FUZZY_RUNS=100000 clickhouse-test sql_fuzzy
|
|
|
|
|
2020-08-01 00:56:32 +00:00
|
|
|
for SQL_FUZZY_RUN in $(seq "${SQL_FUZZY_RUNS:=10}"); do
|
|
|
|
env SQL_FUZZY_RUN="$SQL_FUZZY_RUN" "$CURDIR"/00746_sql_fuzzy.pl | $CLICKHOUSE_CLIENT --format Null --max_execution_time 10 -n --ignore-error >/dev/null 2>&1
|
2020-08-01 01:20:22 +00:00
|
|
|
if [[ $($CLICKHOUSE_CLIENT -q "SELECT 'Still alive'") != 'Still alive' ]]; then
|
2018-10-23 20:14:43 +00:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
$CLICKHOUSE_CLIENT -q "SELECT 'Still alive'"
|
2018-10-24 17:20:27 +00:00
|
|
|
|
|
|
|
# Query replay:
|
|
|
|
# cat clickhouse-server.log | grep -aF "<Debug> executeQuery: (from " | perl -lpe 's/^.*executeQuery: \(from \S+\) (.*)/$1;/' | clickhouse-client -n --ignore-error
|