MySQL  8.0.19
Source Code Documentation
mtr0types.h File Reference
#include "sync0rw.h"

Go to the source code of this file.

Enumerations

enum  mtr_log_t { MTR_LOG_ALL = 21, MTR_LOG_NONE = 22, MTR_LOG_NO_REDO = 23, MTR_LOG_SHORT_INSERTS = 24 }
 Logging modes for a mini-transaction. More...
 

Log item types

The log items are declared 'byte' so that the compiler can warn if val and type parameters are switched in a call to mlog_write_ulint.

NOTE! For 1 - 8 bytes, the flag value must give the length also!

#define MTR_MAGIC_N   54551
 
enum  mlog_id_t {
  MLOG_SINGLE_REC_FLAG = 128, MLOG_1BYTE = 1, MLOG_2BYTES = 2, MLOG_4BYTES = 4,
  MLOG_8BYTES = 8, MLOG_REC_INSERT = 9, MLOG_REC_CLUST_DELETE_MARK = 10, MLOG_REC_SEC_DELETE_MARK = 11,
  MLOG_REC_UPDATE_IN_PLACE = 13, MLOG_REC_DELETE = 14, MLOG_LIST_END_DELETE = 15, MLOG_LIST_START_DELETE = 16,
  MLOG_LIST_END_COPY_CREATED = 17, MLOG_PAGE_REORGANIZE = 18, MLOG_PAGE_CREATE = 19, MLOG_UNDO_INSERT = 20,
  MLOG_UNDO_ERASE_END = 21, MLOG_UNDO_INIT = 22, MLOG_UNDO_HDR_REUSE = 24, MLOG_UNDO_HDR_CREATE = 25,
  MLOG_REC_MIN_MARK = 26, MLOG_IBUF_BITMAP_INIT = 27, MLOG_INIT_FILE_PAGE = 29, MLOG_WRITE_STRING = 30,
  MLOG_MULTI_REC_END = 31, MLOG_DUMMY_RECORD = 32, MLOG_FILE_CREATE = 33, MLOG_FILE_RENAME = 34,
  MLOG_FILE_DELETE = 35, MLOG_COMP_REC_MIN_MARK = 36, MLOG_COMP_PAGE_CREATE = 37, MLOG_COMP_REC_INSERT = 38,
  MLOG_COMP_REC_CLUST_DELETE_MARK = 39, MLOG_COMP_REC_SEC_DELETE_MARK = 40, MLOG_COMP_REC_UPDATE_IN_PLACE = 41, MLOG_COMP_REC_DELETE = 42,
  MLOG_COMP_LIST_END_DELETE = 43, MLOG_COMP_LIST_START_DELETE = 44, MLOG_COMP_LIST_END_COPY_CREATED = 45, MLOG_COMP_PAGE_REORGANIZE = 46,
  MLOG_ZIP_WRITE_NODE_PTR = 48, MLOG_ZIP_WRITE_BLOB_PTR = 49, MLOG_ZIP_WRITE_HEADER = 50, MLOG_ZIP_PAGE_COMPRESS = 51,
  MLOG_ZIP_PAGE_COMPRESS_NO_DATA = 52, MLOG_ZIP_PAGE_REORGANIZE = 53, MLOG_PAGE_CREATE_RTREE = 57, MLOG_COMP_PAGE_CREATE_RTREE = 58,
  MLOG_INIT_FILE_PAGE2 = 59, MLOG_INDEX_LOAD = 61, MLOG_TABLE_DYNAMIC_META = 62, MLOG_PAGE_CREATE_SDI = 63,
  MLOG_COMP_PAGE_CREATE_SDI = 64, MLOG_TEST = 65, MLOG_BIGGEST_TYPE = MLOG_TEST
}
 
enum  mtr_memo_type_t {
  MTR_MEMO_PAGE_S_FIX = RW_S_LATCH, MTR_MEMO_PAGE_X_FIX = RW_X_LATCH, MTR_MEMO_PAGE_SX_FIX = RW_SX_LATCH, MTR_MEMO_BUF_FIX = RW_NO_LATCH,
  MTR_MEMO_MODIFY = 32, MTR_MEMO_S_LOCK = 64, MTR_MEMO_X_LOCK = 128, MTR_MEMO_SX_LOCK = 256
}
 Types for the mlock objects to store in the mtr memo; NOTE that the first 3 values must be RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH. More...
 
enum  mtr_state_t { MTR_STATE_INIT = 0, MTR_STATE_ACTIVE = 12231, MTR_STATE_COMMITTING = 56456, MTR_STATE_COMMITTED = 34676 }
 

Detailed Description

Mini-transaction buffer global types

Created 11/26/1995 Heikki Tuuri

Macro Definition Documentation

◆ MTR_MAGIC_N

#define MTR_MAGIC_N   54551

Enumeration Type Documentation

◆ mlog_id_t

enum mlog_id_t
Enumerator
MLOG_SINGLE_REC_FLAG 

if the mtr contains only one log record for one page, i.e., write_initial_log_record has been called only once, this flag is ORed to the type of that first log record

MLOG_1BYTE 

one byte is written

MLOG_2BYTES 

2 bytes ...

MLOG_4BYTES 

4 bytes ...

MLOG_8BYTES 

8 bytes ...

MLOG_REC_INSERT 

Record insert.

MLOG_REC_CLUST_DELETE_MARK 

Mark clustered index record deleted.

