Revert "MXS-2300: Fix off-by-one bug in history size"

This reverts commit 840b4b24bd048ed536621d4433abbb4e846dfcc5.
This commit is contained in:
Markus Mäkelä 2019-02-11 10:37:31 +02:00
parent a65bf3e766
commit b93d35ab03
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -517,7 +517,7 @@ bool RWSplitSession::route_session_write(GWBUF* querybuf, uint8_t command, uint3
}
}
if (m_config.max_sescmd_history > 0 && m_sescmd_list.size() > m_config.max_sescmd_history)
if (m_config.max_sescmd_history > 0 && m_sescmd_list.size() >= m_config.max_sescmd_history)
{
static bool warn_history_exceeded = true;
if (warn_history_exceeded)
@ -540,7 +540,7 @@ bool RWSplitSession::route_session_write(GWBUF* querybuf, uint8_t command, uint3
}
if (m_config.prune_sescmd_history && !m_sescmd_list.empty()
&& m_sescmd_list.size() + 1 > m_config.max_sescmd_history)
&& m_sescmd_list.size() + 1 >= m_config.max_sescmd_history)
{
// Close to the history limit, remove the oldest command
prune_to_position(m_sescmd_list.front()->get_position());