ClickHouse/tests/queries/0_stateless/01442_merge_detach_attach_long.sh

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

25 lines
791 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2023-04-26 11:14:54 +00:00
# Tags: long, no-parallel, no-debug
set -e
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2023-07-07 01:54:10 +00:00
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=none
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS t"
${CLICKHOUSE_CLIENT} --query="CREATE TABLE t (x Int8) ENGINE = MergeTree ORDER BY tuple()"
for _ in {1..100}; do
${CLICKHOUSE_CLIENT} --query="INSERT INTO t VALUES (0)"
${CLICKHOUSE_CLIENT} --query="INSERT INTO t VALUES (0)"
${CLICKHOUSE_CLIENT} --query="OPTIMIZE TABLE t FINAL" 2>/dev/null &
${CLICKHOUSE_CLIENT} --query="ALTER TABLE t DETACH PARTITION tuple()"
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM t HAVING count() > 0"
done
wait
$CLICKHOUSE_CLIENT -q "DROP TABLE t"