diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index fed9254..1c3af7c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -16243,13 +16243,11 @@ int ha_innobase::external_lock(THD *thd, /*!< in: handle to the user thread */ ut_d(trx->is_dd_trx = false); } - } else if (trx->isolation_level <= TRX_ISO_READ_COMMITTED && - MVCC::is_view_active(trx->read_view)) { - mutex_enter(&trx_sys->mutex); + } else if (trx->isolation_level <= TRX_ISO_READ_COMMITTED ){ + trx_sys->mvcc->view_close(trx->read_view, true); - mutex_exit(&trx_sys->mutex); } } @@ -16845,16 +16843,12 @@ THR_LOCK_DATA **ha_innobase::store_lock( trx->isolation_level = innobase_map_isolation_level((enum_tx_isolation)thd_tx_isolation(thd)); - if (trx->isolation_level <= TRX_ISO_READ_COMMITTED && - MVCC::is_view_active(trx->read_view)) { + if (trx->isolation_level <= TRX_ISO_READ_COMMITTED) { /* At low transaction isolation levels we let each consistent read set its own snapshot */ - mutex_enter(&trx_sys->mutex); - trx_sys->mvcc->view_close(trx->read_view, true); - mutex_exit(&trx_sys->mutex); } } diff --git a/storage/innobase/read/read0read.cc b/storage/innobase/read/read0read.cc index 68b2154..907b83b 100644 --- a/storage/innobase/read/read0read.cc +++ b/storage/innobase/read/read0read.cc @@ -725,11 +725,11 @@ void MVCC::view_close(ReadView *&view, bool own_mutex) { view->close(); + mutex_enter(&trx_sys->mutex); UT_LIST_REMOVE(m_views, view); UT_LIST_ADD_LAST(m_free, view); - ut_ad(validate()); - + mutex_exit(&trx_sys->mutex); view = NULL; } }