MXS-1846: Send correct packet number in errors

The mysql_create_standard_error function accepted a packet number as a
parameter but did not use it as the actual packet number. As the value it
used happened to coincide with 50% of the use-cases, it went unnoticed.

The remaining 50% occurred when a KILL command was executed with an
unknown connection ID.
This commit is contained in:
Markus Mäkelä
2018-05-02 13:30:23 +03:00
parent e10b62e246
commit 66d7281d97

View File

@ -314,7 +314,7 @@ mysql_create_standard_error(int packet_number,
gw_mysql_set_byte3(mysql_packet_header, mysql_payload_size);
// write packet number, now is 0
mysql_packet_header[3] = 0;
mysql_packet_header[3] = packet_number;
memcpy(outbuf, mysql_packet_header, sizeof(mysql_packet_header));
// current buffer pointer