MLOG_REC_SEC_DELETE_MARK 

Mark secondary index record deleted.

MLOG_REC_UPDATE_IN_PLACE 

update of a record, preserves record field sizes

Delete a record from a page

MLOG_REC_DELETE 
MLOG_LIST_END_DELETE 

Delete record list end on index page.

MLOG_LIST_START_DELETE 

Delete record list start on index page.

MLOG_LIST_END_COPY_CREATED 

Copy record list end to a new created index page.

MLOG_PAGE_REORGANIZE 

Reorganize an index page in ROW_FORMAT=REDUNDANT.

MLOG_PAGE_CREATE 

Create an index page.

MLOG_UNDO_INSERT 

Insert entry in an undo log.

MLOG_UNDO_ERASE_END 

erase an undo log page end

MLOG_UNDO_INIT 

initialize a page in an undo log

MLOG_UNDO_HDR_REUSE 

reuse an insert undo log header

MLOG_UNDO_HDR_CREATE 

create an undo log header

MLOG_REC_MIN_MARK 

mark an index record as the predefined minimum record

MLOG_IBUF_BITMAP_INIT 

initialize an ibuf bitmap 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: in recovery we must not trust the lsn values stored to the file page.

Note: it's deprecated because it causes crash recovery problem in bulk create index, and actually we don't need to reset page lsn in recv_recover_page_func() now.

MLOG_WRITE_STRING 

write a string to a page

MLOG_MULTI_REC_END 

If a single mtr writes several log records, this log record ends the sequence of these records.

MLOG_DUMMY_RECORD 

dummy log record used to pad a log block full

MLOG_FILE_CREATE 

log record about creating an .ibd file, with format

MLOG_FILE_RENAME 

rename a tablespace file that starts with (space_id,page_no)

MLOG_FILE_DELETE 

delete a tablespace file that starts with (space_id,page_no)

MLOG_COMP_REC_MIN_MARK 

mark a compact index record as the predefined minimum record

MLOG_COMP_PAGE_CREATE 

create a compact index page

MLOG_COMP_REC_INSERT 

compact record insert

MLOG_COMP_REC_CLUST_DELETE_MARK 

mark compact clustered index record deleted

MLOG_COMP_REC_SEC_DELETE_MARK 

mark compact secondary index record deleted; this log record type is redundant, as MLOG_REC_SEC_DELETE_MARK is independent of the record format.

MLOG_COMP_REC_UPDATE_IN_PLACE 

update of a compact record, preserves record field sizes

MLOG_COMP_REC_DELETE 

delete a compact record from a page

MLOG_COMP_LIST_END_DELETE 

delete compact record list end on index page

MLOG_COMP_LIST_START_DELETE 
MLOG_COMP_LIST_END_COPY_CREATED 

copy compact record list end to a new created index page

MLOG_COMP_PAGE_REORGANIZE 

reorganize an index page

MLOG_ZIP_WRITE_NODE_PTR 

write the node pointer of a record on a compressed non-leaf B-tree page

MLOG_ZIP_WRITE_BLOB_PTR 

write the BLOB pointer of an externally stored column on a compressed page

MLOG_ZIP_WRITE_HEADER 

write to compressed page header

MLOG_ZIP_PAGE_COMPRESS 

compress an index page

MLOG_ZIP_PAGE_COMPRESS_NO_DATA 

compress an index page without logging it's image

MLOG_ZIP_PAGE_REORGANIZE 

reorganize a compressed page

MLOG_PAGE_CREATE_RTREE 

Create a R-Tree index page.

MLOG_COMP_PAGE_CREATE_RTREE 

create a R-tree compact page

MLOG_INIT_FILE_PAGE2 

this means that a file page is taken into use.

We use it to replace MLOG_INIT_FILE_PAGE.

MLOG_INDEX_LOAD 

Table is being truncated.

(Marked only for file-per-table) notify that an index tree is being loaded without writing redo log about individual pages

MLOG_TABLE_DYNAMIC_META 

log for some persistent dynamic metadata change

MLOG_PAGE_CREATE_SDI 

create a SDI index page

MLOG_COMP_PAGE_CREATE_SDI 

create a SDI compact page

MLOG_TEST 

Used in tests of redo log.

It must never be used outside unit tests.

MLOG_BIGGEST_TYPE 

biggest value (used in assertions)

◆ mtr_log_t

enum mtr_log_t

Logging modes for a mini-transaction.

Enumerator
MTR_LOG_ALL 

Default mode: log all operations modifying disk-based data.

MTR_LOG_NONE 

Log no operations and dirty pages are not added to the flush list.

MTR_LOG_NO_REDO 

Don't generate REDO log but add dirty pages to flush list.

MTR_LOG_SHORT_INSERTS 

Inserts are logged in a shorter form.

◆ 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, RW_X_LATCH, RW_NO_LATCH.

Enumerator
MTR_MEMO_PAGE_S_FIX 
MTR_MEMO_PAGE_X_FIX 
MTR_MEMO_PAGE_SX_FIX 
MTR_MEMO_BUF_FIX 
MTR_MEMO_MODIFY 
MTR_MEMO_S_LOCK 
MTR_MEMO_X_LOCK 
MTR_MEMO_SX_LOCK 

◆ mtr_state_t

Enumerator
MTR_STATE_INIT 
MTR_STATE_ACTIVE 
MTR_STATE_COMMITTING 
MTR_STATE_COMMITTED