From 1464f4808c08155fd10ba09eae2bb2c3f177482c Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 21 Dec 2017 18:04:59 +0400 Subject: MDEV-14477 InnoDB update_time is wrongly updated after partial rollback or internal COMMIT This is partial revert of original patch. Read-only transactions that modified temporary tables are added to trx_sys_t::rw_trx_ids and trx_sys_t::rw_trx_set. However with patch for MDEV-14477 they were not removed. Restore old behaviour in this regard. --- storage/innobase/trx/trx0trx.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 986eb760cef..fde7443394e 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1728,12 +1728,7 @@ trx_commit_in_memory( trx->state = TRX_STATE_NOT_STARTED; } else { - const bool rw = trx->rsegs.m_redo.rseg != NULL; - - ut_ad(!trx->read_only || !rw); - ut_ad(trx->id || !rw); - - if (rw) { + if (trx->id > 0) { /* For consistent snapshot, we need to remove current transaction from running transaction id list for mvcc before doing commit and releasing locks. */ @@ -1748,7 +1743,7 @@ trx_commit_in_memory( ut_ad(trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY)); DEBUG_SYNC_C("after_trx_committed_in_memory"); - if (!rw) { + if (trx->read_only || trx->rsegs.m_redo.rseg == NULL) { MONITOR_INC(MONITOR_TRX_RO_COMMIT); if (trx->read_view != NULL) { trx_sys->mvcc->view_close( -- cgit v1.2.1