From 29b7cd0529d5c1ad912b15cb863e6af48d0ae4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 17 Jan 2024 12:24:23 +0000 Subject: [PATCH] Modify generate_one_byte_pkt() Modified generate_one_byte_pkt() to prefix the data with 1 byte. This is the "equivalent" of what MySQL performs in wrap_plguin_data_into_proper_command() , prefixing the data with a command --- lib/MySQL_Protocol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index eea4ae08de..322c5833db 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -473,11 +473,13 @@ void MySQL_Protocol::generate_one_byte_pkt(unsigned char b) { sequence_id++; mysql_hdr myhdr; myhdr.pkt_id=sequence_id; - myhdr.pkt_length=1; + myhdr.pkt_length=2; unsigned int size=myhdr.pkt_length+sizeof(mysql_hdr); unsigned char *_ptr=(unsigned char *)l_alloc(size); memcpy(_ptr, &myhdr, sizeof(mysql_hdr)); int l=sizeof(mysql_hdr); + _ptr[l]=1; + l++; _ptr[l]=b; (*myds)->PSarrayOUT->add((void *)_ptr,size); (*myds)->pkt_sid=sequence_id;