This commit is contained in:
Nikolay Degterinsky 2024-09-11 22:59:06 +02:00 committed by GitHub
parent b30aabf635
commit 8e3ba4bd6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1549,3 +1549,25 @@ def test_all_groups_cluster(started_cluster):
assert "bad_settings_node\ndummy_node\n" == bad_settings_node.query(
"select host_name from system.clusters where name='all_groups.db_cluster' order by host_name"
)
def test_detach_attach_table(started_cluster):
main_node.query("DROP DATABASE IF EXISTS detach_attach_db SYNC")
main_node.query(
"CREATE DATABASE detach_attach_db ENGINE = Replicated('/clickhouse/databases/detach_attach_db');"
)
main_node.query(
"CREATE TABLE detach_attach_db.detach_attach_table (k UInt64) ENGINE=ReplicatedMergeTree ORDER BY k;"
)
main_node.query(
"INSERT INTO detach_attach_db.detach_attach_table VALUES (1);"
)
main_node.query(
"DETACH TABLE detach_attach_db.detach_attach_table PERMANENTLY;"
)
main_node.query(
"ATTACH TABLE detach_attach_db.detach_attach_table;"
)
assert (
main_node.query("SELECT * FROM detach_attach_db.detach_attach_table;") == "1\n"
)