Handle trailing unexpected ERR packets

RWBackend did not expect that a resultset and an unexpected ERR packet
could be stored in the same buffer. This can happen for example if a
server shuts down immediately after the resultset is sent.
This commit is contained in:
Markus Mäkelä
2019-06-13 15:34:07 +03:00
parent a5898f83f9
commit 2accfad329

View File

@ -315,9 +315,16 @@ void RWBackend::process_packets(GWBUF* result)
break;
case REPLY_STATE_DONE:
// This should never happen
MXS_ERROR("Unexpected result state. cmd: 0x%02hhx, len: %u", cmd, len);
mxb_assert(!true);
if (cmd == MYSQL_REPLY_ERR)
{
// Unexpected error at the end of a resultset, possibly a killed connection
}
else
{
// This should never happen
MXS_ERROR("Unexpected result state. cmd: 0x%02hhx, len: %u", cmd, len);
mxb_assert(!true);
}
break;
case REPLY_STATE_RSET_COLDEF: