2020-06-10 14:24:42 +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
|
2020-06-10 14:24:42 +00:00
|
|
|
|
2024-07-22 08:46:42 +00:00
|
|
|
rnd="$CLICKHOUSE_DATABASE"
|
|
|
|
url="${CLICKHOUSE_URL}&session_id=test_01194_${CLICKHOUSE_DATABASE}"
|
2020-06-10 14:24:42 +00:00
|
|
|
|
2020-10-08 13:48:23 +00:00
|
|
|
${CLICKHOUSE_CURL} -sS "$url&query=SELECT+'test_01194',$rnd,1" > /dev/null
|
|
|
|
${CLICKHOUSE_CURL} -sS "$url&query=SELECT+'test_01194',$rnd,2" > /dev/null
|
|
|
|
${CLICKHOUSE_CURL} -sS "$url" --data "SELECT 'test_01194',$rnd,3" > /dev/null
|
|
|
|
${CLICKHOUSE_CURL} -sS "$url" --data "SELECT 'test_01194',$rnd,4" > /dev/null
|
2020-06-10 14:24:42 +00:00
|
|
|
|
2024-07-22 08:46:42 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "SYSTEM FLUSH LOGS"
|
2020-06-10 14:24:42 +00:00
|
|
|
|
2024-07-22 08:46:42 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "
|
|
|
|
SELECT
|
|
|
|
count(DISTINCT query_id)
|
|
|
|
FROM system.query_log
|
|
|
|
WHERE
|
|
|
|
current_database = currentDatabase()
|
|
|
|
AND event_date >= yesterday()
|
|
|
|
AND query LIKE 'SELECT ''test_01194'',$rnd%'
|
|
|
|
AND query_id != queryID()"
|