mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Added a test for race condition
This commit is contained in:
parent
478b721b36
commit
0a072ccc57
32
dbms/tests/queries/0_stateless/00941_system_columns_race_condition.sh
Executable file
32
dbms/tests/queries/0_stateless/00941_system_columns_race_condition.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Test fix for issue #5066
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
. $CURDIR/../shell_config.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS alter_table"
|
||||||
|
$CLICKHOUSE_CLIENT -q "CREATE TABLE alter_table (a UInt8, b Int16, c Float32, d String, e Array(UInt8), f Nullable(UUID), g Tuple(UInt8, UInt16)) ENGINE = MergeTree ORDER BY a"
|
||||||
|
|
||||||
|
function thread1()
|
||||||
|
{
|
||||||
|
while true; do $CLICKHOUSE_CLIENT --query "SELECT * FROM system.columns FORMAT Null"; done
|
||||||
|
}
|
||||||
|
|
||||||
|
function thread2()
|
||||||
|
{
|
||||||
|
while true; do $CLICKHOUSE_CLIENT -n --query "ALTER TABLE alter_table ADD COLUMN h String; ALTER TABLE alter_table MODIFY COLUMN h UInt64; ALTER TABLE alter_table DROP COLUMN h;"; done
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
||||||
|
export -f thread1;
|
||||||
|
export -f thread2;
|
||||||
|
|
||||||
|
timeout 5 bash -c thread1 &
|
||||||
|
timeout 5 bash -c thread2 &
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT -q "DROP TABLE alter_table"
|
Loading…
Reference in New Issue
Block a user