Fix OK packet generation
The packet was generated with the wrong number of elements due to usage of sizeof on an integer where the correct type was an uint8_t. This only fixes the malformed packets but does not fix the root cause of the problem. The affected rows and last insert ID are length encoded integers which should be handled. The current code treats them as one byte fields.
This commit is contained in:
@ -394,7 +394,7 @@ bool gw_read_backend_handshake(DCB *dcb, GWBUF *buffer);
|
||||
mxs_auth_state_t gw_send_backend_auth(DCB *dcb);
|
||||
|
||||
/** Write an OK packet to a DCB */
|
||||
int mxs_mysql_send_ok(DCB *dcb, int sequence, int affected_rows, const char* message);
|
||||
int mxs_mysql_send_ok(DCB *dcb, int sequence, uint8_t affected_rows, const char* message);
|
||||
|
||||
/** Check for OK packet */
|
||||
bool mxs_mysql_is_ok_packet(GWBUF *buffer);
|
||||
|
Reference in New Issue
Block a user