MXS-1719: Fix hang on multi-statement UPDATE

When a multi-statement query consisting completely of UPDATE statements is
received, the packets can be received in two separate buffers. To cope
with this situation, the state change into REPLY_STATE_RSET_COLDEF must
only be done if the buffer contains more than a single packet.
This commit is contained in:
Markus Mäkelä 2018-03-20 14:44:48 +02:00
parent 42412149bd
commit 092286297e
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -538,11 +538,10 @@ bool reply_is_complete(SRWBackend& backend, GWBUF *buffer)
ss_dassert(mxs_mysql_is_ok_packet(buffer) &&
mxs_mysql_more_results_after_ok(buffer));
LOG_RS(backend, REPLY_STATE_RSET_COLDEF);
backend->set_reply_state(REPLY_STATE_RSET_COLDEF);
if (have_next_packet(buffer))
{
LOG_RS(backend, REPLY_STATE_RSET_COLDEF);
backend->set_reply_state(REPLY_STATE_RSET_COLDEF);
return reply_is_complete(backend, buffer);
}
}