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:
@ -1086,11 +1086,11 @@ bool gw_get_shared_session_auth_info(DCB* dcb, MYSQL_session* session)
|
||||
* @param dcb DCB where packet is written
|
||||
* @param sequence Packet sequence number
|
||||
* @param affected_rows Number of affected rows
|
||||
* * @param message SQL message
|
||||
* @param message SQL message
|
||||
* @return 1 on success, 0 on error
|
||||
*
|
||||
*/
|
||||
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)
|
||||
{
|
||||
uint8_t *outbuf = NULL;
|
||||
uint32_t mysql_payload_size = 0;
|
||||
|
Reference in New Issue
Block a user