~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (C) 1995, 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
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
15
St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file include/mtr0mtr.h
20
21
Mini-transaction buffer
21
22
 
22
23
Created 11/26/1995 Heikki Tuuri
53
54
#define MTR_MEMO_S_LOCK         55
54
55
#define MTR_MEMO_X_LOCK         56
55
56
 
56
 
/* Log item types: we have made them to be of the type 'byte'
57
 
for the compiler to warn if val and type parameters are switched
58
 
in a call to mlog_write_ulint. NOTE! For 1 - 8 bytes, the
59
 
flag value must give the length also! */
60
 
#define MLOG_SINGLE_REC_FLAG    128             /* if the mtr contains only
 
57
/** @name Log item types
 
58
The log items are declared 'byte' so that the compiler can warn if val
 
59
and type parameters are switched in a call to mlog_write_ulint. NOTE!
 
60
For 1 - 8 bytes, the flag value must give the length also! @{ */
 
61
#define MLOG_SINGLE_REC_FLAG    128             /*!< if the mtr contains only
61
62
                                                one log record for one page,
62
63
                                                i.e., write_initial_log_record
63
64
                                                has been called only once,
64
65
                                                this flag is ORed to the type
65
66
                                                of that first log record */
66
 
#define MLOG_1BYTE              (1)             /* one byte is written */
67
 
#define MLOG_2BYTES             (2)             /* 2 bytes ... */
68
 
#define MLOG_4BYTES             (4)             /* 4 bytes ... */
69
 
#define MLOG_8BYTES             (8)             /* 8 bytes ... */
70
 
#define MLOG_REC_INSERT         ((byte)9)       /* record insert */
71
 
#define MLOG_REC_CLUST_DELETE_MARK ((byte)10)   /* mark clustered index record
72
 
                                                deleted */
73
 
#define MLOG_REC_SEC_DELETE_MARK ((byte)11)     /* mark secondary index record
74
 
                                                deleted */
75
 
#define MLOG_REC_UPDATE_IN_PLACE ((byte)13)     /* update of a record,
 
67
#define MLOG_1BYTE              (1)             /*!< one byte is written */
 
68
#define MLOG_2BYTES             (2)             /*!< 2 bytes ... */
 
69
#define MLOG_4BYTES             (4)             /*!< 4 bytes ... */
 
70
#define MLOG_8BYTES             (8)             /*!< 8 bytes ... */
 
71
#define MLOG_REC_INSERT         ((byte)9)       /*!< record insert */
 
72
#define MLOG_REC_CLUST_DELETE_MARK ((byte)10)   /*!< mark clustered index record
 
73
                                                deleted */
 
74
#define MLOG_REC_SEC_DELETE_MARK ((byte)11)     /*!< mark secondary index record
 
75
                                                deleted */
 
76
#define MLOG_REC_UPDATE_IN_PLACE ((byte)13)     /*!< update of a record,
76
77
                                                preserves record field sizes */
77
 
#define MLOG_REC_DELETE         ((byte)14)      /* delete a record from a
 
78
#define MLOG_REC_DELETE         ((byte)14)      /*!< delete a record from a
78
79
                                                page */
79
 
#define MLOG_LIST_END_DELETE    ((byte)15)      /* delete record list end on
80
 
                                                index page */
81
 
#define MLOG_LIST_START_DELETE  ((byte)16)      /* delete record list start on
82
 
                                                index page */
83
 
#define MLOG_LIST_END_COPY_CREATED ((byte)17)   /* copy record list end to a
 
80
#define MLOG_LIST_END_DELETE    ((byte)15)      /*!< delete record list end on
 
81
                                                index page */
 
82
#define MLOG_LIST_START_DELETE  ((byte)16)      /*!< delete record list start on
 
83
                                                index page */
 
84
#define MLOG_LIST_END_COPY_CREATED ((byte)17)   /*!< copy record list end to a
84
85
                                                new created index page */
85
 
#define MLOG_PAGE_REORGANIZE    ((byte)18)      /* reorganize an index page */
86
 
