remote don't use rpc for local replicas

This commit is contained in:
Nikolai Kochetov 2018-01-26 17:39:31 +03:00
parent 288c6c8406
commit b0f66bb234
3 changed files with 3 additions and 3 deletions

View File

@ -1737,7 +1737,7 @@ void FunctionHasColumnInTable::executeImpl(Block & block, const ColumnNumbers &
else
{
std::vector<std::vector<String>> host_names = {{ host_name }};
auto cluster = std::make_shared<Cluster>(global_context.getSettings(), host_names, !user_name.empty() ? user_name : "default", password, global_context.getTCPPort());
auto cluster = std::make_shared<Cluster>(global_context.getSettings(), host_names, !user_name.empty() ? user_name : "default", password, global_context.getTCPPort(), false);
auto names_and_types_list = getStructureOfRemoteTable(*cluster, database_name, table_name, global_context);
const auto & names = names_and_types_list.getNames();
has_column = std::find(names.begin(), names.end(), column_name) != names.end();

View File

@ -24,7 +24,7 @@ public:
/// This parameter is needed only to check that some address is local (points to ourself).
Cluster(const Settings & settings, const std::vector<std::vector<String>> & names,
const String & username, const String & password,
UInt16 clickhouse_port, bool treat_local_as_shared = true);
UInt16 clickhouse_port, bool treat_local_as_shared);
Cluster(const Cluster &) = delete;
Cluster & operator=(const Cluster &) = delete;

View File

@ -274,7 +274,7 @@ StoragePtr TableFunctionRemote::execute(const ASTPtr & ast_function, const Conte
if (names.empty())
throw Exception("Shard list is empty after parsing first argument", ErrorCodes::BAD_ARGUMENTS);
auto cluster = std::make_shared<Cluster>(context.getSettings(), names, username, password, context.getTCPPort());
auto cluster = std::make_shared<Cluster>(context.getSettings(), names, username, password, context.getTCPPort(), false);
auto res = StorageDistributed::createWithOwnCluster(
getName(),