ClickHouse/tests/queries/0_stateless/00417_kill_query.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
1.0 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2023-04-20 11:15:00 +00:00
# Tags: no-fasttest
2017-01-24 13:39:39 +00:00
set -e
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
2017-01-24 13:39:39 +00:00
QUERY_FIELND_NUM=4
2023-06-28 10:43:10 +00:00
$CLICKHOUSE_CLIENT --max_block_size=1 -q "SELECT sleep(1) FROM system.numbers LIMIT 30" &>/dev/null &
sleep 1
2023-04-20 11:15:00 +00:00
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE current_database = '${CLICKHOUSE_DATABASE}' and query LIKE 'SELECT sleep(%' AND (elapsed >= 0.) SYNC" | cut -f $QUERY_FIELND_NUM
2017-01-24 13:39:39 +00:00
2023-06-28 19:45:56 +00:00
# 31 is for the query to be different from the previous one
2023-06-28 10:43:10 +00:00
$CLICKHOUSE_CLIENT --max_block_size=1 -q "SELECT sleep(1) FROM system.numbers LIMIT 31" &>/dev/null &
2017-01-24 13:39:39 +00:00
sleep 1
2023-06-28 10:43:10 +00:00
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE current_database = '${CLICKHOUSE_DATABASE}' and query = 'SELECT sleep(1) FROM system.numbers LIMIT 31' ASYNC" | cut -f $QUERY_FIELND_NUM
2017-01-24 13:39:39 +00:00
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE 0 ASYNC"
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE 0 FORMAT TabSeparated"
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE 0 SYNC FORMAT TabSeparated"
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE 1 TEST" &>/dev/null