Skip to content

Commit

Permalink
Addition to prev. revision [#METR-23279].
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Oct 24, 2016
1 parent 61646cb commit a081f5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dbms/src/Server/TCPHandler.cpp
Expand Up @@ -422,9 +422,6 @@ void TCPHandler::receiveHello()
{
/// Получить hello пакет.
UInt64 packet_type = 0;
String client_name;
UInt64 client_version_major = 0;
UInt64 client_version_minor = 0;
String user = "default";
String password;

Expand Down Expand Up @@ -532,8 +529,15 @@ void TCPHandler::receiveQuery()
if (client_revision >= DBMS_MIN_REVISION_WITH_CLIENT_INFO)
client_info.read(*in);

/// For better support of old clients, that does not send ClientInfo.
if (client_info.query_kind == ClientInfo::QueryKind::NO_QUERY)
{
client_info.query_kind = ClientInfo::QueryKind::INITIAL_QUERY;
client_info.client_name = client_name;
client_info.client_version_major = client_version_major;
client_info.client_version_minor = client_version_minor;
client_info.client_revision = client_revision;
}

/// Set fields, that are known apriori.
client_info.interface = ClientInfo::Interface::TCP;
Expand Down
5 changes: 4 additions & 1 deletion dbms/src/Server/TCPHandler.h
Expand Up @@ -87,7 +87,10 @@ class TCPHandler : public Poco::Net::TCPServerConnection
Server & server;
Logger * log;

UInt64 client_revision;
String client_name;
UInt64 client_version_major = 0;
UInt64 client_version_minor = 0;
UInt64 client_revision = 0;

Context connection_context;
Context query_context;
Expand Down

0 comments on commit a081f5f

Please sign in to comment.