MySQL 9.1.0
Source Code Documentation
|
Mini-transaction buffer. More...
#include <stddef.h>
#include "univ.i"
#include "buf0types.h"
#include "dyn0buf.h"
#include "fil0fil.h"
#include "mtr0types.h"
#include "srv0srv.h"
#include "trx0types.h"
#include "mtr0mtr.ic"
Go to the source code of this file.
Classes | |
struct | mtr_memo_slot_t |
Mini-transaction memo stack slot. More... | |
struct | mtr_t |
Mini-transaction handle and buffer. More... | |
struct | mtr_t::Impl |
State variables of the mtr. More... | |
class | mtr_t::Logging |
mtr global logging More... | |
Macros | |
#define | mtr_start(m) (m)->start() |
Start a mini-transaction. More... | |
#define | mtr_start_sync(m) (m)->start(true) |
Start a synchronous mini-transaction. More... | |
#define | mtr_start_ro(m) (m)->start(true, true) |
Start an asynchronous read-only mini-transaction. More... | |
#define | mtr_commit(m) (m)->commit() |
Commit a mini-transaction. More... | |
#define | mtr_set_savepoint(m) (m)->get_savepoint() |
Set and return a savepoint in mtr. More... | |
#define | mtr_release_s_latch_at_savepoint(m, s, l) (m)->release_s_latch_at_savepoint((s), (l)) |
Release the (index tree) s-latch stored in an mtr memo after a savepoint. More... | |
#define | mtr_get_log_mode(m) (m)->get_log_mode() |
Get the logging mode of a mini-transaction. More... | |
#define | mtr_set_log_mode(m, d) (m)->set_log_mode((d)) |
Change the logging mode of a mini-transaction. More... | |
#define | mtr_get_flush_observer(m) (m)->get_flush_observer() |
Get the flush observer of a mini-transaction. More... | |
#define | mtr_set_flush_observer(m, d) (m)->set_flush_observer((d)) |
Set the flush observer of a mini-transaction. More... | |
#define | mtr_read_ulint(p, t, m) (m)->read_ulint((p), (t)) |
Read 1 - 4 bytes from a file page buffered in the buffer pool. More... | |
#define | mtr_memo_release(m, o, t) (m)->memo_release((o), (t)) |
Release an object in the memo stack. More... | |
#define | mtr_is_block_fix(m, o, t, table) (mtr_memo_contains(m, o, t) || table->is_intrinsic()) |
Check if memo contains the given item ignore if table is intrinsic. More... | |
#define | mtr_is_page_fix(m, p, t, table) (mtr_memo_contains_page(m, p, t) || table->is_intrinsic()) |
Check if memo contains the given page ignore if table is intrinsic. More... | |
#define | mtr_memo_contains(m, o, t) (m)->memo_contains((m)->get_memo(), (o), (t)) |
Check if memo contains the given item. More... | |
#define | mtr_memo_contains_page(m, p, t) (m)->memo_contains_page_flagged((p), (t)) |
Check if memo contains the given page. More... | |
#define | mtr_print(m) (m)->print() |
Print info of an mtr handle. More... | |
#define | mtr_get_log(m) (m)->get_log() |
Return the log object of a mini-transaction buffer. More... | |
#define | mtr_memo_push(m, o, t) (m)->memo_push(o, t) |
Push an object to an mtr memo stack. More... | |
#define | mtr_s_lock(l, m, loc) (m)->s_lock((l), loc) |
Lock an rw-lock in s-mode. More... | |
#define | mtr_x_lock(l, m, loc) (m)->x_lock((l), loc) |
Lock an rw-lock in x-mode. More... | |
#define | mtr_x_lock_space(s, m) (m)->x_lock_space((s), UT_LOCATION_HERE) |
Lock a tablespace in x-mode. More... | |
#define | mtr_sx_lock(l, m, loc) (m)->sx_lock((l), loc) |
Lock an rw-lock in sx-mode. More... | |
#define | mtr_memo_contains_flagged(m, p, l) (m)->memo_contains_flagged((p), (l)) |
#define | mtr_memo_contains_page_flagged(m, p, l) (m)->memo_contains_page_flagged((p), (l)) |
#define | mtr_release_block_at_savepoint(m, s, b) (m)->release_block_at_savepoint((s), (b)) |
#define | mtr_block_sx_latch_at_savepoint(m, s, b) (m)->sx_latch_at_savepoint((s), (b)) |
#define | mtr_block_x_latch_at_savepoint(m, s, b) (m)->x_latch_at_savepoint((s), (b)) |
Functions | |
std::ostream & | operator<< (std::ostream &out, const mtr_memo_slot_t &obj) |
lsn_t | mtr_commit_mlog_test (size_t payload=0) |
Reserves space in the log buffer and writes a single MLOG_TEST. More... | |
void | mtr_commit_mlog_test_filling_block (log_t &log, size_t space_left=0) |
Reserves space in the log buffer and writes a single MLOG_TEST. More... | |
Mini-transaction buffer.
Created 11/26/1995 Heikki Tuuri
#define mtr_block_sx_latch_at_savepoint | ( | m, | |
s, | |||
b | |||
) | (m)->sx_latch_at_savepoint((s), (b)) |
#define mtr_block_x_latch_at_savepoint | ( | m, | |
s, | |||
b | |||
) | (m)->x_latch_at_savepoint((s), (b)) |
#define mtr_commit | ( | m | ) | (m)->commit() |
Commit a mini-transaction.
#define mtr_get_flush_observer | ( | m | ) | (m)->get_flush_observer() |
Get the flush observer of a mini-transaction.
#define mtr_get_log | ( | m | ) | (m)->get_log() |
Return the log object of a mini-transaction buffer.
#define mtr_get_log_mode | ( | m | ) | (m)->get_log_mode() |
Get the logging mode of a mini-transaction.
#define mtr_is_block_fix | ( | m, | |
o, | |||
t, | |||
table | |||
) | (mtr_memo_contains(m, o, t) || table->is_intrinsic()) |
Check if memo contains the given item ignore if table is intrinsic.
#define mtr_is_page_fix | ( | m, | |
p, | |||
t, | |||
table | |||
) | (mtr_memo_contains_page(m, p, t) || table->is_intrinsic()) |
Check if memo contains the given page ignore if table is intrinsic.
#define mtr_memo_contains | ( | m, | |
o, | |||
t | |||
) | (m)->memo_contains((m)->get_memo(), (o), (t)) |
Check if memo contains the given item.
Check if memo contains the given page.
#define mtr_memo_push | ( | m, | |
o, | |||
t | |||
) | (m)->memo_push(o, t) |
Push an object to an mtr memo stack.
#define mtr_memo_release | ( | m, | |
o, | |||
t | |||
) | (m)->memo_release((o), (t)) |
Release an object in the memo stack.
#define mtr_print | ( | m | ) | (m)->print() |
Print info of an mtr handle.
Read 1 - 4 bytes from a file page buffered in the buffer pool.
#define mtr_release_block_at_savepoint | ( | m, | |
s, | |||
b | |||
) | (m)->release_block_at_savepoint((s), (b)) |
#define mtr_release_s_latch_at_savepoint | ( | m, | |
s, | |||
l | |||
) | (m)->release_s_latch_at_savepoint((s), (l)) |
Release the (index tree) s-latch stored in an mtr memo after a savepoint.
#define mtr_s_lock | ( | l, | |
m, | |||
loc | |||
) | (m)->s_lock((l), loc) |
Lock an rw-lock in s-mode.
#define mtr_set_flush_observer | ( | m, | |
d | |||
) | (m)->set_flush_observer((d)) |
Set the flush observer of a mini-transaction.
#define mtr_set_log_mode | ( | m, | |
d | |||
) | (m)->set_log_mode((d)) |
Change the logging mode of a mini-transaction.
#define mtr_set_savepoint | ( | m | ) | (m)->get_savepoint() |
Set and return a savepoint in mtr.
#define mtr_start | ( | m | ) | (m)->start() |
Start a mini-transaction.
#define mtr_start_ro | ( | m | ) | (m)->start(true, true) |
Start an asynchronous read-only mini-transaction.
#define mtr_start_sync | ( | m | ) | (m)->start(true) |
Start a synchronous mini-transaction.
#define mtr_sx_lock | ( | l, | |
m, | |||
loc | |||
) | (m)->sx_lock((l), loc) |
Lock an rw-lock in sx-mode.
#define mtr_x_lock | ( | l, | |
m, | |||
loc | |||
) | (m)->x_lock((l), loc) |
Lock an rw-lock in x-mode.
#define mtr_x_lock_space | ( | s, | |
m | |||
) | (m)->x_lock_space((s), UT_LOCATION_HERE) |
Lock a tablespace in x-mode.
lsn_t mtr_commit_mlog_test | ( | size_t | payload = 0 | ) |
Reserves space in the log buffer and writes a single MLOG_TEST.
[in] | payload | number of extra bytes within the record, not greater than 1024 |
void mtr_commit_mlog_test_filling_block | ( | log_t & | log, |
size_t | space_left = 0 |
||
) |
Reserves space in the log buffer and writes a single MLOG_TEST.
Adjusts size of the payload in the record, in order to fill the current block up to its boundary. If nothing else is happening in parallel, we could expect to see afterwards: (cur_lsn + space_left) % OS_FILE_LOG_BLOCK_SIZE == LOG_BLOCK_HDR_SIZE, where cur_lsn = log_get_lsn(log).
[in,out] | log | redo log |
[in] | space_left | extra bytes left to the boundary of block, must be not greater than 496 |
|
inline |