From 0f509b9eb501007f2ba033aa9bac107f2878fad9 Mon Sep 17 00:00:00 2001 From: Kirill Shvakov Date: Sat, 13 Oct 2018 23:58:04 +0300 Subject: [PATCH] ReplicatedMergeTree: send drop request to the leader replica --- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index ddb5d20599e..27651b03a5c 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -3826,6 +3827,11 @@ void StorageReplicatedMergeTree::sendRequestToLeaderReplica(const ASTPtr & query optimize->database = leader_address.database; optimize->table = leader_address.table; } + else if (auto * drop = typeid_cast(new_query.get())) + { + drop->database = leader_address.database; + drop->table = leader_address.table; + } else throw Exception("Can't proxy this query. Unsupported query type", ErrorCodes::NOT_IMPLEMENTED);