mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
some refactoring
This commit is contained in:
parent
2e34b384c1
commit
1680be19ca
@ -170,7 +170,7 @@ void Connection::connect(const ConnectionTimeouts & timeouts)
|
||||
|
||||
sendHello();
|
||||
receiveHello();
|
||||
if (server_revision >= DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY)
|
||||
if (server_revision >= DBMS_MIN_PROTOCOL_VERSION_WITH_ADDENDUM)
|
||||
sendAddendum();
|
||||
|
||||
LOG_TRACE(log_wrapper.get(), "Connected to {} server version {}.{}.{}.",
|
||||
@ -271,7 +271,8 @@ void Connection::sendHello()
|
||||
|
||||
void Connection::sendAddendum()
|
||||
{
|
||||
writeStringBinary(quota_key, *out);
|
||||
if (server_revision >= DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY)
|
||||
writeStringBinary(quota_key, *out);
|
||||
out->next();
|
||||
}
|
||||
|
||||
|
@ -60,4 +60,6 @@
|
||||
|
||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_VIEW_IF_PERMITTED 54457
|
||||
|
||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_ADDENDUM 54458
|
||||
|
||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY 54458
|
||||
|
@ -134,7 +134,7 @@ void TCPHandler::runImpl()
|
||||
{
|
||||
receiveHello();
|
||||
sendHello();
|
||||
if (client_tcp_protocol_version >= DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY)
|
||||
if (client_tcp_protocol_version >= DBMS_MIN_PROTOCOL_VERSION_WITH_ADDENDUM)
|
||||
receiveAddendum();
|
||||
|
||||
if (!is_interserver_mode) /// In interserver mode queries are executed without a session context.
|
||||
@ -1082,8 +1082,11 @@ void TCPHandler::receiveHello()
|
||||
|
||||
void TCPHandler::receiveAddendum()
|
||||
{
|
||||
readStringBinary(quota_key, *in);
|
||||
session->getClientInfo().quota_key = quota_key;
|
||||
if (client_tcp_protocol_version >= DBMS_MIN_PROTOCOL_VERSION_WITH_QUOTA_KEY)
|
||||
{
|
||||
readStringBinary(quota_key, *in);
|
||||
session->getClientInfo().quota_key = quota_key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user