MXS-2450: Don't discard history if it's disabled

If the session command history is not enabled, it shouldn't be discarded
when a COM_CHANGE_USER is executed.
This commit is contained in:
Markus Mäkelä
2019-04-23 20:33:28 +03:00
parent 7a5f11b752
commit 07ea6bd9ba
4 changed files with 74 additions and 1 deletions

View File

@ -162,9 +162,10 @@ void RWSplitSession::process_sescmd_response(SRWBackend& backend, GWBUF** ppPack
*ppPacket = NULL;
}
if (m_expected_responses == 0
if (m_expected_responses == 0 && !m_config.disable_sescmd_history
&& (command == MXS_COM_CHANGE_USER || command == MXS_COM_RESET_CONNECTION))
{
mxb_assert_message(!m_sescmd_list.empty(), "Must have stored session commands");
mxb_assert_message(m_slave_responses.empty(), "All responses should've been processed");
// This is the last session command to finish that resets the session state, reset the history
MXS_INFO("Resetting session command history (length: %lu)", m_sescmd_list.size());