diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-12-14 17:47:35 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-14 20:28:16 +0100 |
commit | 16911823808f62807db1829d4c92c8e041991292 (patch) | |
tree | f5497af4931dc23ebd15343931c39dcc18d4aa23 | |
parent | d2b57806933dab0f986cd024170fe20a1ba2df99 (diff) | |
download | mariadb-git-10.2-vcols.tar.gz |
TEST: InnoDB: purge should wait for prepared transactions too10.2-vcols
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | storage/innobase/include/trx0sys.h | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0sys.cc | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 83dd0c17eaa..cf2971d4c50 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -342,7 +342,7 @@ thd_destructor_proxy(void *) srv_fast_shutdown = (ulint) innobase_fast_shutdown; if (srv_fast_shutdown == 0) { - while (trx_sys_any_active_transactions()) { + while (trx_sys_any_active_transactions(1)) { os_thread_sleep(1000); } diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index ddf535158b6..1f50d9ebd56 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -365,7 +365,7 @@ trx_sys_get_n_rw_trx(void); Check if there are any active (non-prepared) transactions. @return total number of active transactions or 0 if none */ ulint -trx_sys_any_active_transactions(void); +trx_sys_any_active_transactions(bool x=0); /*=================================*/ #else /* !UNIV_HOTBACKUP */ /*****************************************************************//** diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index a253ea72e95..37aeb67a3e7 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -1390,7 +1390,7 @@ trx_undo_fake_prepared( Check if there are any active (non-prepared) transactions. @return total number of active transactions or 0 if none */ ulint -trx_sys_any_active_transactions(void) +trx_sys_any_active_transactions(bool with_prepared) /*=================================*/ { trx_sys_mutex_enter(); @@ -1431,7 +1431,9 @@ trx_sys_any_active_transactions(void) } ut_a(total_trx >= trx_sys->n_prepared_trx); - total_trx -= trx_sys->n_prepared_trx; + if (!with_prepared) { + total_trx -= trx_sys->n_prepared_trx; + } } trx_sys_mutex_exit(); |