~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/trx0undo.ic

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        ulint   page_no,        /*!< in: page number */
40
40
        ulint   offset)         /*!< in: offset of the undo entry within page */
41
41
{
 
42
        roll_ptr_t      roll_ptr;
42
43
#if DATA_ROLL_PTR_LEN != 7
43
44
# error "DATA_ROLL_PTR_LEN != 7"
44
45
#endif
 
46
        ut_ad(is_insert == 0 || is_insert == 1);
45
47
        ut_ad(rseg_id < TRX_SYS_N_RSEGS);
 
48
        ut_ad(offset < 65536);
46
49
 
47
 
        return(ut_dulint_create(is_insert * 128 * 256 * 256
48
 
                                + rseg_id * 256 * 256
49
 
                                + (page_no / 256) / 256,
50
 
                                (page_no % (256 * 256)) * 256 * 256
51
 
                                + offset));
 
50
        roll_ptr = (roll_ptr_t) is_insert << 55
 
51
                | (roll_ptr_t) rseg_id << 48
 
52
                | (roll_ptr_t) page_no << 16
 
53
                | offset;
 
54
        return(roll_ptr);
52
55
}
53
56
 
54
57
/***********************************************************************//**
64
67
        ulint*          offset)         /*!< out: offset of the undo
65
68
                                        entry within page */
66
69
{
67
 
        ulint   low;
68
 
        ulint   high;
69
70
#if DATA_ROLL_PTR_LEN != 7
70
71
# error "DATA_ROLL_PTR_LEN != 7"
71
72
#endif
72
73
#if TRUE != 1
73
74
# error "TRUE != 1"
74
75
#endif
75
 
        high = ut_dulint_get_high(roll_ptr);
76
 
        low = ut_dulint_get_low(roll_ptr);
77
 
 
78
 
        *offset = low % (256 * 256);
79
 
 
80
 
        *is_insert = high / (256 * 256 * 128);  /* TRUE == 1 */
81
 
        *rseg_id = (high / (256 * 256)) % 128;
82
 
 
83
 
        *page_no = (high % (256 * 256)) * 256 * 256
84
 
                + (low / 256) / 256;
 
76
        ut_ad(roll_ptr < (1ULL << 56));
 
77
        *offset = (ulint) roll_ptr & 0xFFFF;
 
78
        roll_ptr >>= 16;
 
79
        *page_no = (ulint) roll_ptr & 0xFFFFFFFF;
 
80
        roll_ptr >>= 32;
 
81
        *rseg_id = (ulint) roll_ptr & 0x7F;
 
82
        roll_ptr >>= 7;
 
83
        *is_insert = (ibool) roll_ptr; /* TRUE==1 */
85
84
}
86
85
 
87
86
/***********************************************************************//**
93
92
/*========================*/
94
93
        roll_ptr_t      roll_ptr)       /*!< in: roll pointer */
95
94
{
96
 
        ulint   high;
97
95
#if DATA_ROLL_PTR_LEN != 7
98
96
# error "DATA_ROLL_PTR_LEN != 7"
99
97
#endif
100
98
#if TRUE != 1
101
99
# error "TRUE != 1"
102
100
#endif
103
 
        high = ut_dulint_get_high(roll_ptr);
104
 
 
105
 
        return(high / (256 * 256 * 128));
 
101
        ut_ad(roll_ptr < (1ULL << 56));
 
102
        return((ibool) (roll_ptr >> 55));
106
103
}
107
104
#endif /* !UNIV_HOTBACKUP */
108
105