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.
This commit is contained in:
@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user