2021-09-09 09:37:51 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-02-16 19:45:47 +00:00
|
|
|
# Tags: no-parallel
|
|
|
|
# Tag no-parallel: since someone may create table in system database
|
2022-04-22 14:32:53 +00:00
|
|
|
|
|
|
|
# Server may ignore some exceptions, but it still print exceptions to logs and (at least in CI) sends Error and Warning log messages to client
|
|
|
|
# making test fail because of non-empty stderr. Ignore such log messages.
|
|
|
|
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=fatal
|
2022-04-12 15:56:22 +00:00
|
|
|
|
2021-09-09 09:37:51 +00:00
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
|
|
|
THREADS=8
|
|
|
|
RAND=$(($RANDOM))
|
|
|
|
LIMIT=10000
|
|
|
|
|
|
|
|
function run_selects()
|
|
|
|
{
|
|
|
|
thread_num=$1
|
|
|
|
readarray -t tables_arr < <(${CLICKHOUSE_CLIENT} -q "SELECT database || '.' || name FROM system.tables
|
2023-06-23 00:32:28 +00:00
|
|
|
WHERE database in ('system', 'information_schema', 'INFORMATION_SCHEMA') and name != 'zookeeper' and name != 'models'
|
2023-08-07 21:09:34 +00:00
|
|
|
AND sipHash64(name || toString($RAND)) % $THREADS = $thread_num AND name NOT LIKE '%\\_sender' AND name NOT LIKE '%\\_watcher'")
|
2021-09-09 09:37:51 +00:00
|
|
|
|
|
|
|
for t in "${tables_arr[@]}"
|
|
|
|
do
|
2023-11-06 04:43:04 +00:00
|
|
|
${CLICKHOUSE_CLIENT} -q "SELECT * FROM $t LIMIT $LIMIT SETTINGS allow_introspection_functions = 1 FORMAT Null" # Suppress style check: database=$CLICKHOUSE_DATABASEs
|
2021-09-09 09:37:51 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
for ((i=0; i<THREADS; i++)) do
|
|
|
|
run_selects "$i" &
|
|
|
|
done
|
|
|
|
wait
|