MySQL 8.0.40
Source Code Documentation
mtr0log.ic File Reference

Mini-transaction logging routines. More...

#include "buf0dblwr.h"
#include "fsp0types.h"
#include "mach0data.h"
#include "trx0types.h"
#include "mysqld_error.h"

Functions

static bool mlog_open (mtr_t *mtr, ulint size, byte *&buffer)
 
static bool mlog_open_metadata (mtr_t *mtr, ulint size, byte *&buffer)
 
static void mlog_close (mtr_t *mtr, byte *ptr)
 Closes a buffer opened to mlog. More...
 
static void mlog_catenate_ulint (mtr_buf_t *mtr_buf, ulint val, mlog_id_t type)
 Concatenates 1 - 4 bytes to the mtr log. More...
 
static void mlog_catenate_ulint (mtr_t *mtr, ulint val, mlog_id_t type)
 Concatenates 1 - 4 bytes to the mtr log. More...
 
static void mlog_catenate_ulint_compressed (mtr_t *mtr, ulint val)
 Concatenates a compressed ulint to mlog. More...
 
static void mlog_catenate_ull_compressed (mtr_t *mtr, uint64_t val)
 Catenates a compressed 64-bit integer to mlog. More...
 
static bytemlog_write_initial_dict_log_record (mlog_id_t type, table_id_t id, uint64_t version, byte *log_ptr, mtr_t *mtr)
 
static bytemlog_write_initial_log_record_low (mlog_id_t type, space_id_t space_id, page_no_t page_no, byte *log_ptr, mtr_t *mtr)
 Writes a log record about an operation. More...
 
static bytemlog_write_initial_log_record_fast (const byte *ptr, mlog_id_t type, byte *log_ptr, mtr_t *mtr)
 Writes the initial part of a log record (3..11 bytes). More...
 

Detailed Description

Mini-transaction logging routines.

Created 12/7/1995 Heikki Tuuri

Function Documentation

◆ mlog_catenate_ulint() [1/2]

static void mlog_catenate_ulint ( mtr_buf_t mtr_buf,
ulint  val,
mlog_id_t  type 
)
inlinestatic

Concatenates 1 - 4 bytes to the mtr log.

The value is not compressed.

Parameters
mtr_bufin/out: buffer to write
valin: value to write
typein: type of value to write

◆ mlog_catenate_ulint() [2/2]

static void mlog_catenate_ulint ( mtr_t mtr,
ulint  val,
mlog_id_t  type 
)
inlinestatic

Concatenates 1 - 4 bytes to the mtr log.

The value is not compressed.

Parameters
mtrin/out: mtr
valin: value to write
typein: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES

◆ mlog_catenate_ulint_compressed()

static void mlog_catenate_ulint_compressed ( mtr_t mtr,
ulint  val 
)
inlinestatic

Concatenates a compressed ulint to mlog.

Parameters
mtrin: mtr
valin: value to write

◆ mlog_catenate_ull_compressed()

static void mlog_catenate_ull_compressed ( mtr_t mtr,
uint64_t  val 
)
inlinestatic

Catenates a compressed 64-bit integer to mlog.

Parameters
mtrin: mtr
valin: value to write

◆ mlog_close()

static void mlog_close ( mtr_t mtr,
byte ptr 
)
inlinestatic

Closes a buffer opened to mlog.

Parameters
mtrin: mtr
ptrin: buffer space from ptr up was not used

◆ mlog_open()

static bool mlog_open ( mtr_t mtr,
ulint  size,
byte *&  buffer 
)
inlinestatic

◆ mlog_open_metadata()

static bool mlog_open_metadata ( mtr_t mtr,
ulint  size,
byte *&  buffer 
)
inlinestatic

◆ mlog_write_initial_dict_log_record()

static byte * mlog_write_initial_dict_log_record ( mlog_id_t  type,
table_id_t  id,
uint64_t  version,
byte log_ptr,
mtr_t mtr 
)
inlinestatic

◆ mlog_write_initial_log_record_fast()

static byte * mlog_write_initial_log_record_fast ( const byte ptr,
mlog_id_t  type,
byte log_ptr,
mtr_t mtr 
)
inlinestatic

Writes the initial part of a log record (3..11 bytes).

If the implementation of this function is changed, all size parameters to mlog_open() should be adjusted accordingly!

Returns
new value of log_ptr
Parameters
ptrin: pointer to (inside) a buffer frame holding the file page where modification is made
typein: log item type: MLOG_1BYTE, ...
log_ptrin: pointer to mtr log which has been opened
mtrin/out: mtr

◆ mlog_write_initial_log_record_low()

static byte * mlog_write_initial_log_record_low ( mlog_id_t  type,
space_id_t  space_id,
page_no_t  page_no,
byte log_ptr,
mtr_t mtr 
)
inlinestatic

Writes a log record about an operation.

Parameters
[in]typeRedo log record type
[in]space_idTablespace identifier
[in]page_noPage number
[in,out]log_ptrCurrent end of mini-transaction log
[in,out]mtrMini-transaction
Returns
end of mini-transaction log