diff --git a/clickhouse_driver/connection.py b/clickhouse_driver/connection.py index e69f089a..eee4a89d 100644 --- a/clickhouse_driver/connection.py +++ b/clickhouse_driver/connection.py @@ -20,7 +20,7 @@ from .progress import Progress from .protocol import Compression, ClientPacketTypes, ServerPacketTypes from .queryprocessingstage import QueryProcessingStage -from .reader import read_binary_str +from .reader import read_binary_str, read_binary_uint64 from .readhelpers import read_exception from .settings.writer import write_settings, SettingsFlags from .streams.native import BlockInputStream, BlockOutputStream @@ -504,6 +504,10 @@ def receive_hello(self): read_binary_str(self.fin) # original_pattern read_binary_str(self.fin) # exception_message + if used_revision >= defines. \ + DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET_V2: + read_binary_uint64(self.fin) # read_nonce + self.server_info = ServerInfo( server_name, server_version_major, server_version_minor, server_version_patch, server_revision, diff --git a/clickhouse_driver/defines.py b/clickhouse_driver/defines.py index 968bb2ec..2bb930f8 100644 --- a/clickhouse_driver/defines.py +++ b/clickhouse_driver/defines.py @@ -32,6 +32,7 @@ DBMS_MIN_PROTOCOL_VERSION_WITH_PARAMETERS = 54459 DBMS_MIN_PROTOCOL_VERSION_WITH_SERVER_QUERY_TIME_IN_PROGRESS = 54460 DBMS_MIN_PROTOCOL_VERSION_WITH_PASSWORD_COMPLEXITY_RULES = 54461 +DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET_V2 = 54462 # Timeouts DBMS_DEFAULT_CONNECT_TIMEOUT_SEC = 10 @@ -47,7 +48,7 @@ CLIENT_VERSION_MAJOR = 20 CLIENT_VERSION_MINOR = 10 CLIENT_VERSION_PATCH = 2 -CLIENT_REVISION = DBMS_MIN_PROTOCOL_VERSION_WITH_PASSWORD_COMPLEXITY_RULES +CLIENT_REVISION = DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET_V2 BUFFER_SIZE = 1048576