MySQL 9.1.0
Source Code Documentation
mtr0types.h File Reference

Mini-transaction buffer global types. More...

#include "sync0rw.h"

Go to the source code of this file.

Enumerations

enum  mtr_log_t {
  MTR_LOG_ALL = 0 , MTR_LOG_NONE = 1 , MTR_LOG_NO_REDO = 2 , MTR_LOG_SHORT_INSERTS = 3 ,
  MTR_LOG_MODE_MAX = 4
}
 Logging modes for a mini-transaction. More...
 
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 }
 
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!

enum  mlog_id_t {
  MLOG_SINGLE_REC_FLAG = 128 , MLOG_1BYTE = 1 , MLOG_2BYTES = 2 , MLOG_4BYTES = 4 ,
  MLOG_8BYTES = 8 , MLOG_REC_INSERT_8027 = 9 , MLOG_REC_CLUST_DELETE_MARK_8027 = 10 , MLOG_REC_SEC_DELETE_MARK = 11 ,
  MLOG_REC_UPDATE_IN_PLACE_8027 = 13 , MLOG_REC_DELETE_8027 = 14 , MLOG_LIST_END_DELETE_8027 = 15 , MLOG_LIST_START_DELETE_8027 = 16 ,
  MLOG_LIST_END_COPY_CREATED_8027 = 17 , MLOG_PAGE_REORGANIZE_8027 = 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_8027 = 38 ,
  MLOG_COMP_REC_CLUST_DELETE_MARK_8027 = 39 , MLOG_COMP_REC_SEC_DELETE_MARK = 40 , MLOG_COMP_REC_UPDATE_IN_PLACE_8027 = 41 , MLOG_COMP_REC_DELETE_8027 = 42 ,
  MLOG_COMP_LIST_END_DELETE_8027 = 43 , MLOG_COMP_LIST_START_DELETE_8027 = 44 , MLOG_COMP_LIST_END_COPY_CREATED_8027 = 45 , MLOG_COMP_PAGE_REORGANIZE_8027 = 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_8027 = 52 , MLOG_ZIP_PAGE_REORGANIZE_8027 = 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_FILE_EXTEND = 65 , MLOG_TEST = 66 , MLOG_REC_INSERT = 67 ,
  MLOG_REC_CLUST_DELETE_MARK = 68 , MLOG_REC_DELETE = 69 , MLOG_REC_UPDATE_IN_PLACE = 70 , MLOG_LIST_END_COPY_CREATED = 71 ,
  MLOG_PAGE_REORGANIZE = 72 , MLOG_ZIP_PAGE_REORGANIZE = 73 , MLOG_ZIP_PAGE_COMPRESS_NO_DATA = 74 , MLOG_LIST_END_DELETE = 75 ,
  MLOG_LIST_START_DELETE = 76 , MLOG_BIGGEST_TYPE = MLOG_LIST_START_DELETE
}
 

Functions

const char * mtr_memo_type (const ulint type)
 

Variables

constexpr uint32_t MTR_MAGIC_N = 54551
 

Detailed Description

Mini-transaction buffer global types.

Created 11/26/1995 Heikki Tuuri

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_8027 

Record insert.

MLOG_REC_CLUST_DELETE_MARK_8027 

Mark clustered index record deleted.

MLOG_REC_SEC_DELETE_MARK 

Mark secondary index record deleted.

MLOG_REC_UPDATE_IN_PLACE_8027 

update of a record, preserves record field sizes

Delete a record from a page

MLOG_REC_DELETE_8027 
MLOG_LIST_END_DELETE_8027 

Delete record list end on index page.

MLOG_LIST_START_DELETE_8027 

Delete record list start on index page.

MLOG_LIST_END_COPY_CREATED_8027 

Copy record list end to a new created index page.

MLOG_PAGE_REORGANIZE_8027 

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_8027 

compact record insert

MLOG_COMP_REC_CLUST_DELETE_MARK_8027 

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_8027 

update of a compact record, preserves record field sizes

MLOG_COMP_REC_DELETE_8027 

delete a compact record from a page

MLOG_COMP_LIST_END_DELETE_8027 

delete compact record list end on index page

MLOG_COMP_LIST_START_DELETE_8027 
MLOG_COMP_LIST_END_COPY_CREATED_8027 

copy compact record list end to a new created index page

MLOG_COMP_PAGE_REORGANIZE_8027 

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_8027 

compress an index page without logging it's image

MLOG_ZIP_PAGE_REORGANIZE_8027 

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_FILE_EXTEND 

Extend the space.

MLOG_TEST 

Used in tests of redo log.

It must never be used outside unit tests.

MLOG_REC_INSERT 
MLOG_REC_CLUST_DELETE_MARK 
MLOG_REC_DELETE 
MLOG_REC_UPDATE_IN_PLACE 
MLOG_LIST_END_COPY_CREATED 
MLOG_PAGE_REORGANIZE 
MLOG_ZIP_PAGE_REORGANIZE 
MLOG_ZIP_PAGE_COMPRESS_NO_DATA 
MLOG_LIST_END_DELETE 
MLOG_LIST_START_DELETE 
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_LOG_MODE_MAX 

Last element.

◆ 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 

Function Documentation

◆ mtr_memo_type()

const char * mtr_memo_type ( const ulint  type)
inline

Variable Documentation

◆ MTR_MAGIC_N

constexpr uint32_t MTR_MAGIC_N = 54551
constexpr