mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Ad tests with long select and simulatenous alter
This commit is contained in:
parent
b1e8976df4
commit
368286117a
@ -0,0 +1,3 @@
|
|||||||
|
10
|
||||||
|
5
|
||||||
|
CREATE TABLE default.alter_mt\n(\n `key` UInt64,\n `value` UInt64\n)\nENGINE = MergeTree()\nORDER BY key\nSETTINGS index_granularity = 8192
|
25
tests/queries/0_stateless/01338_long_select_and_alter.sh
Executable file
25
tests/queries/0_stateless/01338_long_select_and_alter.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
. $CURDIR/../shell_config.sh
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS alter_mt"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "CREATE TABLE alter_mt (key UInt64, value String) ENGINE=MergeTree() ORDER BY key"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "INSERT INTO alter_mt SELECT number, toString(number) FROM numbers(5)"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SELECT count(distinct concat(value, '_')) FROM alter_mt WHERE not sleepEachRow(2)" &
|
||||||
|
|
||||||
|
# to be sure that select took all required locks
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "ALTER TABLE alter_mt MODIFY COLUMN value UInt64"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SELECT sum(value) FROM alter_mt"
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SHOW CREATE TABLE alter_mt"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS alter_mt"
|
@ -0,0 +1,3 @@
|
|||||||
|
10
|
||||||
|
5
|
||||||
|
CREATE TABLE default.alter_mt\n(\n `key` UInt64,\n `value` UInt64\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/alter_mt\', \'1\')\nORDER BY key\nSETTINGS index_granularity = 8192
|
25
tests/queries/0_stateless/01338_long_select_and_alter_zookeeper.sh
Executable file
25
tests/queries/0_stateless/01338_long_select_and_alter_zookeeper.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
. $CURDIR/../shell_config.sh
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS alter_mt"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "CREATE TABLE alter_mt (key UInt64, value String) ENGINE=ReplicatedMergeTree('/clickhouse/tables/alter_mt', '1') ORDER BY key"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "INSERT INTO alter_mt SELECT number, toString(number) FROM numbers(5)"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SELECT count(distinct concat(value, '_')) FROM alter_mt WHERE not sleepEachRow(2)" &
|
||||||
|
|
||||||
|
# to be sure that select took all required locks
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "ALTER TABLE alter_mt MODIFY COLUMN value UInt64"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SELECT sum(value) FROM alter_mt"
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "SHOW CREATE TABLE alter_mt"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS alter_mt"
|
Loading…
Reference in New Issue
Block a user