From ddf231e57f68e4dae4b41896050e9579b94fdf6c Mon Sep 17 00:00:00 2001 From: proller Date: Sat, 17 Nov 2018 21:52:47 +0300 Subject: [PATCH] BI-154 Fix isLocal detection --- dbms/src/Interpreters/DDLWorker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbms/src/Interpreters/DDLWorker.cpp b/dbms/src/Interpreters/DDLWorker.cpp index c9e0d4f9622..77a4ec67b95 100644 --- a/dbms/src/Interpreters/DDLWorker.cpp +++ b/dbms/src/Interpreters/DDLWorker.cpp @@ -301,7 +301,11 @@ bool DDLWorker::initAndCheckTask(const String & entry_name, String & out_reason) for (const HostID & host : task->entry.hosts) { auto maybe_secure_port = context.getTCPPortSecure(); - bool is_local_port = maybe_secure_port ? host.isLocalAddress(*maybe_secure_port) : host.isLocalAddress(context.getTCPPort()); + bool is_local_port = false; + if (maybe_secure_port) + is_local_port = host.isLocalAddress(*maybe_secure_port); + if (!is_local_port) + is_local_port = host.isLocalAddress(context.getTCPPort()); if (!is_local_port) continue;