From e6ec9eaad3c427f0caee8f335acb5cdd551a1d6f Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Fri, 13 Sep 2024 02:18:24 +0000 Subject: [PATCH] Conflict --- src/Storages/MergeTree/registerStorageMergeTree.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Storages/MergeTree/registerStorageMergeTree.cpp b/src/Storages/MergeTree/registerStorageMergeTree.cpp index 6af334bf81e..75714cda4d9 100644 --- a/src/Storages/MergeTree/registerStorageMergeTree.cpp +++ b/src/Storages/MergeTree/registerStorageMergeTree.cpp @@ -212,6 +212,9 @@ static TableZnodeInfo extractZooKeeperPathAndReplicaNameFromEngineArgs( if (has_valid_arguments) { + bool is_replicated_database = local_context->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY && + DatabaseCatalog::instance().getDatabase(table_id.database_name)->getEngineName() == "Replicated"; + if (is_replicated_database && local_context->getSettingsRef().database_replicated_allow_replicated_engine_arguments == 0) { throw Exception(ErrorCodes::BAD_ARGUMENTS, @@ -238,7 +241,7 @@ static TableZnodeInfo extractZooKeeperPathAndReplicaNameFromEngineArgs( if (is_replicated_database && local_context->getSettingsRef().database_replicated_allow_replicated_engine_arguments == 2) { LOG_WARNING(&Poco::Logger::get("registerStorageMergeTree"), "Replacing user-provided ZooKeeper path and replica name ({}, {}) " - "with default arguments", zookeeper_path, replica_name); + "with default arguments", ast_zk_path->value.safeGet(), ast_replica_name->value.safeGet()); ast_zk_path->value = server_settings.default_replica_path; ast_replica_name->value = server_settings.default_replica_name; }