36#ifndef STATEMENT_EVENT_INCLUDED
37#define STATEMENT_EVENT_INCLUDED
653 Query_event(
const char *query_arg,
const char *catalog_arg,
654 const char *db_arg, uint32_t query_length,
655 unsigned long thread_id_arg,
unsigned long long sql_mode_arg,
656 unsigned long auto_increment_increment_arg,
657 unsigned long auto_increment_offset_arg,
unsigned int number,
658 unsigned long long table_map_for_update_arg,
int errcode);
694 void print_event_info(std::ostream &
info)
override;
695 void print_long_info(std::ostream &
info)
override;
711 if (buf_current < buf_start ||
712 buf_len <
static_cast<T
>(buf_current - buf_start))
713 return static_cast<T
>(0);
715 return static_cast<T
>(buf_len - (buf_current - buf_start));
820 unsigned long val_len_arg,
Value_type type_arg,
821 unsigned int charset_number_arg,
unsigned char flags_arg)
861 void print_event_info(std::ostream &
info)
override;
862 void print_long_info(std::ostream &
info)
override;
863 const char *get_value_type_string(
Value_type type_arg)
const {
952 return "INVALID_INT";
954 return "LAST_INSERT_ID";
989 void print_event_info(std::ostream &
info)
override;
990 void print_long_info(std::ostream &
info)
override;
1042 Rand_event(
unsigned long long seed1_arg,
unsigned long long seed2_arg)
1066 void print_event_info(std::ostream &
info)
override;
1067 void print_long_info(std::ostream &
info)
override;
This is the abstract base class for binary log events.
Definition: binlog_event.h:819
@ QUERY_HEADER_LEN
Definition: binlog_event.h:836
An Intvar_event will be created just before a Query_event, if the query uses one of the variables LAS...
Definition: statement_events.h:920
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:482
uint8_t type
Definition: statement_events.h:922
~Intvar_event() override=default
Int_event_type
Definition: statement_events.h:931
@ INSERT_ID_EVENT
Definition: statement_events.h:934
@ LAST_INSERT_ID_EVENT
Definition: statement_events.h:933
@ INVALID_INT_EVENT
Definition: statement_events.h:932
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:983
uint64_t val
Definition: statement_events.h:923
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:949
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:942
@ I_VAL_OFFSET
Definition: statement_events.h:942
@ I_TYPE_OFFSET
Definition: statement_events.h:942
A Query_event is created for each query that modifies the database, unless the query is logged row-ba...
Definition: statement_events.h:450
bool charset_inited
Definition: statement_events.h:601
enum binary_log::Query_event::enum_ternary explicit_defaults_ts
size_t user_len
Definition: statement_events.h:540
size_t db_len
Definition: statement_events.h:558
const char * time_zone_str
Definition: statement_events.h:536
uint64_t table_map_for_update
Definition: statement_events.h:620
bool flags2_inited
Definition: statement_events.h:599
uint8_t default_table_encryption
Definition: statement_events.h:647
uint16_t auto_increment_offset
Definition: statement_events.h:606
uint16_t default_collation_for_utf8mb4_number
Definition: statement_events.h:644
unsigned char mts_accessed_dbs
Definition: statement_events.h:639
enum_ternary
Definition: statement_events.h:630
@ TERNARY_OFF
Definition: statement_events.h:632
@ TERNARY_ON
Definition: statement_events.h:633
@ TERNARY_UNSET
Definition: statement_events.h:631
uint64_t ddl_xid
Definition: statement_events.h:642
uint32_t flags2
Definition: statement_events.h:603
unsigned long data_len
Definition: statement_events.h:545
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:52
uint8_t sql_require_primary_key
Definition: statement_events.h:645
size_t host_len
Definition: statement_events.h:542
int fill_data_buf(unsigned char *dest, unsigned long len)
Layout for the data buffer is as follows.
Definition: statement_events.cpp:365
uint16_t lc_time_names_number
Definition: statement_events.h:614
uint64_t sql_mode
Definition: statement_events.h:605
uint16_t status_vars_len
Definition: statement_events.h:580
const char * user
Definition: statement_events.h:539
const char * query
Definition: statement_events.h:533
Query_event_post_header_offset
query event post-header
Definition: statement_events.h:453
@ Q_DATA_OFFSET
Definition: statement_events.h:459
@ Q_THREAD_ID_OFFSET
Definition: statement_events.h:454
@ Q_ERR_CODE_OFFSET
Definition: statement_events.h:457
@ Q_STATUS_VARS_LEN_OFFSET
Definition: statement_events.h:458
@ Q_DB_LEN_OFFSET
Definition: statement_events.h:456
@ Q_EXEC_TIME_OFFSET
Definition: statement_events.h:455
size_t catalog_len
Definition: statement_events.h:613
const char * host
Definition: statement_events.h:541
bool sql_mode_inited
Definition: statement_events.h:600
char charset[6]
Definition: statement_events.h:607
uint32_t thread_id
Definition: statement_events.h:556
char mts_accessed_db_names[MAX_DBS_IN_EVENT_MTS][NAME_LEN]
Definition: statement_events.h:640
uint16_t charset_database_number
Definition: statement_events.h:615
size_t time_zone_len
Definition: statement_events.h:608
size_t q_len
Definition: statement_events.h:586
uint16_t auto_increment_increment
Definition: statement_events.h:606
uint32_t query_exec_time
Definition: statement_events.h:557
const char * catalog
Definition: statement_events.h:535
const char * db
Definition: statement_events.h:534
~Query_event() override=default
uint16_t error_code
Definition: statement_events.h:559
Query_event_status_vars
Definition: statement_events.h:463
@ Q_COMMIT_TS2
Definition: statement_events.h:505
@ Q_TIME_ZONE_CODE
Definition: statement_events.h:474
@ Q_COMMIT_TS
Definition: statement_events.h:500
@ Q_CATALOG_CODE
Definition: statement_events.h:471
@ Q_INVOKER
Definition: statement_events.h:489
@ Q_SQL_REQUIRE_PRIMARY_KEY
Definition: statement_events.h:526
@ Q_CHARSET_DATABASE_CODE
Definition: statement_events.h:485
@ Q_DEFAULT_COLLATION_FOR_UTF8MB4
Definition: statement_events.h:521
@ Q_AUTO_INCREMENT
Definition: statement_events.h:472
@ Q_MICROSECONDS
Definition: statement_events.h:496
@ Q_CHARSET_CODE
Definition: statement_events.h:473
@ Q_UPDATED_DB_NAMES
Definition: statement_events.h:495
@ Q_TABLE_MAP_FOR_UPDATE_CODE
Definition: statement_events.h:486
@ Q_DEFAULT_TABLE_ENCRYPTION
Definition: statement_events.h:531
@ Q_FLAGS2_CODE
Definition: statement_events.h:464
@ Q_CATALOG_NZ_CODE
Definition: statement_events.h:483
@ Q_LC_TIME_NAMES_CODE
Definition: statement_events.h:484
@ Q_DDL_LOGGED_WITH_XID
Definition: statement_events.h:516
@ Q_SQL_MODE_CODE
Definition: statement_events.h:465
@ Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP
Definition: statement_events.h:512
@ Q_MASTER_DATA_WRITTEN_CODE
Definition: statement_events.h:488
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0.
Definition: statement_events.h:1032
Rand_event_data
Definition: statement_events.h:1036
@ RAND_SEED2_OFFSET
Definition: statement_events.h:1036
@ RAND_SEED1_OFFSET
Definition: statement_events.h:1036
unsigned long long seed2
Definition: statement_events.h:1035
Rand_event(unsigned long long seed1_arg, unsigned long long seed2_arg)
Definition: statement_events.h:1042
unsigned long long seed1
Definition: statement_events.h:1034
Written every time a statement uses a user variable; precedes other events for the statement.
Definition: statement_events.h:803
Value_type type
Definition: statement_events.h:856
unsigned char flags
Definition: statement_events.h:859
~User_var_event() override
Definition: statement_events.cpp:466
uint32_t val_len
Definition: statement_events.h:855
unsigned int name_len
Definition: statement_events.h:853
bool is_null
Definition: statement_events.h:858
char * val
Definition: statement_events.h:854
const char * name
Definition: statement_events.h:852
User_var_event_data
Definition: statement_events.h:807
@ UV_VAL_IS_NULL
Definition: statement_events.h:809
@ UV_NAME_LEN_SIZE
Definition: statement_events.h:811
@ UV_CHARSET_NUMBER_SIZE
Definition: statement_events.h:812
@ UV_VAL_LEN_SIZE
Definition: statement_events.h:808
@ UV_VAL_TYPE_SIZE
Definition: statement_events.h:810
unsigned int charset_number
Definition: statement_events.h:857
@ UNDEF_F
Definition: statement_events.h:806
@ UNSIGNED_F
Definition: statement_events.h:806
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:819
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:105
#define NAME_LEN
Definition: mysql_com.h:66
The namespace contains classes representing events that can occur in a replication stream.
const uint64_t INVALID_XID
The following constant represents the maximum of MYSQL_XID domain.
Definition: statement_events.h:48
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:730
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:274
@ USER_VAR_EVENT
Definition: binlog_event.h:299
@ RAND_EVENT
Definition: binlog_event.h:298
@ INTVAR_EVENT
Definition: binlog_event.h:291
@ QUERY_EVENT
Definition: binlog_event.h:288
T available_buffer(const char *buf_start, const char *buf_current, T buf_len)
Definition: statement_events.h:709
Definition: buf0block_hint.cc:29
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:38
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:40
@ DECIMAL_RESULT
not valid for UDFs
Definition: udf_registration_types.h:44
@ REAL_RESULT
char *
Definition: udf_registration_types.h:41
@ INT_RESULT
double
Definition: udf_registration_types.h:42
@ ROW_RESULT
long long
Definition: udf_registration_types.h:43
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:148