未验证 提交 4f819314 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #3375 from...

Merge pull request #3375 from ClickHouse-Ninja/replicated-merge-tree-send-drop-request-to-the-leader-replica

ReplicatedMergeTree: send drop request to the leader replica
......@@ -15,6 +15,7 @@
#include <Databases/IDatabase.h>
#include <Parsers/formatAST.h>
#include <Parsers/ASTDropQuery.h>
#include <Parsers/ASTOptimizeQuery.h>
#include <Parsers/ASTLiteral.h>
......@@ -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<ASTDropQuery *>(new_query.get()); drop->kind == ASTDropQuery::Kind::Truncate)
{
drop->database = leader_address.database;
drop->table = leader_address.table;
}
else
throw Exception("Can't proxy this query. Unsupported query type", ErrorCodes::NOT_IMPLEMENTED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册