#define MLOG_PAGE_CREATE        ((byte)19)      /* create an index page */
87
 
#define MLOG_UNDO_INSERT        ((byte)20)      /* insert entry in an undo
 
86
#define MLOG_PAGE_REORGANIZE    ((byte)18)      /*!< reorganize an
 
87
                                                index page in
 
88
                                                ROW_FORMAT=REDUNDANT */
 
89
#define MLOG_PAGE_CREATE        ((byte)19)      /*!< create an index page */
 
90
#define MLOG_UNDO_INSERT        ((byte)20)      /*!< insert entry in an undo
88
91
                                                log */
89
 
#define MLOG_UNDO_ERASE_END     ((byte)21)      /* erase an undo log
 
92
#define MLOG_UNDO_ERASE_END     ((byte)21)      /*!< erase an undo log
90
93
                                                page end */
91
 
#define MLOG_UNDO_INIT          ((byte)22)      /* initialize a page in an
 
94
#define MLOG_UNDO_INIT          ((byte)22)      /*!< initialize a page in an
92
95
                                                undo log */
93
 
#define MLOG_UNDO_HDR_DISCARD   ((byte)23)      /* discard an update undo log
94
 
                                                header */
95
 
#define MLOG_UNDO_HDR_REUSE     ((byte)24)      /* reuse an insert undo log
96
 
                                                header */
97
 
#define MLOG_UNDO_HDR_CREATE    ((byte)25)      /* create an undo log header */
98
 
#define MLOG_REC_MIN_MARK       ((byte)26)      /* mark an index record as the
99
 
                                                predefined minimum record */
100
 
#define MLOG_IBUF_BITMAP_INIT   ((byte)27)      /* initialize an ibuf bitmap
101
 
                                                page */
 
96
#define MLOG_UNDO_HDR_DISCARD   ((byte)23)      /*!< discard an update undo log
 
97
                                                header */
 
98
#define MLOG_UNDO_HDR_REUSE     ((byte)24)      /*!< reuse an insert undo log
 
99
                                                header */
 
100
#define MLOG_UNDO_HDR_CREATE    ((byte)25)      /*!< create an undo
 
101
                                                log header */
 
102
#define MLOG_REC_MIN_MARK       ((byte)26)      /*!< mark an index
 
103
                                                record as the
 
104
                                                predefined minimum
 
105
                                                record */
 
106
#define MLOG_IBUF_BITMAP_INIT   ((byte)27)      /*!< initialize an
 
107
                                                ibuf bitmap page */
102
108
/*#define       MLOG_FULL_PAGE  ((byte)28)      full contents of a page */
103
 
#define MLOG_INIT_FILE_PAGE     ((byte)29)      /* this means that a file page
104
 
                                                is taken into use and the prior
105
 
                                                contents of the page should be
106
 
                                                ignored: in recovery we must
107
 
                                                not trust the lsn values stored
108
 
                                                to the file page */
109
 
#define MLOG_WRITE_STRING       ((byte)30)      /* write a string to a page */
110
 
#define MLOG_MULTI_REC_END      ((byte)31)      /* if a single mtr writes
111
 
                                                log records for several pages,
 
109
#ifdef UNIV_LOG_LSN_DEBUG
 
110
# define MLOG_LSN               ((byte)28)      /* current LSN */
 
111
#endif
 
112
#define MLOG_INIT_FILE_PAGE     ((byte)29)      /*!< this means that a
 
113
                                                file page is taken
 
114
                                                into use and the prior
 
115
                                                contents of the page
 
116
                                                should be ignored: in
 
117
                                                recovery we must not
 
118
                                                trust the lsn values
 
119
                                                stored to the file
 
120
                                                page */
 
121
#define MLOG_WRITE_STRING       ((byte)30)      /*!< write a string to
 
122
                                                a page */
 
123
#define MLOG_MULTI_REC_END      ((byte)31)      /*!< if a single mtr writes
 
124
                                                several log records,
112
125
                                                this log record ends the
113
126
                                                sequence of these records */
114
 
