34#ifndef MYSQL_BINLOG_EVENT_STATEMENT_EVENTS_H
35#define MYSQL_BINLOG_EVENT_STATEMENT_EVENTS_H
654 Query_event(
const char *query_arg,
const char *catalog_arg,
655 const char *db_arg, uint32_t query_length,
656 unsigned long thread_id_arg,
unsigned long long sql_mode_arg,
657 unsigned long auto_increment_increment_arg,
658 unsigned long auto_increment_offset_arg,
unsigned int number,
659 unsigned long long table_map_for_update_arg,
int errcode);
695 void print_event_info(std::ostream &info)
override;
696 void print_long_info(std::ostream &info)
override;
712 if (buf_current < buf_start ||
713 buf_len <
static_cast<T
>(buf_current - buf_start))
714 return static_cast<T
>(0);
716 return static_cast<T
>(buf_len - (buf_current - buf_start));
821 unsigned long val_len_arg,
Value_type type_arg,
822 unsigned int charset_number_arg,
unsigned char flags_arg)
862 void print_event_info(std::ostream &info)
override;
863 void print_long_info(std::ostream &info)
override;
864 const char *get_value_type_string(
Value_type type_arg)
const {
953 return "INVALID_INT";
955 return "LAST_INSERT_ID";
990 void print_event_info(std::ostream &info)
override;
991 void print_long_info(std::ostream &info)
override;
1043 Rand_event(
unsigned long long seed1_arg,
unsigned long long seed2_arg)
1067 void print_event_info(std::ostream &info)
override;
1068 void print_long_info(std::ostream &info)
override;
This is the abstract base class for binary log events.
Definition: binlog_event.h:851
@ QUERY_HEADER_LEN
Definition: binlog_event.h:868
An Intvar_event will be created just before a Query_event, if the query uses one of the variables LAS...
Definition: statement_events.h:921
Intvar_event(const char *buf, const Format_description_event *fde)
Constructor receives a packet from the MySQL master or the binary log and decodes it to create an Int...
Definition: statement_events.cpp:483
uint64_t val
Definition: statement_events.h:924
std::string get_var_type_string() const
This method returns the string representing the type of the variable used in the event.
Definition: statement_events.h:950
Intvar_event(uint8_t type_arg, uint64_t val_arg)
The minimal constructor for Intvar_event it initializes the instance variables type & val and set the...
Definition: statement_events.h:984
Int_event_type
Definition: statement_events.h:932
@ LAST_INSERT_ID_EVENT
Definition: statement_events.h:934
@ INVALID_INT_EVENT
Definition: statement_events.h:933
@ INSERT_ID_EVENT
Definition: statement_events.h:935
uint8_t type
Definition: statement_events.h:923
Intvar_event_offset
moving from pre processor symbols from global scope in log_event.h to an enum inside the class,...
Definition: statement_events.h:943
@ I_TYPE_OFFSET
Definition: statement_events.h:943
@ I_VAL_OFFSET
Definition: statement_events.h:943
~Intvar_event() override=default
A Query_event is created for each query that modifies the database, unless the query is logged row-ba...
Definition: statement_events.h:451
uint16_t error_code
Definition: statement_events.h:560
size_t host_len
Definition: statement_events.h:543
uint8_t default_table_encryption
Definition: statement_events.h:648
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.
Definition: statement_events.cpp:53
const char * host
Definition: statement_events.h:542
~Query_event() override=default
uint64_t table_map_for_update
Definition: statement_events.h:621
uint16_t auto_increment_increment
Definition: statement_events.h:607
const char * db
Definition: statement_events.h:535
const char * user
Definition: statement_events.h:540
uint64_t sql_mode
Definition: statement_events.h:606
const char * query
Definition: statement_events.h:534
char charset[6]
Definition: statement_events.h:608
uint64_t ddl_xid
Definition: statement_events.h:643
enum mysql::binlog::event::Query_event::enum_ternary explicit_defaults_ts
bool charset_inited
Definition: statement_events.h:602
unsigned char mts_accessed_dbs
Definition: statement_events.h:640
const char * catalog
Definition: statement_events.h:536
uint16_t default_collation_for_utf8mb4_number
Definition: statement_events.h:645
size_t db_len
Definition: statement_events.h:559
const char * time_zone_str
Definition: statement_events.h:537
bool sql_mode_inited
Definition: statement_events.h:601
enum_ternary
Definition: statement_events.h:631
@ TERNARY_OFF
Definition: statement_events.h:633
@ TERNARY_UNSET
Definition: statement_events.h:632
@ TERNARY_ON
Definition: statement_events.h:634
char mts_accessed_db_names[MAX_DBS_IN_EVENT_MTS][NAME_LEN]
Definition: statement_events.h:641
int fill_data_buf(unsigned char *dest, unsigned long len)
Layout for the data buffer is as follows.
Definition: statement_events.cpp:366
uint8_t sql_require_primary_key
Definition: statement_events.h:646
uint32_t flags2
Definition: statement_events.h:604
size_t catalog_len
Definition: statement_events.h:614
Query_event_status_vars
Definition: statement_events.h:464
@ Q_COMMIT_TS2
Definition: statement_events.h:506
@ Q_LC_TIME_NAMES_CODE
Definition: statement_events.h:485
@ Q_COMMIT_TS
Definition: statement_events.h:501
@ Q_CHARSET_CODE
Definition: statement_events.h:474
@ Q_CHARSET_DATABASE_CODE
Definition: statement_events.h:486
@ Q_UPDATED_DB_NAMES
Definition: statement_events.h:496
@ Q_CATALOG_NZ_CODE
Definition: statement_events.h:484
@ Q_TABLE_MAP_FOR_UPDATE_CODE
Definition: statement_events.h:487
@ Q_MICROSECONDS
Definition: statement_events.h:497
@ Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP
Definition: statement_events.h:513
@ Q_DDL_LOGGED_WITH_XID
Definition: statement_events.h:517
@ Q_INVOKER
Definition: statement_events.h:490
@ Q_DEFAULT_TABLE_ENCRYPTION
Definition: statement_events.h:532
@ Q_SQL_REQUIRE_PRIMARY_KEY
Definition: statement_events.h:527
@ Q_FLAGS2_CODE
Definition: statement_events.h:465
@ Q_SQL_MODE_CODE
Definition: statement_events.h:466
@ Q_AUTO_INCREMENT
Definition: statement_events.h:473
@ Q_TIME_ZONE_CODE
Definition: statement_events.h:475
@ Q_MASTER_DATA_WRITTEN_CODE
Definition: statement_events.h:489
@ Q_CATALOG_CODE
Definition: statement_events.h:472
@ Q_DEFAULT_COLLATION_FOR_UTF8MB4
Definition: statement_events.h:522
uint32_t query_exec_time
Definition: statement_events.h:558
unsigned long data_len
Definition: statement_events.h:546
uint16_t status_vars_len
Definition: statement_events.h:581
size_t user_len
Definition: statement_events.h:541
uint16_t auto_increment_offset
Definition: statement_events.h:607
uint16_t charset_database_number
Definition: statement_events.h:616
uint32_t thread_id
Definition: statement_events.h:557
uint16_t lc_time_names_number
Definition: statement_events.h:615
bool flags2_inited
Definition: statement_events.h:600
Query_event_post_header_offset
query event post-header
Definition: statement_events.h:454
@ Q_DATA_OFFSET
Definition: statement_events.h:460
@ Q_EXEC_TIME_OFFSET
Definition: statement_events.h:456
@ Q_STATUS_VARS_LEN_OFFSET
Definition: statement_events.h:459
@ Q_THREAD_ID_OFFSET
Definition: statement_events.h:455
@ Q_ERR_CODE_OFFSET
Definition: statement_events.h:458
@ Q_DB_LEN_OFFSET
Definition: statement_events.h:457
size_t time_zone_len
Definition: statement_events.h:609
size_t q_len
Definition: statement_events.h:587
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0.
Definition: statement_events.h:1033
Rand_event(unsigned long long seed1_arg, unsigned long long seed2_arg)
Definition: statement_events.h:1043
unsigned long long seed1
Definition: statement_events.h:1035
unsigned long long seed2
Definition: statement_events.h:1036
Rand_event_data
Definition: statement_events.h:1037
@ RAND_SEED2_OFFSET
Definition: statement_events.h:1037
@ RAND_SEED1_OFFSET
Definition: statement_events.h:1037
Written every time a statement uses a user variable; precedes other events for the statement.
Definition: statement_events.h:804
const char * name
Definition: statement_events.h:853
uint32_t val_len
Definition: statement_events.h:856
@ UNSIGNED_F
Definition: statement_events.h:807
@ UNDEF_F
Definition: statement_events.h:807
Value_type type
Definition: statement_events.h:857
char * val
Definition: statement_events.h:855
bool is_null
Definition: statement_events.h:859
unsigned int charset_number
Definition: statement_events.h:858
User_var_event_data
Definition: statement_events.h:808
@ UV_VAL_LEN_SIZE
Definition: statement_events.h:809
@ UV_VAL_IS_NULL
Definition: statement_events.h:810
@ UV_CHARSET_NUMBER_SIZE
Definition: statement_events.h:813
@ UV_VAL_TYPE_SIZE
Definition: statement_events.h:811
@ UV_NAME_LEN_SIZE
Definition: statement_events.h:812
~User_var_event() override
Definition: statement_events.cpp:467
User_var_event(const char *name_arg, unsigned int name_len_arg, char *val_arg, unsigned long val_len_arg, Value_type type_arg, unsigned int charset_number_arg, unsigned char flags_arg)
This constructor will initialize the instance variables and the type_code, it will be used only by th...
Definition: statement_events.h:820
unsigned char flags
Definition: statement_events.h:860
unsigned int name_len
Definition: statement_events.h:854
Contains the classes representing events operating in the replication stream properties.
#define MAX_DBS_IN_EVENT_MTS
The maximum number of updated databases that a status of Query-log-event can carry.
Definition: binlog_event.h:109
#define NAME_LEN
Definition: mysql_com.h:67
Definition: buf0block_hint.cc:30
The namespace contains classes representing events that can occur in a replication stream.
Definition: binlog_event.cpp:38
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:278
@ QUERY_EVENT
Definition: binlog_event.h:292
@ RAND_EVENT
Definition: binlog_event.h:302
@ INTVAR_EVENT
Definition: binlog_event.h:295
@ USER_VAR_EVENT
Definition: binlog_event.h:303
T available_buffer(const char *buf_start, const char *buf_current, T buf_len)
Definition: statement_events.h:710
bool valid_buffer_range(T jump, const char *buf_start, const char *buf_current, T buf_len)
Check if jump value is within buffer limits.
Definition: statement_events.h:731
const uint64_t INVALID_XID
The following constant represents the maximum of MYSQL_XID domain.
Definition: statement_events.h:49
const char * bapi_strndup(const char *destination, size_t n)
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input s...
Definition: wrapper_functions.h:150
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:41
@ DECIMAL_RESULT
not valid for UDFs
Definition: udf_registration_types.h:45
@ REAL_RESULT
char *
Definition: udf_registration_types.h:42
@ INT_RESULT
double
Definition: udf_registration_types.h:43
@ ROW_RESULT
long long
Definition: udf_registration_types.h:44