mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 12:22:12 +00:00
Backport #67129 to 24.6: Fix truncate database
This commit is contained in:
parent
6938ce9a9f
commit
b474ce4ab8
@ -398,10 +398,9 @@ BlockIO InterpreterDropQuery::executeToDatabaseImpl(const ASTDropQuery & query,
|
||||
if (query.if_empty)
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "DROP IF EMPTY is not implemented for databases");
|
||||
|
||||
if (database->hasReplicationThread())
|
||||
if (!truncate && database->hasReplicationThread())
|
||||
database->stopReplication();
|
||||
|
||||
|
||||
if (database->shouldBeEmptyOnDetach())
|
||||
{
|
||||
/// Cancel restarting replicas in that database, wait for remaining RESTART queries to finish.
|
||||
|
@ -20,3 +20,5 @@ source_table_stripe_log
|
||||
source_table_tiny_log
|
||||
=== DICTIONARIES IN test_truncate_database ===
|
||||
dest_dictionary
|
||||
new tables
|
||||
new_table
|
||||
|
@ -73,4 +73,8 @@ SELECT * FROM dest_dictionary; -- {serverError UNKNOWN_TABLE}
|
||||
SHOW TABLES FROM test_truncate_database;
|
||||
SHOW DICTIONARIES FROM test_truncate_database;
|
||||
|
||||
CREATE TABLE new_table (x UInt16) ENGINE = MergeTree ORDER BY x;
|
||||
select 'new tables';
|
||||
SHOW TABLES FROM test_truncate_database;
|
||||
|
||||
DROP DATABASE test_truncate_database;
|
||||
|
Loading…
Reference in New Issue
Block a user