2017-03-04 01:58:45 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2017-01-24 13:39:39 +00:00
|
|
|
set -e
|
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
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-12-15 19:34:19 +00:00
|
|
|
|
2017-01-24 13:39:39 +00:00
|
|
|
QUERY_FIELND_NUM=4
|
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
$CLICKHOUSE_CLIENT --max_block_size=1 -q "SELECT sleep(1) FROM system.numbers LIMIT 4" &>/dev/null &
|
2017-02-03 16:15:12 +00:00
|
|
|
sleep 1
|
2017-12-15 19:34:19 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE query LIKE 'SELECT sleep(%' AND (elapsed >= 0.) SYNC" | cut -f $QUERY_FIELND_NUM
|
2017-01-24 13:39:39 +00:00
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
$CLICKHOUSE_CLIENT --max_block_size=1 -q "SELECT sleep(1) FROM system.numbers LIMIT 5" &>/dev/null &
|
2017-01-24 13:39:39 +00:00
|
|
|
sleep 1
|
2017-12-15 19:34:19 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE query = 'SELECT sleep(1) FROM system.numbers LIMIT 5' ASYNC" | cut -f $QUERY_FIELND_NUM
|
2017-01-24 13:39:39 +00:00
|
|
|
|
2017-12-15 19:34:19 +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
|