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:
Markus Makela
2016-11-22 21:31:57 +02:00
parent 83ffdcf4ed
commit 502eba8b4f
2 changed files with 3 additions and 3 deletions

View File

@ -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);