#define MLOG_DUMMY_RECORD       ((byte)32)      /* dummy log record used to
 
127
#define MLOG_DUMMY_RECORD       ((byte)32)      /*!< dummy log record used to
115
128
                                                pad a log block full */
116
 
#define MLOG_FILE_CREATE        ((byte)33)      /* log record about an .ibd
 
129
#define MLOG_FILE_CREATE        ((byte)33)      /*!< log record about an .ibd
117
130
                                                file creation */
118
 
#define MLOG_FILE_RENAME        ((byte)34)      /* log record about an .ibd
 
131
#define MLOG_FILE_RENAME        ((byte)34)      /*!< log record about an .ibd
119
132
                                                file rename */
120
 
#define MLOG_FILE_DELETE        ((byte)35)      /* log record about an .ibd
 
133
#define MLOG_FILE_DELETE        ((byte)35)      /*!< log record about an .ibd
121
134
                                                file deletion */
122
 
#define MLOG_COMP_REC_MIN_MARK  ((byte)36)      /* mark a compact index record
123
 
                                                as the predefined minimum
 
135
#define MLOG_COMP_REC_MIN_MARK  ((byte)36)      /*!< mark a compact
 
136
                                                index record as the
 
137
                                                predefined minimum
124
138
                                                record */
125
 
#define MLOG_COMP_PAGE_CREATE   ((byte)37)      /* create a compact
 
139
#define MLOG_COMP_PAGE_CREATE   ((byte)37)      /*!< create a compact
126
140
                                                index page */
127
 
#define MLOG_COMP_REC_INSERT    ((byte)38)      /* compact record insert */
 
141
#define MLOG_COMP_REC_INSERT    ((byte)38)      /*!< compact record insert */
128
142
#define MLOG_COMP_REC_CLUST_DELETE_MARK ((byte)39)
129
 
                                                /* mark compact clustered index
130
 
                                                record deleted */
131
 
#define MLOG_COMP_REC_SEC_DELETE_MARK ((byte)40)/* mark compact secondary index
132
 
                                                record deleted; this log
133
 
                                                record type is redundant, as
134
 
                                                MLOG_REC_SEC_DELETE_MARK is
135
 
                                                independent of the record
136
 
                                                format. */
137
 
#define MLOG_COMP_REC_UPDATE_IN_PLACE ((byte)41)/* update of a compact record,
138
 
                                                preserves record field sizes */
139
 
#define MLOG_COMP_REC_DELETE    ((byte)42)      /* delete a compact record
 
143
                                                /*!< mark compact
 
144
                                                clustered index record
 
145
                                                deleted */
 
146
#define MLOG_COMP_REC_SEC_DELETE_MARK ((byte)40)/*!< mark compact
 
147
                                                secondary index record
 
148
                                                deleted; this log
 
149
                                                record type is
 
150
                                                redundant, as
 
151
                                                MLOG_REC_SEC_DELETE_MARK
 
152
                                                is independent of the
 
153
                                                record format. */
 
154
#define MLOG_COMP_REC_UPDATE_IN_PLACE ((byte)41)/*!< update of a
 
155
                                                compact record,
 
156
                                                preserves record field
 
157
                                                sizes */
 
158
#define MLOG_COMP_REC_DELETE    ((byte)42)      /*!< delete a compact record
140
159
                                                from a page */
141
 
#define MLOG_COMP_LIST_END_DELETE ((byte)43)    /* delete compact record list
 
160
#define MLOG_COMP_LIST_END_DELETE ((byte)43)    /*!< delete compact record list
142
161
                                                end on index page */
143
 
#define MLOG_COMP_LIST_START_DELETE ((byte)44)  /* delete compact record list
 
162
#define MLOG_COMP_LIST_START_DELETE ((byte)44)  /*!< delete compact record list
144
163
                                                start on index page */
145
164
#define MLOG_COMP_LIST_END_COPY_CREATED ((byte)45)
146
 
                                                /* copy compact record list end
147
 
                                                to a new created index page */
148
 
