~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
                                                /* copy compact record list end
131
131
                                                to a new created index page */
132
132
#define MLOG_COMP_PAGE_REORGANIZE ((byte)46)    /* reorganize an index page */
133
 
#define MLOG_FILE_CREATE2       ((byte)47)      /* log record about creating
134
 
                                                an .ibd file, with format */
135
 
#define MLOG_ZIP_WRITE_NODE_PTR ((byte)48)      /* write the node pointer of
136
 
                                                a record on a compressed
137
 
                                                non-leaf B-tree page */
138
 
#define MLOG_ZIP_WRITE_BLOB_PTR ((byte)49)      /* write the BLOB pointer
139
 
                                                of an externally stored column
140
 
                                                on a compressed page */
141
 
#define MLOG_ZIP_WRITE_HEADER   ((byte)50)      /* write to compressed page
142
 
                                                header */
143
 
#define MLOG_ZIP_PAGE_COMPRESS  ((byte)51)      /* compress an index page */
144
 
#define MLOG_BIGGEST_TYPE       ((byte)51)      /* biggest value (used in
 
133
 
 
134
#define MLOG_BIGGEST_TYPE       ((byte)46)      /* biggest value (used in
145
135
                                                asserts) */
146
136
 
147
137
/*******************************************************************
155
145
                        the mtr handle */
156
146
        mtr_t*  mtr);   /* in: memory buffer for the mtr buffer */
157
147
/*******************************************************************
 
148
Starts a mini-transaction and creates a mini-transaction handle
 
149
and buffer in the memory buffer given by the caller. */
 
150
 
 
151
mtr_t*
 
152
mtr_start_noninline(
 
153
/*================*/
 
154
                        /* out: mtr buffer which also acts as
 
155
                        the mtr handle */
 
156
        mtr_t*  mtr);   /* in: memory buffer for the mtr buffer */
 
157
/*******************************************************************
158
158
Commits a mini-transaction. */
159
 
UNIV_INTERN
 
159
 
160
160
void
161
161
mtr_commit(
162
162
/*=======*/
173
173
Releases the latches stored in an mtr memo down to a savepoint.
174
174
NOTE! The mtr must not have made changes to buffer pages after the
175
175
savepoint, as these can be handled only by mtr_commit. */
176
 
UNIV_INTERN
 
176
 
177
177
void
178
178
mtr_rollback_to_savepoint(
179
179
/*======================*/
208
208
        ulint   mode);  /* in: logging mode: MTR_LOG_NONE, ... */
209
209
/************************************************************
210
210
Reads 1 - 4 bytes from a file page buffered in the buffer pool. */
211
 
UNIV_INTERN
 
211
 
212
212
ulint
213
213
mtr_read_ulint(
214
214
/*===========*/
215
 
                                /* out: value read */
216
 
        const byte*     ptr,    /* in: pointer from where to read */
217
 
        ulint           type,   /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
218
 
        mtr_t*          mtr);   /* in: mini-transaction handle */
 
215
                        /* out: value read */
 
216
        byte*   ptr,    /* in: pointer from where to read */
 
217
        ulint   type,   /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
 
218
        mtr_t*  mtr);   /* in: mini-transaction handle */
219
219
/************************************************************
220
220
Reads 8 bytes from a file page buffered in the buffer pool. */
221
 
UNIV_INTERN
 
221
 
222
222
dulint
223
223
mtr_read_dulint(
224
224
/*============*/
225
 
                                /* out: value read */
226
 
        const byte*     ptr,    /* in: pointer from where to read */
227
 
        mtr_t*          mtr);   /* in: mini-transaction handle */
 
225
                        /* out: value read */
 
226
        byte*   ptr,    /* in: pointer from where to read */
 
227
        mtr_t*  mtr);   /* in: mini-transaction handle */
228
228
/*************************************************************************
229
229
This macro locks an rw-lock in s-mode. */
230
230
#define mtr_s_lock(B, MTR)      mtr_s_lock_func((B), __FILE__, __LINE__,\
258
258
 
259
259
/*******************************************************
260
260
Releases an object in the memo stack. */
261
 
UNIV_INTERN
 
261
 
262
262
void
263
263
mtr_memo_release(
264
264
/*=============*/
272
272
ibool
273
273
mtr_memo_contains(
274
274
/*==============*/
275
 
                                /* out: TRUE if contains */
276
 
        mtr_t*          mtr,    /* in: mtr */
277
 
        const void*     object, /* in: object to search */
278
 
        ulint           type);  /* in: type of object */
279
 
 
280
 
/**************************************************************
281
 
Checks if memo contains the given page. */
282
 
UNIV_INTERN
283
 
ibool
284
 
mtr_memo_contains_page(
285
 
/*===================*/
286
 
                                /* out: TRUE if contains */
287
 
        mtr_t*          mtr,    /* in: mtr */
288
 
        const byte*     ptr,    /* in: pointer to buffer frame */
289
 
        ulint           type);  /* in: type of object */
 
275
                        /* out: TRUE if contains */
 
276
        mtr_t*  mtr,    /* in: mtr */
 
277
        void*   object, /* in: object to search */
 
278
        ulint   type);  /* in: type of object */
290
279
/*************************************************************
291
280
Prints info of an mtr handle. */
292
 
UNIV_INTERN
 
281
 
293
282
void
294
283
mtr_print(
295
284
/*======*/
327
316
 
328
317
/* Mini-transaction handle and buffer */
329
318
struct mtr_struct{
330
 
#ifdef UNIV_DEBUG
331
319
        ulint           state;  /* MTR_ACTIVE, MTR_COMMITTING, MTR_COMMITTED */
332
 
#endif
333
320
        dyn_array_t     memo;   /* memo stack for locks etc. */
334
321
        dyn_array_t     log;    /* mini-transaction log */
335
322
        ibool           modifications;
340
327
                                have been written to the mtr log */
341
328
        ulint           log_mode; /* specifies which operations should be
342
329
                                logged; default value MTR_LOG_ALL */
343
 
        ib_uint64_t     start_lsn;/* start lsn of the possible log entry for
 
330
        dulint          start_lsn;/* start lsn of the possible log entry for
344
331
                                this mtr */
345
 
        ib_uint64_t     end_lsn;/* end lsn of the possible log entry for
 
332
        dulint          end_lsn;/* end lsn of the possible log entry for
346
333
                                this mtr */
347
334
        ulint           magic_n;
348
335
};