Assert that only complete COM_STMT_PREPARE responses are returned
Asserting that only a complete COM_STMT_PREPARE is returned when the prepared statement preparation is extracted will guarantee that the protocol works as expected.
This commit is contained in:
@ -1661,6 +1661,23 @@ bool mxs_mysql_extract_ps_response(GWBUF* buffer, MXS_PS_RESPONSE* out)
|
|||||||
out->parameters = gw_mysql_get_byte2(params);
|
out->parameters = gw_mysql_get_byte2(params);
|
||||||
out->warnings = gw_mysql_get_byte2(warnings);
|
out->warnings = gw_mysql_get_byte2(warnings);
|
||||||
rval = true;
|
rval = true;
|
||||||
|
|
||||||
|
#ifdef SS_DEBUG
|
||||||
|
// Make sure that the PS response contains the whole response
|
||||||
|
bool more;
|
||||||
|
modutil_state state;
|
||||||
|
int n_eof = modutil_count_signal_packets(buffer, 0, &more, &state);
|
||||||
|
int n_expected = 0;
|
||||||
|
if (out->columns)
|
||||||
|
{
|
||||||
|
n_expected++;
|
||||||
|
}
|
||||||
|
if (out->parameters)
|
||||||
|
{
|
||||||
|
n_expected++;
|
||||||
|
}
|
||||||
|
ss_dassert(n_eof == n_expected);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
|
|||||||
Reference in New Issue
Block a user