Skip scanning of OK packets if preparing statement

The OK packet that a COM_STMT_PREPARE returns is not a normal OK packet
and need to be skipped as the packet layout is different.
This commit is contained in:
Markus Mäkelä 2018-03-16 07:58:29 +02:00
parent 10a9d70851
commit e45759d35d
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -766,9 +766,13 @@ gw_read_and_write(DCB *dcb)
return 0;
}
if (rcap_type_required(capabilities, RCAP_TYPE_SESSION_STATE_TRACKING))
/** Get sesion track info from ok packet and save it to gwbuf properties.
*
* The OK packets sent in response to COM_STMT_PREPARE are of a different
* format so we need to detect and skip them. */
if (rcap_type_required(capabilities, RCAP_TYPE_SESSION_STATE_TRACKING) &&
!expecting_ps_response(proto))
{
/** Get session track info from ok packet and save it to gwbuf properties */
mxs_mysql_get_session_track_info(tmp, proto);
}