mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Fix tests
This commit is contained in:
parent
a7543e3c7c
commit
3bbb329dd0
@ -587,8 +587,19 @@ void TCPHandler::runImpl()
|
|||||||
}
|
}
|
||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
/// Authentication failure with interserver secret.
|
/// Authentication failure with interserver secret
|
||||||
if (e.code() == ErrorCodes::AUTHENTICATION_FAILED)
|
/// - early exit without trying to send the exception to the client.
|
||||||
|
/// Because the server should not try to skip (parse, decompress) the remaining packets sent by the client,
|
||||||
|
/// as it will lead to additional work and unneeded exposure to unauthenticated connections.
|
||||||
|
|
||||||
|
/// Note that the exception AUTHENTICATION_FAILED can be here in two cases:
|
||||||
|
/// 1. The authentication in receiveHello is skipped with "interserver secret",
|
||||||
|
/// postponed to receiving the query, and then failed.
|
||||||
|
/// 2. Receiving exception from a query using a table function to authenticate with another server.
|
||||||
|
/// In this case, the user is already authenticated with this server,
|
||||||
|
/// is_interserver_mode is false, and we can send the exception to the client normally.
|
||||||
|
|
||||||
|
if (is_interserver_mode && e.code() == ErrorCodes::AUTHENTICATION_FAILED)
|
||||||
throw;
|
throw;
|
||||||
|
|
||||||
state.io.onException();
|
state.io.onException();
|
||||||
|
@ -4,7 +4,7 @@ select * from remote('127.0.0.2', system, one, 'default', '');
|
|||||||
select * from remote('127.0.0.2', system, one, 'default', 'wrong password'); -- { serverError AUTHENTICATION_FAILED }
|
select * from remote('127.0.0.2', system, one, 'default', 'wrong password'); -- { serverError AUTHENTICATION_FAILED }
|
||||||
select * from remote('127.0.0.2', system, one, 'nonexistsnt_user_1119', ''); -- { serverError AUTHENTICATION_FAILED }
|
select * from remote('127.0.0.2', system, one, 'nonexistsnt_user_1119', ''); -- { serverError AUTHENTICATION_FAILED }
|
||||||
set receive_timeout=1;
|
set receive_timeout=1;
|
||||||
select * from remote('127.0.0.2', system, one, ' INTERSERVER SECRET ', ''); -- { serverError NO_REMOTE_SHARD_AVAILABLE }
|
select * from remote('127.0.0.2', system, one, ' INTERSERVER SECRET ', ''); -- { serverError AUTHENTICATION_FAILED }
|
||||||
set receive_timeout=300;
|
set receive_timeout=300;
|
||||||
select * from remote('127.0.0.2', system, one, ' ', ''); -- { serverError AUTHENTICATION_FAILED }
|
select * from remote('127.0.0.2', system, one, ' ', ''); -- { serverError AUTHENTICATION_FAILED }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user