#define MLOG_COMP_PAGE_REORGANIZE ((byte)46)    /* reorganize an index page */
149
 
#define MLOG_FILE_CREATE2       ((byte)47)      /* log record about creating
 
165
                                                /*!< copy compact
 
166
                                                record list end to a
 
167
                                                new created index
 
168
                                                page */
 
169
#define MLOG_COMP_PAGE_REORGANIZE ((byte)46)    /*!< reorganize an index page */
 
170
#define MLOG_FILE_CREATE2       ((byte)47)      /*!< log record about creating
150
171
                                                an .ibd file, with format */
151
 
#define MLOG_ZIP_WRITE_NODE_PTR ((byte)48)      /* write the node pointer of
 
172
#define MLOG_ZIP_WRITE_NODE_PTR ((byte)48)      /*!< write the node pointer of
152
173
                                                a record on a compressed
153
174
                                                non-leaf B-tree page */
154
 
#define MLOG_ZIP_WRITE_BLOB_PTR ((byte)49)      /* write the BLOB pointer
 
175
#define MLOG_ZIP_WRITE_BLOB_PTR ((byte)49)      /*!< write the BLOB pointer
155
176
                                                of an externally stored column
156
177
                                                on a compressed page */
157
 
#define MLOG_ZIP_WRITE_HEADER   ((byte)50)      /* write to compressed page
 
178
#define MLOG_ZIP_WRITE_HEADER   ((byte)50)      /*!< write to compressed page
158
179
                                                header */
159
 
#define MLOG_ZIP_PAGE_COMPRESS  ((byte)51)      /* compress an index page */
160
 
#define MLOG_BIGGEST_TYPE       ((byte)51)      /* biggest value (used in
161
 
                                                asserts) */
162
 
 
163
 
/*******************************************************************
 
180
#define MLOG_ZIP_PAGE_COMPRESS  ((byte)51)      /*!< compress an index page */
 
181
#define MLOG_BIGGEST_TYPE       ((byte)51)      /*!< biggest value (used in
 
182
                                                assertions) */
 
183
/* @} */
 
184
 
 
185
/** @name Flags for MLOG_FILE operations
 
186
(stored in the page number parameter, called log_flags in the
 
187
functions).  The page number parameter was originally written as 0. @{ */
 
188
#define MLOG_FILE_FLAG_TEMP     1       /*!< identifies TEMPORARY TABLE in
 
189
                                        MLOG_FILE_CREATE, MLOG_FILE_CREATE2 */
 
190
/* @} */
 
191
 
 
192
/***************************************************************//**
164
193
Starts a mini-transaction and creates a mini-transaction handle
165
 
and buffer in the memory buffer given by the caller. */
 
194
and buffer in the memory buffer given by the caller.
 
195
@return mtr buffer which also acts as the mtr handle */
166
196
UNIV_INLINE
167
197
mtr_t*
168
198
mtr_start(
169
199
/*======*/
170
 
                        /* out: mtr buffer which also acts as
171
 
                        the mtr handle */
172
 
        mtr_t*  mtr);   /* in: memory buffer for the mtr buffer */
173
 
/*******************************************************************
 
200
        mtr_t*  mtr);   /*!< in: memory buffer for the mtr buffer */
 
201
/***************************************************************//**
174
202
Commits a mini-transaction. */
175
203
UNIV_INTERN
176
204
void
177
205
mtr_commit(
178
206
/*=======*/
179
 
        mtr_t*  mtr);   /* in: mini-transaction */
180
 
/**************************************************************
181
 
Sets and returns a savepoint in mtr. */
 
207
        mtr_t*  mtr);   /*!< in: mini-transaction */
 
208
/**********************************************************//**
 
209
Sets and returns a savepoint in mtr.
 
210
@return savepoint */
182
211
UNIV_INLINE
183
212
ulint
184
213
mtr_set_savepoint(
185
214
/*==============*/
186
 
                        /* out: savepoint */
187
 
        mtr_t*  mtr);   /* in: mtr */
188
 
/**************************************************************
 
215
        mtr_t*  mtr);   /*!< in: mtr */
 
