Add constants to ClientInfo::Interface for MySQL and PostgreSQL protocols.

This commit is contained in:
Vitaly Baranov 2020-11-26 11:28:25 +03:00
parent 4b3488934c
commit 99343bc127
3 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,8 @@ public:
TCP = 1,
HTTP = 2,
GRPC = 3,
MYSQL = 4,
POSTGRESQL = 5,
};
enum class HTTPMethod : uint8_t

View File

@ -87,6 +87,7 @@ MySQLHandler::MySQLHandler(IServer & server_, const Poco::Net::StreamSocket & so
void MySQLHandler::run()
{
connection_context.makeSessionContext();
connection_context.getClientInfo().interface = ClientInfo::Interface::MYSQL;
connection_context.setDefaultFormat("MySQLWire");
in = std::make_shared<ReadBufferFromPocoSocket>(socket());

View File

@ -50,6 +50,7 @@ void PostgreSQLHandler::changeIO(Poco::Net::StreamSocket & socket)
void PostgreSQLHandler::run()
{
connection_context.makeSessionContext();
connection_context.getClientInfo().interface = ClientInfo::Interface::POSTGRESQL;
connection_context.setDefaultFormat("PostgreSQLWire");
try