~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
*******************************************************/
8
8
 
9
9
#include "data0type.h"
 
10
#include "page0page.h"
10
11
 
11
12
/***************************************************************************
12
13
Builds a roll pointer dulint. */
96
97
        byte*   ptr,            /* in: pointer to memory where written */
97
98
        dulint  roll_ptr)       /* in: roll ptr */
98
99
{
99
 
        ut_ad(DATA_ROLL_PTR_LEN == 7);
100
 
 
 
100
#if DATA_ROLL_PTR_LEN != 7
 
101
# error "DATA_ROLL_PTR_LEN != 7"
 
102
#endif
101
103
        mach_write_to_7(ptr, roll_ptr);
102
104
}
103
105
 
109
111
dulint
110
112
trx_read_roll_ptr(
111
113
/*==============*/
112
 
                        /* out: roll ptr */
113
 
        byte*   ptr)    /* in: pointer to memory from where to read */
 
114
                                /* out: roll ptr */
 
115
        const byte*     ptr)    /* in: pointer to memory from where to read */
114
116
{
115
117
#if DATA_ROLL_PTR_LEN != 7
116
118
# error "DATA_ROLL_PTR_LEN != 7"
126
128
/*==============*/
127
129
                                /* out: pointer to page x-latched */
128
130
        ulint   space,          /* in: space where placed */
 
131
        ulint   zip_size,       /* in: compressed page size in bytes
 
132
                                or 0 for uncompressed pages */
129
133
        ulint   page_no,        /* in: page number */
130
134
        mtr_t*  mtr)            /* in: mtr */
131
135
{
132
 
        page_t* page;
133
 
 
134
 
        page = buf_page_get(space, page_no, RW_X_LATCH, mtr);
135
 
 
 
136
        buf_block_t*    block = buf_page_get(space, zip_size, page_no,
 
137
                                             RW_X_LATCH, mtr);
136
138
#ifdef UNIV_SYNC_DEBUG
137
 
        buf_page_dbg_add_level(page, SYNC_TRX_UNDO_PAGE);
 
139
        buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
138
140
#endif /* UNIV_SYNC_DEBUG */
139
141
 
140
 
        return(page);
 
142
        return(buf_block_get_frame(block));
141
143
}
142
144
 
143
145
/**********************************************************************
148
150
/*========================*/
149
151
                                /* out: pointer to page s-latched */
150
152
        ulint   space,          /* in: space where placed */
 
153
        ulint   zip_size,       /* in: compressed page size in bytes
 
154
                                or 0 for uncompressed pages */
151
155
        ulint   page_no,        /* in: page number */
152
156
        mtr_t*  mtr)            /* in: mtr */
153
157
{
154
 
        page_t* page;
155
 
 
156
 
        page = buf_page_get(space, page_no, RW_S_LATCH, mtr);
157
 
 
 
158
        buf_block_t*    block = buf_page_get(space, zip_size, page_no,
 
159
                                             RW_S_LATCH, mtr);
158
160
#ifdef UNIV_SYNC_DEBUG
159
 
        buf_page_dbg_add_level(page, SYNC_TRX_UNDO_PAGE);
 
161
        buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
160
162
#endif /* UNIV_SYNC_DEBUG */
161
163
 
162
 
        return(page);
 
164
        return(buf_block_get_frame(block));
163
165
}
164
166
 
165
167
/**********************************************************************
176
178
{
177
179
        ulint   start;
178
180
 
179
 
        if (page_no == buf_frame_get_page_no(undo_page)) {
 
181
        if (page_no == page_get_page_no(undo_page)) {
180
182
 
181
183
                start = mach_read_from_2(offset + undo_page
182
184
                                         + TRX_UNDO_LOG_START);
202
204
        trx_ulogf_t*    log_hdr;
203
205
        ulint           end;
204
206
 
205
 
        if (page_no == buf_frame_get_page_no(undo_page)) {
 
207
        if (page_no == page_get_page_no(undo_page)) {
206
208
 
207
209
                log_hdr = undo_page + offset;
208
210
 
235
237
        page_t* undo_page;
236
238
        ulint   start;
237
239
 
238
 
        undo_page = buf_frame_align(rec);
 
240
        undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
239
241
 
240
242
        start = trx_undo_page_get_start(undo_page, page_no, offset);
241
243
 
263
265
        ulint   end;
264
266
        ulint   next;
265
267
 
266
 
        undo_page = buf_frame_align(rec);
 
268
        undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
267
269
 
268
270
        end = trx_undo_page_get_end(undo_page, page_no, offset);
269
271