ClickHouse/dbms/tests/queries/0_stateless/00840_long_concurrent_select_and_drop_deadlock.sh
2019-03-18 18:40:53 +03:00

16 lines
532 B
Bash
Executable File

#!/usr/bin/env bash
set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
for i in {1..200}; do echo "drop table if exists test.view" | $CLICKHOUSE_CLIENT; echo "create view test.view as select count(*),database,table from system.columns group by database,table" | $CLICKHOUSE_CLIENT; done &
for i in {1..500}; do echo "select * from test.view order by table" | $CLICKHOUSE_CLIENT >/dev/null 2>&1 || true; done &
wait
echo "drop table test.view" | $CLICKHOUSE_CLIENT
echo 'did not deadlock'