From 7bf7b1a47a3d725224837ff258eb31824df4edbd Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 28 Feb 2017 13:30:16 +0200 Subject: [PATCH] Simplify logic for when deciding whether to cache The autocommit state is now included in the result returned from session_trx_is_active(), so it need not be checked separately. This is preparatory work for MXS-1136 that will change the approach so that the cache is used and populated in a non readonly transaction *until* the first non-read statement is encountered. --- server/modules/filter/cache/cachefiltersession.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/modules/filter/cache/cachefiltersession.cc b/server/modules/filter/cache/cachefiltersession.cc index 374295cab..656f85918 100644 --- a/server/modules/filter/cache/cachefiltersession.cc +++ b/server/modules/filter/cache/cachefiltersession.cc @@ -138,8 +138,7 @@ int CacheFilterSession::routeQuery(GWBUF* pPacket) { MXS_SESSION *session = m_pSession; - if ((session_is_autocommit(session) && !session_trx_is_active(session)) || - session_trx_is_read_only(session)) + if (!session_trx_is_active(session) || session_trx_is_read_only(session)) { if (m_pCache->should_store(m_zDefaultDb, pPacket)) {