216
/**********************************************************//**
189
217
Releases the latches stored in an mtr memo down to a savepoint.
190
218
NOTE! The mtr must not have made changes to buffer pages after the
191
219
savepoint, as these can be handled only by mtr_commit. */
193
221
void
194
222
mtr_rollback_to_savepoint(
195
223
/*======================*/
196
 
        mtr_t*  mtr,            /* in: mtr */
197
 
        ulint   savepoint);     /* in: savepoint */
198
 
/**************************************************************
 
224
        mtr_t*  mtr,            /*!< in: mtr */
 
225
        ulint   savepoint);     /*!< in: savepoint */
 
226
#ifndef UNIV_HOTBACKUP
 
227
/**********************************************************//**
199
228
Releases the (index tree) s-latch stored in an mtr memo after a
200
229
savepoint. */
201
230
UNIV_INLINE
202
231
void
203
232
mtr_release_s_latch_at_savepoint(
204
233
/*=============================*/
205
 
        mtr_t*          mtr,            /* in: mtr */
206
 
        ulint           savepoint,      /* in: savepoint */
207
 
        rw_lock_t*      lock);          /* in: latch to release */
208
 
/*******************************************************************
209
 
Gets the logging mode of a mini-transaction. */
 
234
        mtr_t*          mtr,            /*!< in: mtr */
 
235
        ulint           savepoint,      /*!< in: savepoint */
 
236
        rw_lock_t*      lock);          /*!< in: latch to release */
 
237
#else /* !UNIV_HOTBACKUP */
 
238
# define mtr_release_s_latch_at_savepoint(mtr,savepoint,lock) ((void) 0)
 
239
#endif /* !UNIV_HOTBACKUP */
 
240
/***************************************************************//**
 
241
Gets the logging mode of a mini-transaction.
 
242
@return logging mode: MTR_LOG_NONE, ... */
210
243
UNIV_INLINE
211
244
ulint
212
245
mtr_get_log_mode(
213
246
/*=============*/
214
 
                        /* out: logging mode: MTR_LOG_NONE, ... */
215
 
        mtr_t*  mtr);   /* in: mtr */
216
 
/*******************************************************************
217
 
Changes the logging mode of a mini-transaction. */
 
247
        mtr_t*  mtr);   /*!< in: mtr */
 
248
/***************************************************************//**
 
249
Changes the logging mode of a mini-transaction.
 
250
@return old mode */
218
251
UNIV_INLINE
219
252
ulint
220
253
mtr_set_log_mode(
221
254
/*=============*/
222
 
                        /* out: old mode */
223
 
        mtr_t*  mtr,    /* in: mtr */
224
 
        ulint   mode);  /* in: logging mode: MTR_LOG_NONE, ... */
225
 
/************************************************************
226
 
Reads 1 - 4 bytes from a file page buffered in the buffer pool. */
 
255
        mtr_t*  mtr,    /*!< in: mtr */
 
256
        ulint   mode);  /*!< in: logging mode: MTR_LOG_NONE, ... */
 
257
/********************************************************//**
 
258
Reads 1 - 4 bytes from a file page buffered in the buffer pool.
 
259
@return value read */
227
260
UNIV_INTERN
228
261
ulint
229
262
mtr_read_ulint(
230
263
/*===========*/
231
 
                                /* out: value read */
232
 
        const byte*     ptr,    /* in: pointer from where to read */
233
 
        ulint           type,   /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
234
 
        mtr_t*          mtr);   /* in: mini-transaction handle */
235
 
/************************************************************
236
 
Reads 8 bytes from a file page buffered in the buffer pool. */
237
 
UNIV_INTERN
238
 
dulint
239
 
mtr_read_dulint(
240
 
/*============*/
241
 
                                /* out: value read */
242
 
        const byte*     ptr,    /* in: pointer from where to read */
243
 
        mtr_t*          mtr);   /* in: mini-transaction handle */
244
 
/*************************************************************************
 
264
        const byte*     ptr,    /*!< in: pointer from where to read */
 
