CLICKHOUSE-3700: Fix empty password on replica query

This commit is contained in:
proller 2018-04-10 17:49:52 +03:00
parent d3cf85057b
commit 157067b127
3 changed files with 3 additions and 1 deletions

View File

@ -47,6 +47,7 @@ public:
String current_user;
String current_query_id;
Poco::Net::SocketAddress current_address;
String current_password;
/// When query_kind == INITIAL_QUERY, these values are equal to current.
String initial_user;

View File

@ -564,6 +564,7 @@ void Context::setUser(const String & name, const String & password, const Poco::
client_info.current_user = name;
client_info.current_address = address;
client_info.current_password = password;
if (!quota_key.empty())
client_info.quota_key = quota_key;

View File

@ -3277,7 +3277,7 @@ void StorageReplicatedMergeTree::sendRequestToLeaderReplica(const ASTPtr & query
leader_address.host,
leader_address.queries_port,
leader_address.database,
"", "", timeouts, "ClickHouse replica");
context.getClientInfo().current_user, context.getClientInfo().current_password, timeouts, "ClickHouse replica");
RemoteBlockInputStream stream(connection, formattedAST(new_query), {}, context, &settings);
NullBlockOutputStream output({});