MXS-1786: Fix hang on COM_STATISTICS

The commands needs to be handled separately from the rest of the result
types.

Added a test case that reproduces the problem and verifies that the change
in code fixes it.
This commit is contained in:
Markus Mäkelä
2018-04-12 20:00:00 +03:00
parent 1a293c0093
commit 802b16f709
3 changed files with 34 additions and 0 deletions

View File

@ -534,6 +534,12 @@ bool reply_is_complete(SRWBackend& backend, GWBUF *buffer)
backend->set_reply_state(REPLY_STATE_DONE);
}
}
else if (backend->current_command() == MXS_COM_STATISTICS)
{
// COM_STATISTICS returns a single string and thus requires special handling
LOG_RS(backend, REPLY_STATE_DONE);
backend->set_reply_state(REPLY_STATE_DONE);
}
else if (backend->get_reply_state() == REPLY_STATE_START &&
(!mxs_mysql_is_result_set(buffer) || GWBUF_IS_COLLECTED_RESULT(buffer)))
{