From 6164506a5ebb50bd451c4305bbc30a54085106da Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 10 Aug 2022 10:52:58 +0200 Subject: [PATCH] tests: fix 02380_insert_mv_race for Ordinary database Signed-off-by: Azat Khuzhin --- tests/queries/0_stateless/02380_insert_mv_race.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02380_insert_mv_race.sh b/tests/queries/0_stateless/02380_insert_mv_race.sh index 3edf99fb502..725c7eacce6 100755 --- a/tests/queries/0_stateless/02380_insert_mv_race.sh +++ b/tests/queries/0_stateless/02380_insert_mv_race.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Tags: long, race, no-ordinary-database +# Tags: long, race # Regression test for INSERT into table with MV attached, # to avoid possible errors if some table will disappears, @@ -9,6 +9,12 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CUR_DIR"/../shell_config.sh +$CLICKHOUSE_CLIENT -nm -q "ATTACH TABLE mv" |& { + # CANNOT_GET_CREATE_TABLE_QUERY -- ATTACH TABLE IF EXISTS + # TABLE_ALREADY_EXISTS -- ATTACH TABLE IF NOT EXISTS + grep -F -m1 Exception | grep -v -e CANNOT_GET_CREATE_TABLE_QUERY -e TABLE_ALREADY_EXISTS +} + $CLICKHOUSE_CLIENT -nm -q " DROP TABLE IF EXISTS null; CREATE TABLE null (key Int) ENGINE = Null; @@ -23,4 +29,8 @@ $CLICKHOUSE_CLIENT -q "INSERT INTO null SELECT * FROM numbers_mt(1000) settings } & sleep 0.05 $CLICKHOUSE_CLIENT -q "DETACH TABLE mv" + +# avoid leftovers on DROP DATABASE (force_remove_data_recursively_on_drop) for Ordinary database +$CLICKHOUSE_CLIENT -q "ATTACH TABLE mv" + wait