~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-10-21 23:10:12 UTC
  • mto: (1879.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1880.
  • Revision ID: mordred@inaugust.com-20101021231012-uhsebiqo23xi0ygy
Updated AUTHORS list with everyone from bzr logs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
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;
43
42
#if DATA_ROLL_PTR_LEN != 7
44
43
# error "DATA_ROLL_PTR_LEN != 7"
45
44
#endif
46
 
        ut_ad(is_insert == 0 || is_insert == 1);
47
 
        ut_ad(rseg_id < TRX_SYS_N_RSEGS);
48
 
        ut_ad(offset < 65536);
 
45
        ut_ad(rseg_id < 128);
49
46
 
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);
 
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));
55
52
}
56
53
 
57
54
/***********************************************************************//**
67
64
        ulint*          offset)         /*!< out: offset of the undo
68
65
                                        entry within page */
69
66
{
 
67
        ulint   low;
 
68
        ulint   high;
70
69
#if DATA_ROLL_PTR_LEN != 7
71
70
# error "DATA_ROLL_PTR_LEN != 7"
72
71
#endif
73
72
#if TRUE != 1
74
73
# error "TRUE != 1"
75
74
#endif
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 */
 
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;
84
85
}
85
86
 
86
87
/***********************************************************************//**
92
93
/*========================*/
93
94
        roll_ptr_t      roll_ptr)       /*!< in: roll pointer */
94
95
{
 
96
        ulint   high;
95
97
#if DATA_ROLL_PTR_LEN != 7
96
98
# error "DATA_ROLL_PTR_LEN != 7"
97
99
#endif
98
100
#if TRUE != 1
99
101
# error "TRUE != 1"
100
102
#endif
101
 
        ut_ad(roll_ptr < (1ULL << 56));
102
 
        return((ibool) (roll_ptr >> 55));
 
103
        high = ut_dulint_get_high(roll_ptr);
 
104
 
 
105
        return(high / (256 * 256 * 128));
103
106
}
104
107
#endif /* !UNIV_HOTBACKUP */
105
108