Fix ClickHouseDictionarySource wrong access check

This commit is contained in:
libenwang 2020-07-25 12:01:16 +08:00
parent 558f9c7630
commit b5bc7c0d97

View File

@ -74,7 +74,10 @@ ClickHouseDictionarySource::ClickHouseDictionarySource(
, load_all_query{query_builder.composeLoadAllQuery()}
{
/// We should set user info even for the case when the dictionary is loaded in-process (without TCP communication).
context.setUser(user, password, Poco::Net::SocketAddress("127.0.0.1", 0));
if (is_local)
{
context.setUser(user, password, Poco::Net::SocketAddress("127.0.0.1", 0));
}
context = copyContextAndApplySettings(path_to_settings, context, config);
/// Query context is needed because some code in executeQuery function may assume it exists.