Only extract successful PS responses
If a prepared statement fails to execute on a backend server, no prepared statement ID is returned. As the connection to the slave backend will be closed when the result of a session command differs from the master's response, there's no need to even attempt extracting the response. This change avoids the triggering of a false positive in mxs_mysql_extract_ps_response when an attempt to extract a COM_STMT_PREPARE response is made on a response that isn't a COM_STMT_PREPARE response.
This commit is contained in:
@ -40,7 +40,7 @@ void process_sescmd_response(RWSplitSession* rses, SRWBackend& backend,
|
|||||||
uint64_t id = backend->complete_session_command();
|
uint64_t id = backend->complete_session_command();
|
||||||
MXS_PS_RESPONSE resp = {};
|
MXS_PS_RESPONSE resp = {};
|
||||||
|
|
||||||
if (command == MXS_COM_STMT_PREPARE)
|
if (command == MXS_COM_STMT_PREPARE && cmd != MYSQL_REPLY_ERR)
|
||||||
{
|
{
|
||||||
// This should never fail or the backend protocol is broken
|
// This should never fail or the backend protocol is broken
|
||||||
ss_debug(bool b = )mxs_mysql_extract_ps_response(*ppPacket, &resp);
|
ss_debug(bool b = )mxs_mysql_extract_ps_response(*ppPacket, &resp);
|
||||||
|
|||||||
Reference in New Issue
Block a user