~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • 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:
64
64
dulint
65
65
trx_read_roll_ptr(
66
66
/*==============*/
67
 
                        /* out: roll ptr */
68
 
        byte*   ptr);   /* in: pointer to memory from where to read */
 
67
                                /* out: roll ptr */
 
68
        const byte*     ptr);   /* in: pointer to memory from where to read */
69
69
/**********************************************************************
70
70
Gets an undo log page and x-latches it. */
71
71
UNIV_INLINE
74
74
/*==============*/
75
75
                                /* out: pointer to page x-latched */
76
76
        ulint   space,          /* in: space where placed */
 
77
        ulint   zip_size,       /* in: compressed page size in bytes
 
78
                                or 0 for uncompressed pages */
77
79
        ulint   page_no,        /* in: page number */
78
80
        mtr_t*  mtr);           /* in: mtr */
79
81
/**********************************************************************
84
86
/*========================*/
85
87
                                /* out: pointer to page s-latched */
86
88
        ulint   space,          /* in: space where placed */
 
89
        ulint   zip_size,       /* in: compressed page size in bytes
 
90
                                or 0 for uncompressed pages */
87
91
        ulint   page_no,        /* in: page number */
88
92
        mtr_t*  mtr);           /* in: mtr */
89
93
/**********************************************************************
132
136
        ulint   offset);/* in: undo log header offset on page */
133
137
/***************************************************************************
134
138
Gets the previous record in an undo log. */
135
 
 
 
139
UNIV_INTERN
136
140
trx_undo_rec_t*
137
141
trx_undo_get_prev_rec(
138
142
/*==================*/
144
148
        mtr_t*          mtr);   /* in: mtr */
145
149
/***************************************************************************
146
150
Gets the next record in an undo log. */
147
 
 
 
151
UNIV_INTERN
148
152
trx_undo_rec_t*
149
153
trx_undo_get_next_rec(
150
154
/*==================*/
156
160
        mtr_t*          mtr);   /* in: mtr */
157
161
/***************************************************************************
158
162
Gets the first record in an undo log. */
159
 
 
 
163
UNIV_INTERN
160
164
trx_undo_rec_t*
161
165
trx_undo_get_first_rec(
162
166
/*===================*/
163
167
                        /* out: undo log record, the page latched, NULL if
164
168
                        none */
165
169
        ulint   space,  /* in: undo log header space */
 
170
        ulint   zip_size,/* in: compressed page size in bytes
 
171
                        or 0 for uncompressed pages */
166
172
        ulint   page_no,/* in: undo log header page number */
167
173
        ulint   offset, /* in: undo log header offset on page */
168
174
        ulint   mode,   /* in: latching mode: RW_S_LATCH or RW_X_LATCH */
169
175
        mtr_t*  mtr);   /* in: mtr */
170
176
/************************************************************************
171
177
Tries to add a page to the undo log segment where the undo log is placed. */
172
 
 
 
178
UNIV_INTERN
173
179
ulint
174
180
trx_undo_add_page(
175
181
/*==============*/
183
189
/***************************************************************************
184
190
Truncates an undo log from the end. This function is used during a rollback
185
191
to free space from an undo log. */
186
 
 
 
192
UNIV_INTERN
187
193
void
188
194
trx_undo_truncate_end(
189
195
/*==================*/
194
200
/***************************************************************************
195
201
Truncates an undo log from the start. This function is used during a purge
196
202
operation. */
197
 
 
 
203
UNIV_INTERN
198
204
void
199
205
trx_undo_truncate_start(
200
206
/*====================*/
211
217
Initializes the undo log lists for a rollback segment memory copy.
212
218
This function is only called when the database is started or a new
213
219
rollback segment created. */
214
 
 
 
220
UNIV_INTERN
215
221
ulint
216
222
trx_undo_lists_init(
217
223
/*================*/
221
227
/**************************************************************************
222
228
Assigns an undo log for a transaction. A new undo log is created or a cached
223
229
undo log reused. */
224
 
 
 
230
UNIV_INTERN
225
231
ulint
226
232
trx_undo_assign_undo(
227
233
/*=================*/
234
240
        ulint           type);  /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
235
241
/**********************************************************************
236
242
Sets the state of the undo log segment at a transaction finish. */
237
 
 
 
243
UNIV_INTERN
238
244
page_t*
239
245
trx_undo_set_state_at_finish(
240
246
/*=========================*/
246
252
        mtr_t*          mtr);   /* in: mtr */
247
253
/**********************************************************************
248
254
Sets the state of the undo log segment at a transaction prepare. */
249
 
 
 
255
UNIV_INTERN
250
256
page_t*
251
257
trx_undo_set_state_at_prepare(
252
258
/*==========================*/
260
266
Adds the update undo log header as the first in the history list, and
261
267
frees the memory object, or puts it to the list of cached update undo log
262
268
segments. */
263
 
 
 
269
UNIV_INTERN
264
270
void
265
271
trx_undo_update_cleanup(
266
272
/*====================*/
272
278
Frees or caches an insert undo log after a transaction commit or rollback.
273
279
Knowledge of inserts is not needed after a commit or rollback, therefore
274
280
the data can be discarded. */
275
 
 
 
281
UNIV_INTERN
276
282
void
277
283
trx_undo_insert_cleanup(
278
284
/*====================*/
279
285
        trx_t*  trx);   /* in: transaction handle */
280
286
/***************************************************************
281
287
Parses the redo log entry of an undo log page initialization. */
282
 
 
 
288
UNIV_INTERN
283
289
byte*
284
290
trx_undo_parse_page_init(
285
291
/*=====================*/
290
296
        mtr_t*  mtr);   /* in: mtr or NULL */
291
297
/***************************************************************
292
298
Parses the redo log entry of an undo log page header create or reuse. */
293
 
 
 
299
UNIV_INTERN
294
300
byte*
295
301
trx_undo_parse_page_header(
296
302
/*=======================*/
302
308
        mtr_t*  mtr);   /* in: mtr or NULL */
303
309
/***************************************************************
304
310
Parses the redo log entry of an undo log page header discard. */
305
 
 
 
311
UNIV_INTERN
306
312
byte*
307
313
trx_undo_parse_discard_latest(
308
314
/*==========================*/
359
365
        /*-----------------------------*/
360
366
        ulint           space;          /* space id where the undo log
361
367
                                        placed */
 
368
        ulint           zip_size;       /* in: compressed page size of space
 
369
                                        in bytes, or 0 for uncompressed */
362
370
        ulint           hdr_page_no;    /* page number of the header page in
363
371
                                        the undo log */
364
372
        ulint           hdr_offset;     /* header offset of the undo log on the
378
386
                                        i.e., the topmost element in the undo
379
387
                                        log if we think of it as a stack */
380
388
        dulint          top_undo_no;    /* undo number of the latest record */
381
 
        page_t*         guess_page;     /* guess for the buffer frame where
 
389
        buf_block_t*    guess_block;    /* guess for the buffer block where
382
390
                                        the top page might reside */
383
391
        /*-----------------------------*/
384
392
        UT_LIST_NODE_T(trx_undo_t) undo_list;