diff options
Diffstat (limited to 'storage/xtradb/include/trx0undo.ic')
-rw-r--r-- | storage/xtradb/include/trx0undo.ic | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/storage/xtradb/include/trx0undo.ic b/storage/xtradb/include/trx0undo.ic index 2d289b34ef1..b81330f7f8b 100644 --- a/storage/xtradb/include/trx0undo.ic +++ b/storage/xtradb/include/trx0undo.ic @@ -39,16 +39,19 @@ trx_undo_build_roll_ptr( ulint page_no, /*!< in: page number */ ulint offset) /*!< in: offset of the undo entry within page */ { + roll_ptr_t roll_ptr; #if DATA_ROLL_PTR_LEN != 7 # error "DATA_ROLL_PTR_LEN != 7" #endif - ut_ad(rseg_id < 128); - - return(ut_dulint_create(is_insert * 128 * 256 * 256 - + rseg_id * 256 * 256 - + (page_no / 256) / 256, - (page_no % (256 * 256)) * 256 * 256 - + offset)); + ut_ad(is_insert == 0 || is_insert == 1); + ut_ad(rseg_id < TRX_SYS_N_RSEGS); + ut_ad(offset < 65536); + + roll_ptr = (roll_ptr_t) is_insert << 55 + | (roll_ptr_t) rseg_id << 48 + | (roll_ptr_t) page_no << 16 + | offset; + return(roll_ptr); } /***********************************************************************//** @@ -64,24 +67,20 @@ trx_undo_decode_roll_ptr( ulint* offset) /*!< out: offset of the undo entry within page */ { - ulint low; - ulint high; #if DATA_ROLL_PTR_LEN != 7 # error "DATA_ROLL_PTR_LEN != 7" #endif #if TRUE != 1 # error "TRUE != 1" #endif - high = ut_dulint_get_high(roll_ptr); - low = ut_dulint_get_low(roll_ptr); - - *offset = low % (256 * 256); - - *is_insert = high / (256 * 256 * 128); /* TRUE == 1 */ - *rseg_id = (high / (256 * 256)) % 128; - - *page_no = (high % (256 * 256)) * 256 * 256 - + (low / 256) / 256; + ut_ad(roll_ptr < (1ULL << 56)); + *offset = (ulint) roll_ptr & 0xFFFF; + roll_ptr >>= 16; + *page_no = (ulint) roll_ptr & 0xFFFFFFFF; + roll_ptr >>= 32; + *rseg_id = (ulint) roll_ptr & 0x7F; + roll_ptr >>= 7; + *is_insert = (ibool) roll_ptr; /* TRUE==1 */ } /***********************************************************************//** @@ -93,16 +92,14 @@ trx_undo_roll_ptr_is_insert( /*========================*/ roll_ptr_t roll_ptr) /*!< in: roll pointer */ { - ulint high; #if DATA_ROLL_PTR_LEN != 7 # error "DATA_ROLL_PTR_LEN != 7" #endif #if TRUE != 1 # error "TRUE != 1" #endif - high = ut_dulint_get_high(roll_ptr); - - return(high / (256 * 256 * 128)); + ut_ad(roll_ptr < (1ULL << 56)); + return((ibool) (roll_ptr >> 55)); } #endif /* !UNIV_HOTBACKUP */ |