mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge branch 'master' of github.com:yandex/ClickHouse
This commit is contained in:
commit
798bee18a7
@ -47,6 +47,8 @@ public:
|
||||
String current_user;
|
||||
String current_query_id;
|
||||
Poco::Net::SocketAddress current_address;
|
||||
/// Use current user and password when sending query to replica leader
|
||||
String current_password;
|
||||
|
||||
/// When query_kind == INITIAL_QUERY, these values are equal to current.
|
||||
String initial_user;
|
||||
|
@ -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;
|
||||
|
@ -3270,14 +3270,14 @@ void StorageReplicatedMergeTree::sendRequestToLeaderReplica(const ASTPtr & query
|
||||
else
|
||||
throw Exception("Can't proxy this query. Unsupported query type", ErrorCodes::NOT_IMPLEMENTED);
|
||||
|
||||
/// NOTE Works only if there is access from the default user without a password. You can fix it by adding a parameter to the server config.
|
||||
/// Query send with current user credentials
|
||||
|
||||
auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithoutFailover(context.getSettingsRef());
|
||||
Connection connection(
|
||||
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({});
|
||||
|
Loading…
Reference in New Issue
Block a user