From b31f696aae3e00ba647065a3bbfde2f9a2fd752b Mon Sep 17 00:00:00 2001 From: Vladimir C Date: Tue, 18 Apr 2023 16:10:46 +0200 Subject: [PATCH] Fix iteration in Context::getClusters --- src/Interpreters/Context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 22955bf08b2..ddba935e59f 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -3017,7 +3017,8 @@ std::map Context::getClusters() const if (shared->cluster_discovery) { - for (const auto & [name, cluster] : shared->cluster_discovery->getClusters()) + const auto & cluster_discovery_map = shared->cluster_discovery->getClusters(); + for (const auto & [name, cluster] : cluster_discovery_map) clusters.emplace(name, cluster); } return clusters;