MySQL  8.0.22
Source Code Documentation
mtr0types.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1995, 2020, 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  /** Last element */
56 };
57 
58 /** @name Log item types
59 The log items are declared 'byte' so that the compiler can warn if val
60 and type parameters are switched in a call to mlog_write_ulint. NOTE!
61 For 1 - 8 bytes, the flag value must give the length also! @{ */
62 enum mlog_id_t {
63  /** if the mtr contains only one log record for one page,
64  i.e., write_initial_log_record has been called only once,
65  this flag is ORed to the type of that first log record */
67 
68  /** one byte is written */
70 
71  /** 2 bytes ... */
73 
74  /** 4 bytes ... */
76 
77  /** 8 bytes ... */
79 
80  /** Record insert */
82 
83  /** Mark clustered index record deleted */
85 
86  /** Mark secondary index record deleted */
88 
89  /** update of a record, preserves record field sizes */
91 
92  /*!< Delete a record from a page */
94 
95  /** Delete record list end on index page */
97 
98  /** Delete record list start on index page */
100 
101  /** Copy record list end to a new created index page */
103 
104  /** Reorganize an index page in ROW_FORMAT=REDUNDANT */
106 
107  /** Create an index page */
109 
110  /** Insert entry in an undo log */
112 
113  /** erase an undo log page end */
115 
116  /** initialize a page in an undo log */
118 
119  /** reuse an insert undo log header */
121 
122  /** create an undo log header */
124 
125  /** mark an index record as the predefined minimum record */
127 
128  /** initialize an ibuf bitmap page */
130 
131 #ifdef UNIV_LOG_LSN_DEBUG
132  /** Current LSN */
133  MLOG_LSN = 28,
134 #endif /* UNIV_LOG_LSN_DEBUG */
135 
136  /** this means that a file page is taken into use and the prior
137  contents of the page should be ignored: in recovery we must not
138  trust the lsn values stored to the file page.
139  Note: it's deprecated because it causes crash recovery problem
140  in bulk create index, and actually we don't need to reset page
141  lsn in recv_recover_page_func() now. */
143 
144  /** write a string to a page */
146 
147  /** If a single mtr writes several log records, this log
148  record ends the sequence of these records */
150 
151  /** dummy log record used to pad a log block full */
153 
154  /** log record about creating an .ibd file, with format */
156 
157  /** rename a tablespace file that starts with (space_id,page_no) */
159 
160  /** delete a tablespace file that starts with (space_id,page_no) */
162 
163  /** mark a compact index record as the predefined minimum record */
165 
166  /** create a compact index page */
168 
169  /** compact record insert */
171 
172  /** mark compact clustered index record deleted */
174 
175  /** mark compact secondary index record deleted; this log
176  record type is redundant, as MLOG_REC_SEC_DELETE_MARK is
177  independent of the record format. */
179 
180  /** update of a compact record, preserves record field sizes */
182 
183  /** delete a compact record from a page */
185 
186  /** delete compact record list end on index page */
188 
189  /*** delete compact record list start on index page */
191 
192  /** copy compact record list end to a new created index page */
194 
195  /** reorganize an index page */
197 
198  /** write the node pointer of a record on a compressed
199  non-leaf B-tree page */
201 
202  /** write the BLOB pointer of an externally stored column
203  on a compressed page */
205 
206  /** write to compressed page header */
208 
209  /** compress an index page */
211 
212  /** compress an index page without logging it's image */
214 
215  /** reorganize a compressed page */
217 
218  /** Create a R-Tree index page */
220 
221  /** create a R-tree compact page */
223 
224  /** this means that a file page is taken into use.
225  We use it to replace MLOG_INIT_FILE_PAGE. */
227 
228  /** Table is being truncated. (Marked only for file-per-table) */
229  /* MLOG_TRUNCATE = 60, Disabled for WL6378 */
230 
231  /** notify that an index tree is being loaded without writing
232  redo log about individual pages */
234 
235  /** log for some persistent dynamic metadata change */
237 
238  /** create a SDI index page */
240 
241  /** create a SDI compact page */
243 
244  /** Extend the space */
246 
247  /** Used in tests of redo log. It must never be used outside unit tests. */
248  MLOG_TEST = 66,
249 
250  /** biggest value (used in assertions) */
252 };
253 
254 /** @} */
255 
256 /** Types for the mlock objects to store in the mtr memo; NOTE that the
257 first 3 values must be RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
260 
262 
264 
266 
267 #ifdef UNIV_DEBUG
269 #endif /* UNIV_DEBUG */
270 
272 
274 
276 };
277 
278 #ifdef UNIV_DEBUG
279 #define MTR_MAGIC_N 54551
280 #endif /* UNIV_DEBUG */
281 
287 };
288 
289 #endif /* mtr0types_h */
Reorganize an index page in ROW_FORMAT=REDUNDANT.
Definition: mtr0types.h:105
Definition: sync0rw.h:137
Mark secondary index record deleted.
Definition: mtr0types.h:87
Default mode: log all operations modifying disk-based data.
Definition: mtr0types.h:43
Last element.
Definition: mtr0types.h:55
Table is being truncated.
Definition: mtr0types.h:233
Definition: mtr0types.h:268
compress an index page without logging it&#39;s image
Definition: mtr0types.h:213
write the BLOB pointer of an externally stored column on a compressed page
Definition: mtr0types.h:204
reuse an insert undo log header
Definition: mtr0types.h:120
Copy record list end to a new created index page.
Definition: mtr0types.h:102
Create an index page.
Definition: mtr0types.h:108
mark compact secondary index record deleted; this log record type is redundant, as MLOG_REC_SEC_DELET...
Definition: mtr0types.h:178
Definition: mtr0types.h:261
mlog_id_t
Definition: mtr0types.h:62
initialize a page in an undo log
Definition: mtr0types.h:117
rename a tablespace file that starts with (space_id,page_no)
Definition: mtr0types.h:158
compact record insert
Definition: mtr0types.h:170
delete a tablespace file that starts with (space_id,page_no)
Definition: mtr0types.h:161
2 bytes ...
Definition: mtr0types.h:72
Mark clustered index record deleted.
Definition: mtr0types.h:84
write to compressed page header
Definition: mtr0types.h:207
if the mtr contains only one log record for one page, i.e., write_initial_log_record has been called ...
Definition: mtr0types.h:66
mtr_state_t
Definition: mtr0types.h:282
write the node pointer of a record on a compressed non-leaf B-tree page
Definition: mtr0types.h:200
8 bytes ...
Definition: mtr0types.h:78
create a R-tree compact page
Definition: mtr0types.h:222
mtr_log_t
Logging modes for a mini-transaction.
Definition: mtr0types.h:41
dummy log record used to pad a log block full
Definition: mtr0types.h:152
Definition: sync0rw.h:139
Definition: mtr0types.h:285
mark a compact index record as the predefined minimum record
Definition: mtr0types.h:164
Definition: mtr0types.h:263
write a string to a page
Definition: mtr0types.h:145
Create a R-Tree index page.
Definition: mtr0types.h:219
mark compact clustered index record deleted
Definition: mtr0types.h:173
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:258
Definition: mtr0types.h:265
update of a compact record, preserves record field sizes
Definition: mtr0types.h:181
create an undo log header
Definition: mtr0types.h:123
The read-write lock (for threads, not for database transactions)
Delete record list start on index page.
Definition: mtr0types.h:99
Delete record list end on index page.
Definition: mtr0types.h:96
create a compact index page
Definition: mtr0types.h:167
Extend the space.
Definition: mtr0types.h:245
compress an index page
Definition: mtr0types.h:210
biggest value (used in assertions)
Definition: mtr0types.h:251
If a single mtr writes several log records, this log record ends the sequence of these records...
Definition: mtr0types.h:149
update of a record, preserves record field sizes
Definition: mtr0types.h:90
Log no operations and dirty pages are not added to the flush list.
Definition: mtr0types.h:46
delete a compact record from a page
Definition: mtr0types.h:184
Definition: sync0rw.h:136
Don&#39;t generate REDO log but add dirty pages to flush list.
Definition: mtr0types.h:49
Definition: mtr0types.h:283
Inserts are logged in a shorter form.
Definition: mtr0types.h:52
Definition: mtr0types.h:93
erase an undo log page end
Definition: mtr0types.h:114
initialize an ibuf bitmap page
Definition: mtr0types.h:129
create a SDI index page
Definition: mtr0types.h:239
log for some persistent dynamic metadata change
Definition: mtr0types.h:236
Record insert.
Definition: mtr0types.h:81
Definition: mtr0types.h:275
Definition: mtr0types.h:284
Insert entry in an undo log.
Definition: mtr0types.h:111
Definition: mtr0types.h:259
create a SDI compact page
Definition: mtr0types.h:242
Used in tests of redo log.
Definition: mtr0types.h:248
this means that a file page is taken into use.
Definition: mtr0types.h:226
reorganize an index page
Definition: mtr0types.h:196
copy compact record list end to a new created index page
Definition: mtr0types.h:193
Definition: mtr0types.h:286
reorganize a compressed page
Definition: mtr0types.h:216
Definition: mtr0types.h:273
Definition: sync0rw.h:138
Definition: mtr0types.h:271
one byte is written
Definition: mtr0types.h:69
4 bytes ...
Definition: mtr0types.h:75
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:169
log record about creating an .ibd file, with format
Definition: mtr0types.h:155
delete compact record list end on index page
Definition: mtr0types.h:187
Definition: mtr0types.h:190
mark an index record as the predefined minimum record
Definition: mtr0types.h:126
this means that a file page is taken into use and the prior contents of the page should be ignored: i...
Definition: mtr0types.h:142