diff options
Diffstat (limited to 'storage/xtradb/include/trx0sys.ic')
-rw-r--r-- | storage/xtradb/include/trx0sys.ic | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/storage/xtradb/include/trx0sys.ic b/storage/xtradb/include/trx0sys.ic index c7b09d4aec2..aa2d2ea26b0 100644 --- a/storage/xtradb/include/trx0sys.ic +++ b/storage/xtradb/include/trx0sys.ic @@ -81,7 +81,7 @@ trx_sys_sys_space( { if (srv_doublewrite_file) { /* several spaces are reserved */ - return((ibool)(space <= TRX_SYS_SPACE_MAX)); + return((ibool)(space == TRX_SYS_SPACE || space == TRX_DOUBLEWRITE_SPACE)); } else { return((ibool)(space == TRX_SYS_SPACE)); } @@ -300,7 +300,7 @@ trx_get_on_id( trx = UT_LIST_GET_FIRST(trx_sys->trx_list); while (trx != NULL) { - if (0 == ut_dulint_cmp(trx_id, trx->id)) { + if (trx_id == trx->id) { return(trx); } @@ -349,12 +349,12 @@ trx_is_active( ut_ad(mutex_own(&(kernel_mutex))); - if (ut_dulint_cmp(trx_id, trx_list_get_min_trx_id()) < 0) { + if (trx_id < trx_list_get_min_trx_id()) { return(FALSE); } - if (ut_dulint_cmp(trx_id, trx_sys->max_trx_id) >= 0) { + if (UNIV_UNLIKELY(trx_id >= trx_sys->max_trx_id)) { /* There must be corruption: we return TRUE because this function is only called by lock_clust_rec_some_has_impl() @@ -393,29 +393,14 @@ trx_sys_get_new_trx_id(void) Thus trx id values will not overlap when the database is repeatedly started! */ - if (ut_dulint_get_low(trx_sys->max_trx_id) - % TRX_SYS_TRX_ID_WRITE_MARGIN == 0) { + if ((ulint) trx_sys->max_trx_id % TRX_SYS_TRX_ID_WRITE_MARGIN == 0) { trx_sys_flush_max_trx_id(); } - id = trx_sys->max_trx_id; - - UT_DULINT_INC(trx_sys->max_trx_id); + id = trx_sys->max_trx_id++; return(id); } -/*****************************************************************//** -Allocates a new transaction number. -@return new, allocated trx number */ -UNIV_INLINE -trx_id_t -trx_sys_get_new_trx_no(void) -/*========================*/ -{ - ut_ad(mutex_own(&kernel_mutex)); - - return(trx_sys_get_new_trx_id()); -} #endif /* !UNIV_HOTBACKUP */ |