265
        ulint           type,   /*!< in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
 
266
        mtr_t*          mtr);   /*!< in: mini-transaction handle */
 
267
#ifndef UNIV_HOTBACKUP
 
268
/*********************************************************************//**
245
269
This macro locks an rw-lock in s-mode. */
246
270
#define mtr_s_lock(B, MTR)      mtr_s_lock_func((B), __FILE__, __LINE__,\
247
271
                                                (MTR))
248
 
/*************************************************************************
 
272
/*********************************************************************//**
249
273
This macro locks an rw-lock in x-mode. */
250
274
#define mtr_x_lock(B, MTR)      mtr_x_lock_func((B), __FILE__, __LINE__,\
251
275
                                                (MTR))
252
 
/*************************************************************************
 
276
/*********************************************************************//**
253
277
NOTE! Use the macro above!
254
278
Locks a lock in s-mode. */
255
279
UNIV_INLINE
256
280
void
257
281
mtr_s_lock_func(
258
282
/*============*/
259
 
        rw_lock_t*      lock,   /* in: rw-lock */
260
 
        const char*     file,   /* in: file name */
261
 
        ulint           line,   /* in: line number */
262
 
        mtr_t*          mtr);   /* in: mtr */
263
 
/*************************************************************************
 
283
        rw_lock_t*      lock,   /*!< in: rw-lock */
 
284
        const char*     file,   /*!< in: file name */
 
285
        ulint           line,   /*!< in: line number */
 
286
        mtr_t*          mtr);   /*!< in: mtr */
 
287
/*********************************************************************//**
264
288
NOTE! Use the macro above!
265
289
Locks a lock in x-mode. */
266
290
UNIV_INLINE
267
291
void
268
292
mtr_x_lock_func(
269
293
/*============*/
270
 
        rw_lock_t*      lock,   /* in: rw-lock */
271
 
        const char*     file,   /* in: file name */
272
 
        ulint           line,   /* in: line number */
273
 
        mtr_t*          mtr);   /* in: mtr */
 
294
        rw_lock_t*      lock,   /*!< in: rw-lock */
 
295
        const char*     file,   /*!< in: file name */
 
296
        ulint           line,   /*!< in: line number */
 
297
        mtr_t*          mtr);   /*!< in: mtr */
 
298
#endif /* !UNIV_HOTBACKUP */
274
299
 
275
 
/*******************************************************
 
300
/***************************************************//**
276
301
Releases an object in the memo stack. */
277
302
UNIV_INTERN
278
303
void
279
304
mtr_memo_release(
280
305
/*=============*/
281
 
        mtr_t*  mtr,    /* in: mtr */
282
 
        void*   object, /* in: object */
283
 
        ulint   type);  /* in: object type: MTR_MEMO_S_LOCK, ... */
 
306
        mtr_t*  mtr,    /*!< in: mtr */
 
307
        void*   object, /*!< in: object */
 
308
        ulint   type);  /*!< in: object type: MTR_MEMO_S_LOCK, ... */
284
309
#ifdef UNIV_DEBUG
285
 
/**************************************************************
286
 
Checks if memo contains the given item. */
 
310
# ifndef UNIV_HOTBACKUP
 
311
/**********************************************************//**
 
312
Checks if memo contains the given item.
 
313
@return TRUE if contains */
287
314
UNIV_INLINE
288
315
ibool
289
316
mtr_memo_contains(
290
317
/*==============*/
291
 
                                /* out: TRUE if contains */
292
 
        mtr_t*          mtr,    /* in: mtr */
293
 
        const void*     object, /* in: object to search */
294
 
        ulint           type);  /* in: type of object */
 
318
        mtr_t*          mtr,    /*!< in: mtr */
 
319
        const void*     object, /*!< in: object to search */
 
320
        ulint           type);  /*!< in: type of object */
295
321
 
296
 
/**************************************************************
297
 
Checks if memo contains the given page. */
 
