From 4c316e76718bb628ad94f39b17f35304cbc4f354 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Fri, 10 Jan 2020 12:20:40 +0100 Subject: [PATCH] add test --- .../01060_shutdown_table_after_detach.reference | 2 ++ .../01060_shutdown_table_after_detach.sql | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.reference create mode 100644 dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.sql diff --git a/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.reference b/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.reference new file mode 100644 index 00000000000..0970566bbf8 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.reference @@ -0,0 +1,2 @@ +0 +10000000 diff --git a/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.sql b/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.sql new file mode 100644 index 00000000000..00156fd8488 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01060_shutdown_table_after_detach.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS test Engine = MergeTree ORDER BY number AS SELECT number, toString(rand()) x from numbers(10000000); + +ALTER TABLE test detach partition tuple(); + +SELECT count() FROM test; + +DETACH TABLE test; +ATTACH TABLE test; + +ALTER TABLE test ATTACH PARTITION tuple(); + +SELECT count() FROM test; + +DROP TABLE test;