From f39ec2e75c64fb8a70afbda6b6ce7001f717fb9e Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Wed, 25 Oct 2023 12:27:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmysql5.7=E5=90=8E=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/lcodec/src/mysql.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extend/lcodec/src/mysql.h b/extend/lcodec/src/mysql.h index c0dcd5ea..e5626cd1 100644 --- a/extend/lcodec/src/mysql.h +++ b/extend/lcodec/src/mysql.h @@ -15,7 +15,8 @@ namespace lcodec { const uint8_t COM_STMT_CLOSE = 0x19; // constants - inline uint32_t CLIENT_FLAG = 260047; //0011 1111 0111 1100 1111 + //inline uint32_t CLIENT_FLAG = 260047; //0000 0011 1111 0111 1100 1111 + inline uint32_t CLIENT_FLAG = 17037263; //1 0000 0011 1111 0111 1100 1111 inline uint32_t MAX_PACKET_SIZE = 0xffffff; inline uint32_t CLIENT_PLUGIN_AUTH = 1 << 19; inline uint32_t CLIENT_DEPRECATE_EOF = 1 << 24; @@ -383,7 +384,7 @@ namespace lcodec { uint16_t status_flags = *(uint16_t*)m_packet.read(); //2 byte capability_flags_2 uint16_t capability_flag_2 = *(uint16_t*)m_packet.read(); - m_capability = capability_flag_2 << 16 | capability_flag_1; + m_capability = CLIENT_FLAG & (capability_flag_2 << 16 | capability_flag_1); //1 byte character_set uint8_t auth_plugin_data_len = *(uint8_t*)m_packet.read(); //10 byte reserved (all 0)