From 73460a5f8663cb5d09ac06f42234d14a8a29c92c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 11 Jan 2018 21:55:31 +0300 Subject: [PATCH] Fixed error [#CLICKHOUSE-2]. --- dbms/src/Common/parseAddress.cpp | 2 +- dbms/src/Interpreters/Cluster.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Common/parseAddress.cpp b/dbms/src/Common/parseAddress.cpp index 5cfd480344d..5cd6d353e42 100644 --- a/dbms/src/Common/parseAddress.cpp +++ b/dbms/src/Common/parseAddress.cpp @@ -35,7 +35,7 @@ std::pair parseAddress(const std::string & str, UInt16 defa if (port != end) { - UInt16 port_number = parse(port); + UInt16 port_number = parse(port + 1); return { std::string(begin, port), port_number }; } else if (default_port) diff --git a/dbms/src/Interpreters/Cluster.cpp b/dbms/src/Interpreters/Cluster.cpp index 76ea391ce1a..29ad7e674f3 100644 --- a/dbms/src/Interpreters/Cluster.cpp +++ b/dbms/src/Interpreters/Cluster.cpp @@ -75,8 +75,8 @@ Cluster::Address::Address(const String & host_port_, const String & user_, const auto parsed_host_port = parseAddress(host_port_, clickhouse_port); resolved_address = resolveSocketAddress(parsed_host_port.first, parsed_host_port.second); - host_name = host_port_; - port = clickhouse_port; + host_name = parsed_host_port.first; + port = parsed_host_port.second; is_local = isLocal(*this, clickhouse_port); }