MySQL 5.6.14 Source Code Document
|
#include "univ.i"
#include "mem0mem.h"
#include "dyn0dyn.h"
#include "buf0types.h"
#include "sync0rw.h"
#include "ut0byte.h"
#include "mtr0types.h"
#include "page0types.h"
#include "log0log.h"
#include "mtr0mtr.ic"
Go to the source code of this file.
Classes | |
struct | mtr_memo_slot_t |
struct | mtr_t |
Macros | |
#define | MTR_LOG_ALL |
#define | MTR_LOG_NONE 22 /* log no operations */ |
#define | MTR_LOG_NO_REDO 23 /* Don't generate REDO */ |
#define | MTR_LOG_SHORT_INSERTS |
#define | MTR_MEMO_PAGE_S_FIX RW_S_LATCH |
#define | MTR_MEMO_PAGE_X_FIX RW_X_LATCH |
#define | MTR_MEMO_BUF_FIX RW_NO_LATCH |
#define | MTR_MEMO_S_LOCK 55 |
#define | MTR_MEMO_X_LOCK 56 |
#define | mtr_s_lock(B, MTR) |
#define | mtr_x_lock(B, MTR) |
#define | MTR_BUF_MEMO_SIZE 200 /* number of slots in memo */ |
#define | MTR_ACTIVE 12231 |
#define | MTR_COMMITTING 56456 |
#define | MTR_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! | |
#define | MLOG_SINGLE_REC_FLAG 128 |
#define | MLOG_1BYTE (1) |
#define | MLOG_2BYTES (2) |
#define | MLOG_4BYTES (4) |
#define | MLOG_8BYTES (8) |
#define | MLOG_REC_INSERT ((byte)9) |
#define | MLOG_REC_CLUST_DELETE_MARK ((byte)10) |
#define | MLOG_REC_SEC_DELETE_MARK ((byte)11) |
#define | MLOG_REC_UPDATE_IN_PLACE ((byte)13) |
#define | MLOG_REC_DELETE ((byte)14) |
#define | MLOG_LIST_END_DELETE ((byte)15) |
#define | MLOG_LIST_START_DELETE ((byte)16) |
#define | MLOG_LIST_END_COPY_CREATED ((byte)17) |
#define | MLOG_PAGE_REORGANIZE ((byte)18) |
#define | MLOG_PAGE_CREATE ((byte)19) |
#define | MLOG_UNDO_INSERT ((byte)20) |
#define | MLOG_UNDO_ERASE_END ((byte)21) |
#define | MLOG_UNDO_INIT ((byte)22) |
#define | MLOG_UNDO_HDR_DISCARD ((byte)23) |
#define | MLOG_UNDO_HDR_REUSE ((byte)24) |
#define | MLOG_UNDO_HDR_CREATE ((byte)25) |
#define | MLOG_REC_MIN_MARK ((byte)26) |
#define | MLOG_IBUF_BITMAP_INIT ((byte)27) |
#define | MLOG_INIT_FILE_PAGE ((byte)29) |
#define | MLOG_WRITE_STRING ((byte)30) |
#define | MLOG_MULTI_REC_END ((byte)31) |
#define | MLOG_DUMMY_RECORD ((byte)32) |
#define | MLOG_FILE_CREATE ((byte)33) |
#define | MLOG_FILE_RENAME ((byte)34) |
#define | MLOG_FILE_DELETE ((byte)35) |
#define | MLOG_COMP_REC_MIN_MARK ((byte)36) |
#define | MLOG_COMP_PAGE_CREATE ((byte)37) |
#define | MLOG_COMP_REC_INSERT ((byte)38) |
#define | MLOG_COMP_REC_CLUST_DELETE_MARK ((byte)39) |
#define | MLOG_COMP_REC_SEC_DELETE_MARK ((byte)40) |
#define | MLOG_COMP_REC_UPDATE_IN_PLACE ((byte)41) |
#define | MLOG_COMP_REC_DELETE ((byte)42) |
#define | MLOG_COMP_LIST_END_DELETE ((byte)43) |
#define | MLOG_COMP_LIST_START_DELETE ((byte)44) |
#define | MLOG_COMP_LIST_END_COPY_CREATED ((byte)45) |
#define | MLOG_COMP_PAGE_REORGANIZE ((byte)46) |
#define | MLOG_FILE_CREATE2 ((byte)47) |
#define | MLOG_ZIP_WRITE_NODE_PTR ((byte)48) |
#define | MLOG_ZIP_WRITE_BLOB_PTR ((byte)49) |
#define | MLOG_ZIP_WRITE_HEADER ((byte)50) |
#define | MLOG_ZIP_PAGE_COMPRESS ((byte)51) |
#define | MLOG_ZIP_PAGE_COMPRESS_NO_DATA ((byte)52) |
#define | MLOG_ZIP_PAGE_REORGANIZE ((byte)53) |
#define | MLOG_BIGGEST_TYPE ((byte)53) |
Flags for MLOG_FILE operations | |
(stored in the page number parameter, called log_flags in the functions). The page number parameter was originally written as 0. | |
#define | MLOG_FILE_FLAG_TEMP 1 |
Functions | |
UNIV_INLINE void | mtr_start (mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INTERN void | mtr_commit (mtr_t *mtr) __attribute__((nonnull)) |
UNIV_INLINE ulint | mtr_set_savepoint (mtr_t *mtr) |
UNIV_INLINE void | mtr_release_s_latch_at_savepoint (mtr_t *mtr, ulint savepoint, rw_lock_t *lock) |
UNIV_INLINE ulint | mtr_get_log_mode (mtr_t *mtr) |
UNIV_INLINE ulint | mtr_set_log_mode (mtr_t *mtr, ulint mode) |
UNIV_INTERN ulint | mtr_read_ulint (const byte *ptr, ulint type, mtr_t *mtr) |
UNIV_INLINE void | mtr_s_lock_func (rw_lock_t *lock, const char *file, ulint line, mtr_t *mtr) |
UNIV_INLINE void | mtr_x_lock_func (rw_lock_t *lock, const char *file, ulint line, mtr_t *mtr) |
UNIV_INTERN bool | mtr_memo_release (mtr_t *mtr, void *object, ulint type) __attribute__((nonnull)) |
UNIV_INLINE dyn_array_t * | mtr_get_log (mtr_t *mtr) |
UNIV_INLINE void | mtr_memo_push (mtr_t *mtr, void *object, ulint type) |
#define MLOG_BIGGEST_TYPE ((byte)53) |
#define MLOG_COMP_LIST_END_COPY_CREATED ((byte)45) |
#define MLOG_COMP_LIST_END_DELETE ((byte)43) |
#define MLOG_COMP_LIST_START_DELETE ((byte)44) |
#define MLOG_COMP_PAGE_CREATE ((byte)37) |
#define MLOG_COMP_PAGE_REORGANIZE ((byte)46) |
#define MLOG_COMP_REC_CLUST_DELETE_MARK ((byte)39) |
#define MLOG_COMP_REC_DELETE ((byte)42) |
#define MLOG_COMP_REC_INSERT ((byte)38) |
#define MLOG_COMP_REC_MIN_MARK ((byte)36) |
#define MLOG_COMP_REC_SEC_DELETE_MARK ((byte)40) |
#define MLOG_COMP_REC_UPDATE_IN_PLACE ((byte)41) |
#define MLOG_DUMMY_RECORD ((byte)32) |
#define MLOG_FILE_CREATE ((byte)33) |
#define MLOG_FILE_CREATE2 ((byte)47) |
#define MLOG_FILE_DELETE ((byte)35) |
#define MLOG_FILE_FLAG_TEMP 1 |
#define MLOG_FILE_RENAME ((byte)34) |
#define MLOG_IBUF_BITMAP_INIT ((byte)27) |
#define MLOG_INIT_FILE_PAGE ((byte)29) |
#define MLOG_LIST_END_COPY_CREATED ((byte)17) |
#define MLOG_LIST_END_DELETE ((byte)15) |
#define MLOG_LIST_START_DELETE ((byte)16) |
#define MLOG_MULTI_REC_END ((byte)31) |
#define MLOG_PAGE_REORGANIZE ((byte)18) |
#define MLOG_REC_CLUST_DELETE_MARK ((byte)10) |
#define MLOG_REC_DELETE ((byte)14) |
#define MLOG_REC_MIN_MARK ((byte)26) |
#define MLOG_REC_SEC_DELETE_MARK ((byte)11) |
#define MLOG_REC_UPDATE_IN_PLACE ((byte)13) |
#define MLOG_SINGLE_REC_FLAG 128 |
#define MLOG_UNDO_ERASE_END ((byte)21) |
#define MLOG_UNDO_HDR_CREATE ((byte)25) |
#define MLOG_UNDO_HDR_DISCARD ((byte)23) |
#define MLOG_UNDO_HDR_REUSE ((byte)24) |
#define MLOG_UNDO_INIT ((byte)22) |
#define MLOG_UNDO_INSERT ((byte)20) |
#define MLOG_WRITE_STRING ((byte)30) |
#define MLOG_ZIP_PAGE_COMPRESS ((byte)51) |
#define MLOG_ZIP_PAGE_COMPRESS_NO_DATA ((byte)52) |
#define MLOG_ZIP_PAGE_REORGANIZE ((byte)53) |
#define MLOG_ZIP_WRITE_BLOB_PTR ((byte)49) |
#define MLOG_ZIP_WRITE_HEADER ((byte)50) |
#define MLOG_ZIP_WRITE_NODE_PTR ((byte)48) |
#define MTR_LOG_ALL |
#define MTR_LOG_SHORT_INSERTS |
#define mtr_s_lock | ( | B, | |
MTR | |||
) |
This macro locks an rw-lock in s-mode.
#define mtr_x_lock | ( | B, | |
MTR | |||
) |
This macro locks an rw-lock in x-mode.
UNIV_INTERN void mtr_commit | ( | mtr_t * | mtr | ) |
Commits a mini-transaction.
mtr | in: mini-transaction |
Definition at line 305 of file mtr0mtr.cc.
UNIV_INLINE dyn_array_t* mtr_get_log | ( | mtr_t * | mtr | ) |
Returns the log object of a mini-transaction buffer.
UNIV_INLINE ulint mtr_get_log_mode | ( | mtr_t * | mtr | ) |
Gets the logging mode of a mini-transaction.
UNIV_INLINE void mtr_memo_push | ( | mtr_t * | mtr, |
void * | object, | ||
ulint | type | ||
) |
Pushes an object to an mtr memo stack. in: object type: MTR_MEMO_S_LOCK, ...
mtr | in: mtr |
object | in: object |
UNIV_INTERN bool mtr_memo_release | ( | mtr_t * | mtr, |
void * | object, | ||
ulint | type | ||
) |
Releases an object in the memo stack.
mtr | in/out: mini-transaction |
object | in: object |
type | in: object type: MTR_MEMO_S_LOCK, ... |
Definition at line 349 of file mtr0mtr.cc.
UNIV_INTERN ulint mtr_read_ulint | ( | const byte * | ptr, |
ulint | type, | ||
mtr_t * | mtr | ||
) |
Reads 1 - 4 bytes from a file page buffered in the buffer pool.
ptr | in: pointer from where to read |
type | in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES |
UNIV_INLINE void mtr_release_s_latch_at_savepoint | ( | mtr_t * | mtr, |
ulint | savepoint, | ||
rw_lock_t * | lock | ||
) |
Releases the (index tree) s-latch stored in an mtr memo after a savepoint. in: latch to release
mtr | in: mtr |
savepoint | in: savepoint |
NOTE! Use the macro above! Locks a lock in s-mode. in: mtr
lock | in: rw-lock |
file | in: file name |
line | in: line number |
UNIV_INLINE ulint mtr_set_log_mode | ( | mtr_t * | mtr, |
ulint | mode | ||
) |
Changes the logging mode of a mini-transaction.
mtr | in: mtr |
UNIV_INLINE ulint mtr_set_savepoint | ( | mtr_t * | mtr | ) |
Sets and returns a savepoint in mtr.
UNIV_INLINE void mtr_start | ( | mtr_t * | mtr | ) |
Starts a mini-transaction.
mtr | out: mini-transaction |