From 4a21fce889dd55e077c074ac49196606038a7b77 Mon Sep 17 00:00:00 2001 From: BohuTANG Date: Thu, 23 Apr 2020 18:58:11 +0800 Subject: [PATCH] fix packet response capability to client --- src/Core/MySQLClient.cpp | 5 ++--- src/Core/MySQLClient.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Core/MySQLClient.cpp b/src/Core/MySQLClient.cpp index ad7f7b66c63..4ea75206ddb 100644 --- a/src/Core/MySQLClient.cpp +++ b/src/Core/MySQLClient.cpp @@ -54,7 +54,6 @@ bool MySQLClient::handshake() "Only support " + mysql_native_password + " auth plugin name, but got " + handshake.auth_plugin_name, ErrorCodes::UNKNOWN_PACKET_FROM_SERVER); } - server_capability_flags = handshake.capability_flags; Native41 native41(password, handshake.auth_plugin_data); String auth_plugin_data = native41.getAuthPluginData(); @@ -63,7 +62,7 @@ bool MySQLClient::handshake() client_capability_flags, max_packet_size, charset_utf8, user, database, auth_plugin_data, mysql_native_password); packet_sender->sendPacket(handshake_response, true); - PacketResponse packet_response(server_capability_flags); + PacketResponse packet_response(client_capability_flags); packet_sender->receivePacket(packet_response); packet_sender->resetSequenceId(); if (packet_response.getType() == PACKET_ERR) @@ -100,7 +99,7 @@ bool MySQLClient::writeCommand(char command, String query) WriteCommand write_command(command, query); packet_sender->sendPacket(write_command, true); - PacketResponse packet_response(server_capability_flags); + PacketResponse packet_response(client_capability_flags); packet_sender->receivePacket(packet_response); switch (packet_response.getType()) { diff --git a/src/Core/MySQLClient.h b/src/Core/MySQLClient.h index 2140f1032a7..43edfbe963d 100644 --- a/src/Core/MySQLClient.h +++ b/src/Core/MySQLClient.h @@ -37,7 +37,6 @@ private: bool connected = false; String last_error; UInt32 client_capability_flags = 0; - UInt32 server_capability_flags = 0; uint8_t seq = 0; UInt8 charset_utf8 = 33;