| 1 | /***************************************************************************** |
| 2 | |
| 3 | Copyright (c) 2016, 2026, Oracle and/or its affiliates. |
| 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 designed to work with certain software (including |
| 10 | but not limited to OpenSSL) that is licensed under separate terms, |
| 11 | as designated in a particular file or component or in included license |
| 12 | documentation. The authors of MySQL hereby grant you an additional |
| 13 | permission to link the program and your derivative works with the |
| 14 | separately licensed software that they have either included with |
| 15 | the program or referenced in the documentation. |
| 16 | |
| 17 | This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 20 | for more details. |
| 21 | |
| 22 | You should have received a copy of the GNU General Public License along with |
| 23 | this program; if not, write to the Free Software Foundation, Inc., |
| 24 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | |
| 26 | *****************************************************************************/ |
| 27 | #ifndef _mtr0types_h_ |
| 28 | #define _mtr0types_h_ |
| 29 | |
| 30 | enum mlog_id_t { |
| 31 | /** if the mtr contains only one log record for one page, |
| 32 | i.e., write_initial_log_record has been called only once, |
| 33 | this flag is ORed to the type of that first log record */ |
| 34 | MLOG_SINGLE_REC_FLAG = 128, |
| 35 | |
| 36 | /** one byte is written */ |
| 37 | MLOG_1BYTE = 1, |
| 38 | |
| 39 | /** 2 bytes ... */ |
| 40 | MLOG_2BYTES = 2, |
| 41 | |
| 42 | /** 4 bytes ... */ |
| 43 | MLOG_4BYTES = 4, |
| 44 | |
| 45 | /** 8 bytes ... */ |
| 46 | MLOG_8BYTES = 8, |
| 47 | |
| 48 | /** Record insert */ |
| 49 | MLOG_REC_INSERT = 9, |
| 50 | |
| 51 | /** Mark clustered index record deleted */ |
| 52 | MLOG_REC_CLUST_DELETE_MARK = 10, |
| 53 | |
| 54 | /** Mark secondary index record deleted */ |
| 55 | MLOG_REC_SEC_DELETE_MARK = 11, |
| 56 | |
| 57 | /** update of a record, preserves record field sizes */ |
| 58 | MLOG_REC_UPDATE_IN_PLACE = 13, |
| 59 | |
| 60 | /*!< Delete a record from a page */ |
| 61 | MLOG_REC_DELETE = 14, |
| 62 | |
| 63 | /** Delete record list end on index page */ |
| 64 | MLOG_LIST_END_DELETE = 15, |
| 65 | |
| 66 | /** Delete record list start on index page */ |
| 67 | MLOG_LIST_START_DELETE = 16, |
| 68 | |
| 69 | /** Copy record list end to a new created index page */ |
| 70 | MLOG_LIST_END_COPY_CREATED = 17, |
| 71 | |
| 72 | /** Reorganize an index page in ROW_FORMAT=REDUNDANT */ |
| 73 | MLOG_PAGE_REORGANIZE = 18, |
| 74 | |
| 75 | /** Create an index page */ |
| 76 | MLOG_PAGE_CREATE = 19, |
| 77 | |
| 78 | /** Insert entry in an undo log */ |
| 79 | MLOG_UNDO_INSERT = 20, |
| 80 | |
| 81 | /** erase an undo log page end */ |
| 82 | MLOG_UNDO_ERASE_END = 21, |
| 83 | |
| 84 | /** initialize a page in an undo log */ |
| 85 | MLOG_UNDO_INIT = 22, |
| 86 | |
| 87 | /* discard an update undo log header (unused already in 3.23.53) */ |
| 88 | // MLOG_UNDO_HDR_DISCARD = 23, |
| 89 | |
| 90 | /** reuse an insert undo log header */ |
| 91 | MLOG_UNDO_HDR_REUSE = 24, |
| 92 | |
| 93 | /** create an undo log header */ |
| 94 | MLOG_UNDO_HDR_CREATE = 25, |
| 95 | |
| 96 | /** mark an index record as the predefined minimum record */ |
| 97 | MLOG_REC_MIN_MARK = 26, |
| 98 | |
| 99 | /** initialize an ibuf bitmap page */ |
| 100 | MLOG_IBUF_BITMAP_INIT = 27, |
| 101 | |
| 102 | #ifdef UNIV_LOG_LSN_DEBUG |
| 103 | /** Current LSN */ |
| 104 | MLOG_LSN = 28, |
| 105 | #endif /* UNIV_LOG_LSN_DEBUG */ |
| 106 | |
| 107 | /** this means that a file page is taken into use and the prior |
| 108 | contents of the page should be ignored: in recovery we must not |
| 109 | trust the lsn values stored to the file page. |
| 110 | Note: it's deprecated because it causes crash recovery problem |
| 111 | in bulk create index, and actually we don't need to reset page |
| 112 | lsn in recv_recover_page_func() now. */ |
| 113 | MLOG_INIT_FILE_PAGE = 29, |
| 114 | |
| 115 | /** write a string to a page */ |
| 116 | MLOG_WRITE_STRING = 30, |
| 117 | |
| 118 | /** If a single mtr writes several log records, this log |
| 119 | record ends the sequence of these records */ |
| 120 | MLOG_MULTI_REC_END = 31, |
| 121 | |
| 122 | /** dummy log record used to pad a log block full */ |
| 123 | MLOG_DUMMY_RECORD = 32, |
| 124 | |
| 125 | /** log record about an .ibd file creation */ |
| 126 | // MLOG_FILE_CREATE = 33, |
| 127 | |
| 128 | /** rename databasename/tablename (no .ibd file name suffix) */ |
| 129 | // MLOG_FILE_RENAME = 34, |
| 130 | |
| 131 | /** delete a tablespace file that starts with (space_id,page_no) */ |
| 132 | MLOG_FILE_DELETE = 35, |
| 133 | |
| 134 | /** mark a compact index record as the predefined minimum record */ |
| 135 | MLOG_COMP_REC_MIN_MARK = 36, |
| 136 | |
| 137 | /** create a compact index page */ |
| 138 | MLOG_COMP_PAGE_CREATE = 37, |
| 139 | |
| 140 | /** compact record insert */ |
| 141 | MLOG_COMP_REC_INSERT = 38, |
| 142 | |
| 143 | /** mark compact clustered index record deleted */ |
| 144 | MLOG_COMP_REC_CLUST_DELETE_MARK = 39, |
| 145 | |
| 146 | /** mark compact secondary index record deleted; this log |
| 147 | record type is redundant, as MLOG_REC_SEC_DELETE_MARK is |
| 148 | independent of the record format. */ |
| 149 | MLOG_COMP_REC_SEC_DELETE_MARK = 40, |
| 150 | |
| 151 | /** update of a compact record, preserves record field sizes */ |
| 152 | MLOG_COMP_REC_UPDATE_IN_PLACE = 41, |
| 153 | |
| 154 | /** delete a compact record from a page */ |
| 155 | MLOG_COMP_REC_DELETE = 42, |
| 156 | |
| 157 | /** delete compact record list end on index page */ |
| 158 | MLOG_COMP_LIST_END_DELETE = 43, |
| 159 | |
| 160 | /*** delete compact record list start on index page */ |
| 161 | MLOG_COMP_LIST_START_DELETE = 44, |
| 162 | |
| 163 | /** copy compact record list end to a new created index page */ |
| 164 | MLOG_COMP_LIST_END_COPY_CREATED = 45, |
| 165 | |
| 166 | /** reorganize an index page */ |
| 167 | MLOG_COMP_PAGE_REORGANIZE = 46, |
| 168 | |
| 169 | /** log record about creating an .ibd file, with format */ |
| 170 | MLOG_FILE_CREATE2 = 47, |
| 171 | |
| 172 | /** write the node pointer of a record on a compressed |
| 173 | non-leaf B-tree page */ |
| 174 | MLOG_ZIP_WRITE_NODE_PTR = 48, |
| 175 | |
| 176 | /** write the BLOB pointer of an externally stored column |
| 177 | on a compressed page */ |
| 178 | MLOG_ZIP_WRITE_BLOB_PTR = 49, |
| 179 | |
| 180 | /** write to compressed page header */ |
| 181 | MLOG_ZIP_WRITE_HEADER = 50, |
| 182 | |
| 183 | /** compress an index page */ |
| 184 | MLOG_ZIP_PAGE_COMPRESS = 51, |
| 185 | |
| 186 | /** compress an index page without logging it's image */ |
| 187 | MLOG_ZIP_PAGE_COMPRESS_NO_DATA = 52, |
| 188 | |
| 189 | /** reorganize a compressed page */ |
| 190 | MLOG_ZIP_PAGE_REORGANIZE = 53, |
| 191 | |
| 192 | /** rename a tablespace file that starts with (space_id,page_no) */ |
| 193 | MLOG_FILE_RENAME2 = 54, |
| 194 | |
| 195 | /** note the first use of a tablespace file since checkpoint */ |
| 196 | MLOG_FILE_NAME = 55, |
| 197 | |
| 198 | /** note that all buffered log was written since a checkpoint */ |
| 199 | MLOG_CHECKPOINT = 56, |
| 200 | |
| 201 | /** Create a R-Tree index page */ |
| 202 | MLOG_PAGE_CREATE_RTREE = 57, |
| 203 | |
| 204 | /** create a R-tree compact page */ |
| 205 | MLOG_COMP_PAGE_CREATE_RTREE = 58, |
| 206 | |
| 207 | /** this means that a file page is taken into use. |
| 208 | We use it to replace MLOG_INIT_FILE_PAGE. */ |
| 209 | MLOG_INIT_FILE_PAGE2 = 59, |
| 210 | |
| 211 | /** Table is being truncated. (Marked only for file-per-table) */ |
| 212 | /* MLOG_TRUNCATE = 60, Disabled for WL6378 */ |
| 213 | |
| 214 | /** notify that an index tree is being loaded without writing |
| 215 | redo log about individual pages */ |
| 216 | MLOG_INDEX_LOAD = 61, |
| 217 | |
| 218 | /** log for some persistent dynamic metadata change */ |
| 219 | MLOG_TABLE_DYNAMIC_META = 62, |
| 220 | |
| 221 | /** create a SDI index page */ |
| 222 | MLOG_PAGE_CREATE_SDI = 63, |
| 223 | |
| 224 | /** create a SDI compact page */ |
| 225 | MLOG_COMP_PAGE_CREATE_SDI = 64, |
| 226 | |
| 227 | /** biggest value (used in assertions) */ |
| 228 | MLOG_BIGGEST_TYPE = MLOG_COMP_PAGE_CREATE_SDI |
| 229 | }; |
| 230 | #endif // _mtr0types_h_ |