MySQL 9.0.0
Source Code Documentation
|
Event responsible for LOAD DATA execution, it similar to Query_event but before executing the query it substitutes original filename in LOAD DATA query with name of temporary file. More...
#include <load_data_events.h>
Public Member Functions | |
Execute_load_query_event (uint32_t file_id_arg, uint32_t fn_pos_start, uint32_t fn_pos_end, enum_load_dup_handling dup) | |
The constructor is called by MySQL slave, while applying the events. More... | |
Execute_load_query_event (const char *buf, const Format_description_event *fde) | |
The constructor receives a buffer and instantiates a Execute_load_query_event filled in with the data from the buffer. More... | |
~Execute_load_query_event () override=default | |
Public Member Functions inherited from mysql::binlog::event::Query_event | |
Query_event (const char *query_arg, const char *catalog_arg, const char *db_arg, uint32_t query_length, unsigned long thread_id_arg, unsigned long long sql_mode_arg, unsigned long auto_increment_increment_arg, unsigned long auto_increment_offset_arg, unsigned int number, unsigned long long table_map_for_update_arg, int errcode) | |
The constructor will be used while creating a Query_event, to be written to the binary log. More... | |
Query_event (const char *buf, const Format_description_event *fde, Log_event_type event_type) | |
The constructor receives a buffer and instantiates a Query_event filled in with the data from the buffer. More... | |
Query_event (Log_event_type type_arg=QUERY_EVENT) | |
The simplest constructor that could possibly work. More... | |
~Query_event () override=default | |
Public Member Functions inherited from mysql::binlog::event::Binary_log_event | |
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... | |
Additional Inherited Members | |
Static Public Attributes inherited from mysql::binlog::event::Binary_log_event | |
static const int | LOG_EVENT_TYPES = (ENUM_END_EVENT - 1) |
Protected Member Functions inherited from mysql::binlog::event::Query_event | |
int | fill_data_buf (unsigned char *dest, unsigned long len) |
Layout for the data buffer is as follows. More... | |
Protected Member Functions inherited from mysql::binlog::event::Binary_log_event | |
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... | |
Protected Attributes inherited from mysql::binlog::event::Query_event | |
const char * | user |
size_t | user_len |
const char * | host |
size_t | host_len |
unsigned long | data_len |
Event responsible for LOAD DATA execution, it similar to Query_event but before executing the query it substitutes original filename in LOAD DATA query with name of temporary file.
The first 13 bytes of the Post-Header for this event are the same as for Query_event, as is the initial status variable block in the Body.
The additional members of the events are the following:
Name | Format | Description |
---|---|---|
file_id | 4 byte unsigned integer | ID of the temporary file to load |
fn_pos_start | 4 byte unsigned integer | The start position within the statement for filename substitution |
fn_pos_end | 4 byte unsigned integer | The end position within the statement for filename substitution |
dup_handling | enum_load_dup_handling | Represents information on how to handle duplicates: LOAD_DUP_ERROR= 0, LOAD_DUP_IGNORE= 1, LOAD_DUP_REPLACE= 2 |
mysql::binlog::event::Execute_load_query_event::Execute_load_query_event | ( | uint32_t | file_id_arg, |
uint32_t | fn_pos_start, | ||
uint32_t | fn_pos_end, | ||
enum_load_dup_handling | dup | ||
) |
The constructor is called by MySQL slave, while applying the events.
mysql::binlog::event::Execute_load_query_event::Execute_load_query_event | ( | const char * | buf, |
const Format_description_event * | fde | ||
) |
The constructor receives a buffer and instantiates a Execute_load_query_event filled in with the data from the buffer.
The constructor used in order to decode EXECUTE_LOAD_QUERY_EVENT from a packet.
The fixed event data part buffer layout is as follows: +---------------------------------------------------------------------+ | thread_id | query_exec_time | db_len | error_code | status_vars_len | +---------------------------------------------------------------------+ +----------------------------------------------------+ | file_id | fn_pos_start | fn_pos_end | dup_handling | +----------------------------------------------------+
The fixed event data part buffer layout is as follows: +------------------------------------------------------------------+ | Zero or more status variables | db | LOAD DATA INFILE statement | +------------------------------------------------------------------+
buf | Contains the serialized event. |
fde | An FDE event (see Rotate_event constructor for more info). |
It is used on the MySQL server acting as a slave.
|
overridedefault |
enum_load_dup_handling mysql::binlog::event::Execute_load_query_event::dup_handling |
pointer to the end of this part of query
We have to store type of duplicate handling explicitly, because for LOAD DATA it also depends on LOCAL option. And this part of query will be rewritten during replication so this information may be lost...
int32_t mysql::binlog::event::Execute_load_query_event::file_id |
uint32_t mysql::binlog::event::Execute_load_query_event::fn_pos_end |
pointer to the part of the query that should be substituted
uint32_t mysql::binlog::event::Execute_load_query_event::fn_pos_start |
file_id of temporary file