322
/**********************************************************//**
 
323
Checks if memo contains the given page.
 
324
@return TRUE if contains */
298
325
UNIV_INTERN
299
326
ibool
300
327
mtr_memo_contains_page(
301
328
/*===================*/
302
 
                                /* out: TRUE if contains */
303
 
        mtr_t*          mtr,    /* in: mtr */
304
 
        const byte*     ptr,    /* in: pointer to buffer frame */
305
 
        ulint           type);  /* in: type of object */
306
 
/*************************************************************
 
329
        mtr_t*          mtr,    /*!< in: mtr */
 
330
        const byte*     ptr,    /*!< in: pointer to buffer frame */
 
331
        ulint           type);  /*!< in: type of object */
 
332
/*********************************************************//**
307
333
Prints info of an mtr handle. */
308
334
UNIV_INTERN
309
335
void
310
336
mtr_print(
311
337
/*======*/
312
 
        mtr_t*  mtr);   /* in: mtr */
 
338
        mtr_t*  mtr);   /*!< in: mtr */
 
339
# else /* !UNIV_HOTBACKUP */
 
340
#  define mtr_memo_contains(mtr, object, type)          TRUE
 
341
#  define mtr_memo_contains_page(mtr, ptr, type)        TRUE
 
342
# endif /* !UNIV_HOTBACKUP */
313
343
#endif /* UNIV_DEBUG */
314
344
/*######################################################################*/
315
345
 
316
346
#define MTR_BUF_MEMO_SIZE       200     /* number of slots in memo */
317
347
 
318
 
/*******************************************************************
319
 
Returns the log object of a mini-transaction buffer. */
 
348
/***************************************************************//**
 
349
Returns the log object of a mini-transaction buffer.
 
350
@return log */
320
351
UNIV_INLINE
321
352
dyn_array_t*
322
353
mtr_get_log(
323
354
/*========*/
324
 
                        /* out: log */
325
 
        mtr_t*  mtr);   /* in: mini-transaction */
326
 
/*******************************************************
 
355
        mtr_t*  mtr);   /*!< in: mini-transaction */
 
356
/***************************************************//**
327
357
Pushes an object to an mtr memo stack. */
328
358
UNIV_INLINE
329
359
void
330
360
mtr_memo_push(
331
361
/*==========*/
332
 
        mtr_t*  mtr,    /* in: mtr */
333
 
        void*   object, /* in: object */
334
 
        ulint   type);  /* in: object type: MTR_MEMO_S_LOCK, ... */
 
362
        mtr_t*  mtr,    /*!< in: mtr */
 
363
        void*   object, /*!< in: object */
 
364
        ulint   type);  /*!< in: object type: MTR_MEMO_S_LOCK, ... */
335
365
 
336
366
 
337
367
/* Type definition of a mini-transaction memo stack slot. */
338
368
typedef struct mtr_memo_slot_struct     mtr_memo_slot_t;
339
369
struct mtr_memo_slot_struct{
340
 
        ulint   type;   /* type of the stored object (MTR_MEMO_S_LOCK, ...) */
341
 
        void*   object; /* pointer to the object */
 
370
        ulint   type;   /*!< type of the stored object (MTR_MEMO_S_LOCK, ...) */
 
371
        void*   object; /*!< pointer to the object */
342
372
};
343
373
 
344
374
/* Mini-transaction handle and buffer */
345
375
struct mtr_struct{
346
376
#ifdef UNIV_DEBUG
347
 
        ulint           state;  /* MTR_ACTIVE, MTR_COMMITTING, MTR_COMMITTED */
 
377
        ulint           state;  /*!< MTR_ACTIVE, MTR_COMMITTING, MTR_COMMITTED */
348
378
#endif
349
 
        dyn_array_t     memo;   /* memo stack for locks etc. */
350
 
        dyn_array_t     log;    /* mini-transaction log */
 
379
        dyn_array_t     memo;   /*!< memo stack for locks etc. */
 
380
        dyn_array_t     log;    /*!< mini-transaction log */
351
381
        ibool           modifications;
352
382
                                /* TRUE if the mtr made modifications to
353
383
                                buffer pool pages */