![]() |
MySQL 9.1.0
Source Code Documentation
|
This is the subclass of Transaction_context_event and Log_event This class encodes the transaction_context_log_event. More...
#include <log_event.h>
Public Member Functions | |
Transaction_context_log_event (const char *server_uuid_arg, bool using_trans, my_thread_id thread_id_arg, bool is_gtid_specified) | |
Transaction_context_log_event (const char *buffer, const mysql::binlog::event::Format_description_event *descr_event) | |
~Transaction_context_log_event () override | |
void | claim_memory_ownership (bool claim) override |
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed. More... | |
size_t | get_data_size () override |
size_t | get_event_length () |
int | pack_info (Protocol *protocol) override |
Stores a string representation of this event in the Protocol. More... | |
int | do_apply_event (Relay_log_info const *) override |
Primitive to apply an event to the database. More... | |
int | do_update_pos (Relay_log_info *rli) override |
Advance relay log coordinates. More... | |
void | add_write_set (const char *hash) |
Add a hash which identifies a inserted/updated/deleted row on the ongoing transaction. More... | |
std::list< const char * > * | get_write_set () |
Return a pointer to write-set list. More... | |
void | add_read_set (const char *hash) |
Add a hash which identifies a read row on the ongoing transaction. More... | |
std::list< const char * > * | get_read_set () |
Return a pointer to read-set list. More... | |
bool | read_snapshot_version () |
Read snapshot version from encoded buffers. More... | |
Gtid_set * | get_snapshot_version () |
Return the transaction snapshot timestamp. More... | |
const char * | get_server_uuid () |
Return the server uuid. More... | |
my_thread_id | get_thread_id () const |
Return the id of the committing thread. More... | |
bool | is_gtid_specified () const |
Return true if transaction has GTID fully specified, false otherwise. More... | |
![]() | |
Transaction_context_event (const char *buf, const Format_description_event *fde) | |
Decodes the transaction_context_log_event of the ongoing transaction. More... | |
Transaction_context_event (unsigned int thread_id_arg, bool is_gtid_specified) | |
~Transaction_context_event () override | |
Destructor of the Transaction_context_event class. More... | |
![]() | |
virtual | ~Binary_log_event ()=0 |
Binary_log_event (const Binary_log_event &)=default | |
Binary_log_event (Binary_log_event &&)=default | |
Binary_log_event & | operator= (const Binary_log_event &)=default |
Binary_log_event & | operator= (Binary_log_event &&)=default |
enum Log_event_type | get_event_type () const |
Helper method. More... | |
const Log_event_header * | header () const |
Return a const pointer to the header of the log event. More... | |
Log_event_header * | header () |
Return a non-const pointer to the header of the log event. More... | |
const Log_event_footer * | footer () const |
Return a const pointer to the footer of the log event. More... | |
Log_event_footer * | footer () |
Return a non-const pointer to the footer of the log event. More... | |
Event_reader & | reader () |
Returns a reference to the event Event_reader object. More... | |
![]() | |
Log_event (mysql::binlog::event::Log_event_header *header, mysql::binlog::event::Log_event_footer *footer, enum_event_cache_type cache_type_arg, enum_event_logging_type logging_type_arg) | |
This minimal constructor is for when you are not even sure that there is a valid THD. More... | |
Log_event (THD *thd_arg, uint16 flags_arg, enum_event_cache_type cache_type_arg, enum_event_logging_type logging_type_arg, mysql::binlog::event::Log_event_header *header, mysql::binlog::event::Log_event_footer *footer) | |
int | net_send (Protocol *protocol, const char *log_name, my_off_t pos) |
Only called by SHOW BINLOG EVENTS. More... | |
virtual const char * | get_db () |
void * | operator new (size_t size) |
bool | wrapper_my_b_safe_write (Basic_ostream *ostream, const uchar *buf, size_t data_length) |
Write the given buffer to the given output stream, updating the checksum if checksums are enabled. More... | |
virtual bool | write (Basic_ostream *ostream) |
time_t | get_time () |
Prints a "session_var=value" string. More... | |
virtual mysql::binlog::event::Log_event_type | get_type_code () const |
virtual bool | is_sbr_logging_format () const |
Return true if the event has to be logged using SBR for DMLs. More... | |
virtual bool | is_rbr_logging_format () const |
Return true if the event has to be logged using RBR for DMLs. More... | |
bool | is_valid () |
void | set_artificial_event () |
void | set_relay_log_event () |
bool | is_artificial_event () const |
bool | is_relay_log_event () const |
bool | is_ignorable_event () const |
bool | is_no_filter_event () const |
bool | is_using_trans_cache () const |
bool | is_using_stmt_cache () const |
bool | is_using_immediate_logging () const |
Log_event (mysql::binlog::event::Log_event_header *header, mysql::binlog::event::Log_event_footer *footer) | |
virtual | ~Log_event () |
void | register_temp_buf (char *buf, bool free_in_destructor=true) |
void | free_temp_buf () |
const char * | get_type_str () const |
Returns the human readable name of this event's type. More... | |
bool | is_mts_sequential_exec () const |
Is called from get_mts_execution_mode() to. More... | |
virtual uint8 | get_mts_dbs (Mts_db_names *arg, Rpl_filter *rpl_filter) |
The method fills in pointers to event's database name c-strings to a supplied array. More... | |
bool | contains_partition_info (bool) |
virtual uint8 | mts_number_dbs () |
bool | is_mts_group_isolated () |
virtual bool | starts_group () const |
Events of a certain type can start or end a group of events treated transactionally wrt binlog. More... | |
virtual bool | ends_group () const |
int | apply_event (Relay_log_info *rli) |
Apply the event to the database. More... | |
int | apply_gtid_event (Relay_log_info *rli) |
Apply the GTID event in curr_group_data to the database. More... | |
int | update_pos (Relay_log_info *rli) |
Update the relay log position. More... | |
enum_skip_reason | shall_skip (Relay_log_info *rli) |
Decide if the event shall be skipped, and the reason for skipping it. More... | |
virtual int | do_apply_event_worker (Slave_worker *w) |
Private Member Functions | |
bool | write_data_header (Basic_ostream *ostream) override |
bool | write_data_body (Basic_ostream *ostream) override |
bool | write_snapshot_version (Basic_ostream *ostream) |
bool | write_data_set (Basic_ostream *ostream, std::list< const char * > *set) |
size_t | get_snapshot_version_size () |
size_t | to_string (char *buf, ulong len) const |
Static Private Member Functions | |
static int | get_data_set_size (std::list< const char * > *set) |
Private Attributes | |
Tsid_map * | tsid_map |
The Tsid_map to use for creating the Gtid_set. More... | |
Gtid_set * | snapshot_version |
A gtid_set which is used to store the transaction set used for conflict detection. More... | |
Additional Inherited Members | |
![]() | |
enum | enum_post_header_length { QUERY_HEADER_MINIMAL_LEN = (4 + 4 + 1 + 2) , QUERY_HEADER_LEN = (QUERY_HEADER_MINIMAL_LEN + 2) , STOP_HEADER_LEN = 0 , START_V3_HEADER_LEN = (2 + ST_SERVER_VER_LEN + 4) , ROTATE_HEADER_LEN = 8 , INTVAR_HEADER_LEN = 0 , APPEND_BLOCK_HEADER_LEN = 4 , DELETE_FILE_HEADER_LEN = 4 , RAND_HEADER_LEN = 0 , USER_VAR_HEADER_LEN = 0 , FORMAT_DESCRIPTION_HEADER_LEN = (START_V3_HEADER_LEN + 1 + LOG_EVENT_TYPES) , XID_HEADER_LEN = 0 , BEGIN_LOAD_QUERY_HEADER_LEN = APPEND_BLOCK_HEADER_LEN , ROWS_HEADER_LEN_V1 = 8 , TABLE_MAP_HEADER_LEN = 8 , EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN = (4 + 4 + 4 + 1) , EXECUTE_LOAD_QUERY_HEADER_LEN , INCIDENT_HEADER_LEN = 2 , HEARTBEAT_HEADER_LEN = 0 , IGNORABLE_HEADER_LEN = 0 , ROWS_HEADER_LEN_V2 = 10 , TRANSACTION_CONTEXT_HEADER_LEN = 18 , VIEW_CHANGE_HEADER_LEN = 52 , XA_PREPARE_HEADER_LEN = 0 , TRANSACTION_PAYLOAD_HEADER_LEN = 0 } |
The lengths for the fixed data part of each event. More... | |
![]() | |
enum | enum_skip_reason { EVENT_SKIP_NOT , EVENT_SKIP_IGNORE , EVENT_SKIP_COUNT } |
Enumeration of what kinds of skipping (and non-skipping) that can occur when the slave executes an event. More... | |
enum | enum_mts_event_exec_mode { EVENT_EXEC_PARALLEL , EVENT_EXEC_ASYNC , EVENT_EXEC_SYNC , EVENT_EXEC_CAN_NOT } |
![]() | |
static const char * | read_data_set (const char *pos, uint32_t set_len, std::list< const char * > *set, uint32_t remaining_buffer) |
static void | clear_set (std::list< const char * > *set) |
Function to clear the memory of the write_set and the read_set. More... | |
![]() | |
static void | init_show_field_list (mem_root_deque< Item * > *field_list) |
init_show_field_list() prepares the column names and types for the output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG EVENTS. More... | |
static void | operator delete (void *ptr, size_t) |
static void * | operator new (size_t, void *ptr) |
static void | operator delete (void *, void *) |
static const char * | get_type_str (mysql::binlog::event::Log_event_type type) |
Returns the human readable name of the given event type. More... | |
static const char * | get_type_str (uint type) |
Get the name of an event type, or "Unknown" if out of range. More... | |
static bool | is_mts_sequential_exec (mysql::binlog::event::Log_event_type type_code) |
static enum enum_mts_event_exec_mode | get_mts_execution_mode (bool mts_in_group, mysql::binlog::event::Log_event_type type_code, uint32 server_id, uint32 log_pos) |
![]() | |
char * | temp_buf |
bool | m_free_temp_buf_in_destructor |
ulong | exec_time |
uint32 | server_id |
ulong | rbr_exec_mode |
A storage to cache the global system variable's value. More... | |
enum_event_cache_type | event_cache_type |
Defines the type of the cache, if any, where the event will be stored before being flushed to disk. More... | |
enum_event_logging_type | event_logging_type |
Defines when information, i.e. More... | |
ha_checksum | crc |
Placeholder for event checksum while writing to binlog. More... | |
ulong | mts_group_idx |
Index in rli->gaq array to indicate a group that this event is purging. More... | |
mysql::binlog::event::Log_event_header * | common_header |
The Log_event_header class contains the variable present in the common header. More... | |
mysql::binlog::event::Log_event_footer * | common_footer |
The Log_event_footer class contains the variable present in the common footer. More... | |
Relay_log_info * | worker |
MTS: associating the event with either an assigned Worker or Coordinator. More... | |
ulonglong | future_event_relay_log_pos |
A copy of the main rli value stored into event to pass to MTS worker rli. More... | |
THD * | thd |
db_worker_hash_entry * | mts_assigned_partitions [MAX_DBS_IN_EVENT_MTS] |
Partition info associate with event to deliver to MTS event applier. More... | |
![]() | |
static const int | LOG_EVENT_TYPES = (ENUM_END_EVENT - 1) |
![]() | |
enum | enum_event_cache_type { EVENT_INVALID_CACHE = 0 , EVENT_STMT_CACHE , EVENT_TRANSACTIONAL_CACHE , EVENT_NO_CACHE , EVENT_CACHE_COUNT } |
enum | enum_event_logging_type { EVENT_INVALID_LOGGING = 0 , EVENT_NORMAL_LOGGING , EVENT_IMMEDIATE_LOGGING , EVENT_CACHE_LOGGING_COUNT } |
![]() | |
Binary_log_event (Log_event_type type_code) | |
This constructor is used to initialize the type_code of header object m_header. More... | |
Binary_log_event (const char **buf, const Format_description_event *fde) | |
This constructor will create a new object of Log_event_header and initialize the variable m_header, which in turn will be used to initialize Log_event's member common_header. More... | |
![]() | |
uint32 | write_header_to_memory (uchar *buf) |
Writes the common header of this event to the given memory buffer. More... | |
bool | write_header (Basic_ostream *ostream, size_t data_length) |
Writes the common-header of this event to the given output stream and updates the checksum. More... | |
bool | write_footer (Basic_ostream *ostream) |
bool | need_checksum () |
A decider of whether to trigger checksum computation or not. More... | |
enum_skip_reason | continue_group (Relay_log_info *rli) |
Helper function to ignore an event w.r.t. More... | |
virtual enum_skip_reason | do_shall_skip (Relay_log_info *rli) |
Decide if this event shall be skipped or not and the reason for skipping it. More... | |
![]() | |
const char * | server_uuid |
uint32_t | thread_id |
bool | gtid_specified |
const unsigned char * | encoded_snapshot_version |
uint32_t | encoded_snapshot_version_length |
std::list< const char * > | write_set |
std::list< const char * > | read_set |
![]() | |
static const int | ENCODED_SERVER_UUID_LEN_OFFSET = 0 |
static const int | ENCODED_THREAD_ID_OFFSET = 1 |
static const int | ENCODED_GTID_SPECIFIED_OFFSET = 5 |
static const int | ENCODED_SNAPSHOT_VERSION_LEN_OFFSET = 6 |
static const int | ENCODED_WRITE_SET_ITEMS_OFFSET = 10 |
static const int | ENCODED_READ_SET_ITEMS_OFFSET = 14 |
static const int | ENCODED_READ_WRITE_SET_ITEM_LEN = 2 |
static const int | ENCODED_SNAPSHOT_VERSION_LEN = 2 |
This is the subclass of Transaction_context_event and Log_event This class encodes the transaction_context_log_event.
Transaction_context_log_event::Transaction_context_log_event | ( | const char * | server_uuid_arg, |
bool | using_trans, | ||
my_thread_id | thread_id_arg, | ||
bool | is_gtid_specified | ||
) |
Transaction_context_log_event::Transaction_context_log_event | ( | const char * | buffer, |
const mysql::binlog::event::Format_description_event * | descr_event | ||
) |
|
override |
void Transaction_context_log_event::add_read_set | ( | const char * | hash | ) |
Add a hash which identifies a read row on the ongoing transaction.
[in] | hash | row identifier |
void Transaction_context_log_event::add_write_set | ( | const char * | hash | ) |
Add a hash which identifies a inserted/updated/deleted row on the ongoing transaction.
[in] | hash | row identifier |
|
overridevirtual |
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
claim | True - claim ownership of the memory False - disclaim ownership of the memory |
Reimplemented from Log_event.
|
inlineoverridevirtual |
Primitive to apply an event to the database.
This is where the change to the database is made.
rli | Pointer to relay log info structure |
0 | Event applied successfully |
errno | Error code if event application failed |
Reimplemented from Log_event.
|
overridevirtual |
Advance relay log coordinates.
This function is called to advance the relay log coordinates to just after the event. It is essential that both the relay log coordinate and the group log position is updated correctly, since this function is used also for skipping events.
Normally, each implementation of do_update_pos() shall:
rli | Pointer to relay log info structure |
0 | Coordinates changed successfully |
errno | Error code if advancing failed (usually just 1). Observe that handler errors are returned by the do_apply_event() function, and not by this one. |
Reimplemented from Log_event.
|
staticprivate |
|
overridevirtual |
Reimplemented from Log_event.
size_t Transaction_context_log_event::get_event_length | ( | ) |
|
inline |
Return a pointer to read-set list.
|
inline |
Return the server uuid.
|
inline |
Return the transaction snapshot timestamp.
|
private |
|
inline |
Return the id of the committing thread.
|
inline |
Return a pointer to write-set list.
|
inline |
Return true if transaction has GTID fully specified, false otherwise.
|
overridevirtual |
Stores a string representation of this event in the Protocol.
This is used by SHOW BINLOG EVENTS.
0 | success |
nonzero | error |
Reimplemented from Log_event.
bool Transaction_context_log_event::read_snapshot_version | ( | ) |
Read snapshot version from encoded buffers.
Cannot be executed during data read from file (event constructor), since its required locks will collide with the server gtid state initialization procedure.
|
private |
|
overrideprivatevirtual |
Reimplemented from Log_event.
|
overrideprivatevirtual |
Reimplemented from Log_event.
|
private |
|
private |
|
private |
A gtid_set which is used to store the transaction set used for conflict detection.
|
private |
The Tsid_map to use for creating the Gtid_set.