MySQL  8.0.19
Source Code Documentation
mtr0types.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License, version 2.0, as published by the
7 Free Software Foundation.
8 
9 This program is also distributed with certain software (including but not
10 limited to OpenSSL) that is licensed under separate terms, as designated in a
11 particular file or component or in included license documentation. The authors
12 of MySQL hereby grant you an additional permission to link the program and
13 your derivative works with the separately licensed software that they have
14 included with MySQL.
15 
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19 for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 *****************************************************************************/
26 
27 /** @file include/mtr0types.h
28  Mini-transaction buffer global types
29 
30  Created 11/26/1995 Heikki Tuuri
31  *******************************************************/
32 
33 #ifndef mtr0types_h
34 #define mtr0types_h
35 
36 #include "sync0rw.h"
37 
38 struct mtr_t;
39 
40 /** Logging modes for a mini-transaction */
41 enum mtr_log_t {
42  /** Default mode: log all operations modifying disk-based data */
44 
45  /** Log no operations and dirty pages are not added to the flush list */
47 
48  /** Don't generate REDO log but add dirty pages to flush list */
50 
51  /** Inserts are logged in a shorter form */
53 };
54 
55 /** @name Log item types
56 The log items are declared 'byte' so that the compiler can warn if val
57 and type parameters are switched in a call to mlog_write_ulint. NOTE!
58 For 1 - 8 bytes, the flag value must give the length also! @{ */
59 enum mlog_id_t {
60  /** if the mtr contains only one log record for one page,
61  i.e., write_initial_log_record has been called only once,
62  this flag is ORed to the type of that first log record */
64 
65  /** one byte is written */
67 
68  /** 2 bytes ... */
70 
71  /** 4 bytes ... */
73 
74  /** 8 bytes ... */
76 
77  /** Record insert */
79 
80  /** Mark clustered index record deleted */
82 
83  /** Mark secondary index record deleted */
85 
86  /** update of a record, preserves record field sizes */
88 
89  /*!< Delete a record from a page */
91 
92  /** Delete record list end on index page */
94 
95  /** Delete record list start on index page */
97 
98  /** Copy record list end to a new created index page */
100 
101  /** Reorganize an index page in ROW_FORMAT=REDUNDANT */
103 
104  /** Create an index page */
106 
107  /** Insert entry in an undo log */
109 
110  /** erase an undo log page end */
112 
113  /** initialize a page in an undo log */
115 
116  /** reuse an insert undo log header */
118 
119  /** create an undo log header */
121 
122  /** mark an index record as the predefined minimum record */
124 
125  /** initialize an ibuf bitmap page */
127 
128 #ifdef UNIV_LOG_LSN_DEBUG
129  /** Current LSN */
130  MLOG_LSN = 28,
131 #endif /* UNIV_LOG_LSN_DEBUG */
132 
133  /** this means that a file page is taken into use and the prior
134  contents of the page should be ignored: in recovery we must not
135  trust the lsn values stored to the file page.
136  Note: it's deprecated because it causes crash recovery problem
137  in bulk create index, and actually we don't need to reset page
138  lsn in recv_recover_page_func() now. */
140 
141  /** write a string to a page */
143 
144  /** If a single mtr writes several log records, this log
145  record ends the sequence of these records */
147 
148  /** dummy log record used to pad a log block full */
150 
151  /** log record about creating an .ibd file, with format */
153 
154  /** rename a tablespace file that starts with (space_id,page_no) */
156 
157  /** delete a tablespace file that starts with (space_id,page_no) */
159 
160  /** mark a compact index record as the predefined minimum record */
162 
163  /** create a compact index page */
165 
166  /** compact record insert */
168 
169  /** mark compact clustered index record deleted */
171 
172  /** mark compact secondary index record deleted; this log
173  record type is redundant, as MLOG_REC_SEC_DELETE_MARK is
174  independent of the record format. */
176 
177  /** update of a compact record, preserves record field sizes */
179 
180  /** delete a compact record from a page */
182 
183  /** delete compact record list end on index page */
185 
186  /*** delete compact record list start on index page */
188 
189  /** copy compact record list end to a new created index page */
191 
192  /** reorganize an index page */
194 
195  /** write the node pointer of a record on a compressed
196  non-leaf B-tree page */
198 
199  /** write the BLOB pointer of an externally stored column
200  on a compressed page */
202 
203  /** write to compressed page header */
205 
206  /** compress an index page */
208 
209  /** compress an index page without logging it's image */
211 
212  /** reorganize a compressed page */
214 
215  /** Create a R-Tree index page */
217 
218  /** create a R-tree compact page */
220 
221  /** this means that a file page is taken into use.
222  We use it to replace MLOG_INIT_FILE_PAGE. */
224 
225  /** Table is being truncated. (Marked only for file-per-table) */
226  /* MLOG_TRUNCATE = 60, Disabled for WL6378 */
227 
228  /** notify that an index tree is being loaded without writing
229  redo log about individual pages */
231 
232  /** log for some persistent dynamic metadata change */
234 
235  /** create a SDI index page */
237 
238  /** create a SDI compact page */
240 
241  /** Used in tests of redo log. It must never be used outside unit tests. */
242  MLOG_TEST = 65,
243 
244  /** biggest value (used in assertions) */
246 };
247 
248 /* @} */
249 
250 /** Types for the mlock objects to store in the mtr memo; NOTE that the
251 first 3 values must be RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
254 
256 
258 
260 
261 #ifdef UNIV_DEBUG
263 #endif /* UNIV_DEBUG */
264 
266 
268 
270 };
271 
272 #ifdef UNIV_DEBUG
273 #define MTR_MAGIC_N 54551
274 #endif /* UNIV_DEBUG */
275 
281 };
282 
283 #endif /* mtr0types_h */
MTR_MEMO_S_LOCK
@ MTR_MEMO_S_LOCK
Definition: mtr0types.h:265
MLOG_ZIP_WRITE_HEADER
@ MLOG_ZIP_WRITE_HEADER
write to compressed page header
Definition: mtr0types.h:204
MLOG_PAGE_REORGANIZE
@ MLOG_PAGE_REORGANIZE
Reorganize an index page in ROW_FORMAT=REDUNDANT.
Definition: mtr0types.h:102
MLOG_COMP_REC_SEC_DELETE_MARK
@ MLOG_COMP_REC_SEC_DELETE_MARK
mark compact secondary index record deleted; this log record type is redundant, as MLOG_REC_SEC_DELET...
Definition: mtr0types.h:175
MTR_LOG_ALL
@ MTR_LOG_ALL
Default mode: log all operations modifying disk-based data.
Definition: mtr0types.h:43
MLOG_COMP_LIST_START_DELETE
@ MLOG_COMP_LIST_START_DELETE
Definition: mtr0types.h:187
MLOG_TEST
@ MLOG_TEST
Used in tests of redo log.
Definition: mtr0types.h:242
MLOG_PAGE_CREATE_RTREE
@ MLOG_PAGE_CREATE_RTREE
Create a R-Tree index page.
Definition: mtr0types.h:216
MLOG_8BYTES
@ MLOG_8BYTES
8 bytes ...
Definition: mtr0types.h:75
MLOG_INIT_FILE_PAGE
@ MLOG_INIT_FILE_PAGE
this means that a file page is taken into use and the prior contents of the page should be ignored: i...
Definition: mtr0types.h:139
MLOG_LIST_END_COPY_CREATED
@ MLOG_LIST_END_COPY_CREATED
Copy record list end to a new created index page.
Definition: mtr0types.h:99
MTR_STATE_COMMITTED
@ MTR_STATE_COMMITTED
Definition: mtr0types.h:280
mtr_t
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:169
MLOG_COMP_REC_CLUST_DELETE_MARK
@ MLOG_COMP_REC_CLUST_DELETE_MARK
mark compact clustered index record deleted
Definition: mtr0types.h:170
MLOG_UNDO_INIT
@ MLOG_UNDO_INIT
initialize a page in an undo log
Definition: mtr0types.h:114
MLOG_COMP_REC_INSERT
@ MLOG_COMP_REC_INSERT
compact record insert
Definition: mtr0types.h:167
MLOG_1BYTE
@ MLOG_1BYTE
one byte is written
Definition: mtr0types.h:66
MLOG_COMP_PAGE_CREATE
@ MLOG_COMP_PAGE_CREATE
create a compact index page
Definition: mtr0types.h:164
MLOG_4BYTES
@ MLOG_4BYTES
4 bytes ...
Definition: mtr0types.h:72
MLOG_FILE_CREATE
@ MLOG_FILE_CREATE
log record about creating an .ibd file, with format
Definition: mtr0types.h:152
MLOG_ZIP_WRITE_NODE_PTR
@ MLOG_ZIP_WRITE_NODE_PTR
write the node pointer of a record on a compressed non-leaf B-tree page
Definition: mtr0types.h:197
MLOG_COMP_LIST_END_DELETE
@ MLOG_COMP_LIST_END_DELETE
delete compact record list end on index page
Definition: mtr0types.h:184
MLOG_PAGE_CREATE
@ MLOG_PAGE_CREATE
Create an index page.
Definition: mtr0types.h:105
MLOG_REC_CLUST_DELETE_MARK
@ MLOG_REC_CLUST_DELETE_MARK
Mark clustered index record deleted.
Definition: mtr0types.h:81
MLOG_MULTI_REC_END
@ MLOG_MULTI_REC_END
If a single mtr writes several log records, this log record ends the sequence of these records.
Definition: mtr0types.h:146
MLOG_IBUF_BITMAP_INIT
@ MLOG_IBUF_BITMAP_INIT
initialize an ibuf bitmap page
Definition: mtr0types.h:126
MLOG_REC_MIN_MARK
@ MLOG_REC_MIN_MARK
mark an index record as the predefined minimum record
Definition: mtr0types.h:123
MLOG_UNDO_INSERT
@ MLOG_UNDO_INSERT
Insert entry in an undo log.
Definition: mtr0types.h:108
MTR_MEMO_BUF_FIX
@ MTR_MEMO_BUF_FIX
Definition: mtr0types.h:259
MLOG_INDEX_LOAD
@ MLOG_INDEX_LOAD
Table is being truncated.
Definition: mtr0types.h:230
RW_SX_LATCH
@ RW_SX_LATCH
Definition: sync0rw.h:137
MLOG_COMP_REC_MIN_MARK
@ MLOG_COMP_REC_MIN_MARK
mark a compact index record as the predefined minimum record
Definition: mtr0types.h:161
MLOG_2BYTES
@ MLOG_2BYTES
2 bytes ...
Definition: mtr0types.h:69
MLOG_SINGLE_REC_FLAG
@ MLOG_SINGLE_REC_FLAG
if the mtr contains only one log record for one page, i.e., write_initial_log_record has been called ...
Definition: mtr0types.h:63
MLOG_TABLE_DYNAMIC_META
@ MLOG_TABLE_DYNAMIC_META
log for some persistent dynamic metadata change
Definition: mtr0types.h:233
MLOG_UNDO_HDR_REUSE
@ MLOG_UNDO_HDR_REUSE
reuse an insert undo log header
Definition: mtr0types.h:117
MTR_MEMO_SX_LOCK
@ MTR_MEMO_SX_LOCK
Definition: mtr0types.h:269
RW_S_LATCH
@ RW_S_LATCH
Definition: sync0rw.h:135
MLOG_UNDO_HDR_CREATE
@ MLOG_UNDO_HDR_CREATE
create an undo log header
Definition: mtr0types.h:120
MLOG_COMP_REC_DELETE
@ MLOG_COMP_REC_DELETE
delete a compact record from a page
Definition: mtr0types.h:181
MLOG_WRITE_STRING
@ MLOG_WRITE_STRING
write a string to a page
Definition: mtr0types.h:142
MTR_LOG_NO_REDO
@ MTR_LOG_NO_REDO
Don't generate REDO log but add dirty pages to flush list.
Definition: mtr0types.h:49
MLOG_COMP_LIST_END_COPY_CREATED
@ MLOG_COMP_LIST_END_COPY_CREATED
copy compact record list end to a new created index page
Definition: mtr0types.h:190
RW_X_LATCH
@ RW_X_LATCH
Definition: sync0rw.h:136
MLOG_FILE_DELETE
@ MLOG_FILE_DELETE
delete a tablespace file that starts with (space_id,page_no)
Definition: mtr0types.h:158
MLOG_LIST_START_DELETE
@ MLOG_LIST_START_DELETE
Delete record list start on index page.
Definition: mtr0types.h:96
MTR_STATE_COMMITTING
@ MTR_STATE_COMMITTING
Definition: mtr0types.h:279
MLOG_BIGGEST_TYPE
@ MLOG_BIGGEST_TYPE
biggest value (used in assertions)
Definition: mtr0types.h:245
MLOG_REC_INSERT
@ MLOG_REC_INSERT
Record insert.
Definition: mtr0types.h:78
MTR_LOG_NONE
@ MTR_LOG_NONE
Log no operations and dirty pages are not added to the flush list.
Definition: mtr0types.h:46
RW_NO_LATCH
@ RW_NO_LATCH
Definition: sync0rw.h:138
MLOG_COMP_PAGE_CREATE_SDI
@ MLOG_COMP_PAGE_CREATE_SDI
create a SDI compact page
Definition: mtr0types.h:239
MLOG_REC_UPDATE_IN_PLACE
@ MLOG_REC_UPDATE_IN_PLACE
update of a record, preserves record field sizes
Definition: mtr0types.h:87
MLOG_COMP_REC_UPDATE_IN_PLACE
@ MLOG_COMP_REC_UPDATE_IN_PLACE
update of a compact record, preserves record field sizes
Definition: mtr0types.h:178
MLOG_COMP_PAGE_CREATE_RTREE
@ MLOG_COMP_PAGE_CREATE_RTREE
create a R-tree compact page
Definition: mtr0types.h:219
mtr_state_t
mtr_state_t
Definition: mtr0types.h:276
MLOG_COMP_PAGE_REORGANIZE
@ MLOG_COMP_PAGE_REORGANIZE
reorganize an index page
Definition: mtr0types.h:193
MLOG_PAGE_CREATE_SDI
@ MLOG_PAGE_CREATE_SDI
create a SDI index page
Definition: mtr0types.h:236
MLOG_LIST_END_DELETE
@ MLOG_LIST_END_DELETE
Delete record list end on index page.
Definition: mtr0types.h:93
MTR_LOG_SHORT_INSERTS
@ MTR_LOG_SHORT_INSERTS
Inserts are logged in a shorter form.
Definition: mtr0types.h:52
MTR_STATE_ACTIVE
@ MTR_STATE_ACTIVE
Definition: mtr0types.h:278
MTR_MEMO_PAGE_S_FIX
@ MTR_MEMO_PAGE_S_FIX
Definition: mtr0types.h:253
mtr_log_t
mtr_log_t
Logging modes for a mini-transaction.
Definition: mtr0types.h:41
mtr_memo_type_t
mtr_memo_type_t
Types for the mlock objects to store in the mtr memo; NOTE that the first 3 values must be RW_S_LATCH...
Definition: mtr0types.h:252
MLOG_DUMMY_RECORD
@ MLOG_DUMMY_RECORD
dummy log record used to pad a log block full
Definition: mtr0types.h:149
MTR_STATE_INIT
@ MTR_STATE_INIT
Definition: mtr0types.h:277
MLOG_REC_DELETE
@ MLOG_REC_DELETE
Definition: mtr0types.h:90
MLOG_ZIP_PAGE_COMPRESS_NO_DATA
@ MLOG_ZIP_PAGE_COMPRESS_NO_DATA
compress an index page without logging it's image
Definition: mtr0types.h:210
MLOG_ZIP_WRITE_BLOB_PTR
@ MLOG_ZIP_WRITE_BLOB_PTR
write the BLOB pointer of an externally stored column on a compressed page
Definition: mtr0types.h:201
MTR_MEMO_PAGE_SX_FIX
@ MTR_MEMO_PAGE_SX_FIX
Definition: mtr0types.h:257
MLOG_ZIP_PAGE_REORGANIZE
@ MLOG_ZIP_PAGE_REORGANIZE
reorganize a compressed page
Definition: mtr0types.h:213
mlog_id_t
mlog_id_t
Definition: mtr0types.h:59
MTR_MEMO_X_LOCK
@ MTR_MEMO_X_LOCK
Definition: mtr0types.h:267
MLOG_FILE_RENAME
@ MLOG_FILE_RENAME
rename a tablespace file that starts with (space_id,page_no)
Definition: mtr0types.h:155
MLOG_INIT_FILE_PAGE2
@ MLOG_INIT_FILE_PAGE2
this means that a file page is taken into use.
Definition: mtr0types.h:223
sync0rw.h
MLOG_UNDO_ERASE_END
@ MLOG_UNDO_ERASE_END
erase an undo log page end
Definition: mtr0types.h:111
MLOG_ZIP_PAGE_COMPRESS
@ MLOG_ZIP_PAGE_COMPRESS
compress an index page
Definition: mtr0types.h:207
MTR_MEMO_PAGE_X_FIX
@ MTR_MEMO_PAGE_X_FIX
Definition: mtr0types.h:255
MLOG_REC_SEC_DELETE_MARK
@ MLOG_REC_SEC_DELETE_MARK
Mark secondary index record deleted.
Definition: mtr0types.h:84
MTR_MEMO_MODIFY
@ MTR_MEMO_MODIFY
Definition: mtr0types.h:262