From b93d35ab03965255ab4942b67bdd946cd9f28688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 11 Feb 2019 10:37:31 +0200 Subject: [PATCH] Revert "MXS-2300: Fix off-by-one bug in history size" This reverts commit 840b4b24bd048ed536621d4433abbb4e846dfcc5. --- server/modules/routing/readwritesplit/rwsplit_route_stmt.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index b12e33954..87ae8192e 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -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());