104#include <sys/types.h>
107#ifdef HAVE_PSI_STAGE_INTERFACE
119#if defined(MYSQL_SERVER)
127#if defined(MYSQL_SERVER)
130#define PREFIX_SQL_LOAD "SQL_LOAD-"
142#define TEMP_FILE_MAX_LEN UUID_LENGTH + 38
154#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
156 if (!(COND)) return ERRNO; \
159#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) assert(COND)
162#define LOG_EVENT_OFFSET 4
164#define NUM_LOAD_DELIM_STRS 5
187#define MAX_LOG_EVENT_HEADER \
189 (LOG_EVENT_HEADER_LEN + \
190 mysql::binlog::event::Binary_log_event::QUERY_HEADER_LEN +
192 mysql::binlog::event::Binary_log_event:: \
193 EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN) +
195 MAX_SIZE_LOG_EVENT_STATUS + \
201#define SL_MASTER_PORT_OFFSET 8
202#define SL_MASTER_POS_OFFSET 0
203#define SL_MASTER_HOST_OFFSET 10
208#define I_TYPE_OFFSET 0
209#define I_VAL_OFFSET 1
212#define BINLOG_MAGIC "\xfe\x62\x69\x6e"
213#define BINLOG_MAGIC_SIZE 4
244#define LOG_EVENT_THREAD_SPECIFIC_F 0x4
259#define LOG_EVENT_SUPPRESS_USE_F 0x8
276#define LOG_EVENT_ARTIFICIAL_F 0x20
284#define LOG_EVENT_RELAY_LOG_F 0x40
295#define LOG_EVENT_IGNORABLE_F 0x80
304#define LOG_EVENT_NO_FILTER_F 0x100
315#define LOG_EVENT_MTS_ISOLATE_F 0x200
340#define OPTIONS_WRITTEN_TO_BIN_LOG \
341 (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \
342 OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT)
345#define EXPECTED_OPTIONS \
346 ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19))
348#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
349#error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
351#undef EXPECTED_OPTIONS
385enum enum_base64_output_mode {
386 BASE64_OUTPUT_NEVER = 0,
387 BASE64_OUTPUT_AUTO = 1,
388 BASE64_OUTPUT_UNSPEC = 2,
389 BASE64_OUTPUT_DECODE_ROWS = 3,
391 BASE64_OUTPUT_MODE_COUNT
406struct PRINT_EVENT_INFO {
416 bool sql_mode_inited;
418 ulong auto_increment_increment, auto_increment_offset;
422 uint lc_time_names_number;
423 uint charset_database_number;
424 uint default_collation_for_utf8mb4_number;
425 uint8_t sql_require_primary_key;
427 bool thread_id_printed;
428 uint8_t default_table_encryption;
432 ~PRINT_EVENT_INFO() {
447 enum_base64_output_mode base64_output_mode;
457 bool printed_fd_event;
459 uint8 common_header_len;
476 bool have_unflushed_events;
486 bool skipped_event_in_transaction;
488 bool print_table_metadata;
496 bool require_row_format;
501 uint32_t immediate_server_version;
753 virtual const char *
get_db();
756 virtual void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const = 0;
760 void print_base64(
IO_CACHE *
file, PRINT_EVENT_INFO *print_event_info,
764 void *
operator new(
size_t size);
766 static void operator delete(
void *ptr, size_t) {
my_free(ptr); }
769 static void *
operator new(size_t,
void *ptr) {
return ptr; }
770 static void operator delete(
void *,
void *) {}
886#if defined(MYSQL_SERVER)
1090 virtual bool ends_group()
const {
return false; }
1131 DBUG_PRINT(
"info", (
"skip reason=%d=%s", ret,
1331 bool using_trans,
bool immediate,
bool suppress_use,
1332 int error,
bool ignore_command =
false);
1333 const char *
get_db()
override {
return db; }
1357 const char *db_filtered =
1376 PRINT_EVENT_INFO *print_event_info)
const;
1377 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1378 static bool rewrite_db_in_buffer(
1379 char **
buf, ulong *event_len,
1405#if defined(MYSQL_SERVER)
1471 const char **query_arg);
1474 return !strncmp(
query, pattern, p_len);
1541 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1555#if defined(MYSQL_SERVER)
1606 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1624#if defined(MYSQL_SERVER)
1676 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1691#if defined(MYSQL_SERVER)
1740 bool ends_group()
const override {
return true; }
1741#if defined(MYSQL_SERVER)
1766 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1778#if defined(MYSQL_SERVER)
1827 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1829#if defined(MYSQL_SERVER)
1868 char *val_arg, ulong val_len_arg,
Item_result type_arg,
1869 uint charset_number_arg,
uchar flags_arg,
1873 val_len_arg, type_arg,
1874 charset_number_arg, flags_arg),
1882 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1910#if defined(MYSQL_SERVER)
1938 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1956#if defined(MYSQL_SERVER)
2009 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2025#if defined(MYSQL_SERVER)
2069 uint block_len_arg,
bool using_trans);
2073 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2086 const char *
get_db()
override {
return db; }
2092#if defined(MYSQL_SERVER)
2139 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2140 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info,
bool enable_local);
2152 const char *
get_db()
override {
return db; }
2158#if defined(MYSQL_SERVER)
2214 uint block_len_arg,
bool using_trans);
2224#if defined(MYSQL_SERVER)
2271 THD *
thd,
const char *query_arg, ulong query_length,
2272 uint fn_pos_start_arg, uint fn_pos_end_arg,
2274 bool using_trans,
bool immediate,
bool suppress_use,
int errcode);
2277 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2280 const char *local_fname)
const;
2295#if defined(MYSQL_SERVER)
2300#if defined MYSQL_SERVER
2304 const char *table_name_arg,
bool is_concurrent_arg,
2334 Unknown_log_event(Unknown_log_event &&)
noexcept =
delete;
2335 Unknown_log_event &
operator=(Unknown_log_event &&)
noexcept =
delete;
2336 Unknown_log_event(
const Unknown_log_event &) =
delete;
2337 Unknown_log_event &
operator=(
const Unknown_log_event &) =
delete;
2355 ~Unknown_log_event()
override =
default;
2356 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2362char *
str_to_hex(
char *to,
const char *from,
size_t len);
2450 static bool rewrite_db_in_buffer(
2451 char **
buf, ulong *event_len,
2495#if defined(MYSQL_SERVER)
2500 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2512 const Optional_metadata_fields &fields)
const;
2523 const Optional_metadata_fields &fields)
const;
2531#if defined(MYSQL_SERVER)
2591 class Charset_iterator;
2592 class Default_charset_iterator;
2593 class Column_charset_iterator;
2597#ifdef HAVE_PSI_STAGE_INTERFACE
2649 if (estimated == 0) {
2650 assert(cursor >
begin);
2652 estimated = (
end -
begin) / avg_row_change_size;
2719#ifdef HAVE_PSI_STAGE_INTERFACE
2765#if defined(MYSQL_SERVER)
2770 void print_verbose(
IO_CACHE *
file, PRINT_EVENT_INFO *print_event_info);
2772 PRINT_EVENT_INFO *print_event_info,
2774 const uchar *prefix,
2793#if defined(MYSQL_SERVER)
2824 MY_BITMAP const *cols,
bool is_transactional,
2826 const unsigned char *extra_row_ndb_info);
2829 const char *row_data,
2833 void print_helper(
FILE *, PRINT_EVENT_INFO *)
const;
2894#if defined(MYSQL_SERVER)
2915 return key_cmp2((*m_key_info)->key_part, k1, (*m_key_info)->key_length,
2916 k2, (*m_key_info)->key_length) < 0;
2923 std::set<uchar *, Key_compare>::iterator
m_itr;
2952 bool is_after_image,
bool only_seek =
false);
3013#if defined(MYSQL_SERVER)
3150 const uchar *curr_bi_start
3270#if defined(MYSQL_SERVER)
3273 bool is_transactional,
3274 const unsigned char *extra_row_ndb_info);
3279#if defined(MYSQL_SERVER)
3281 bool is_transactional,
3282 const uchar *before_record
3284 const uchar *after_record);
3299 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3302#if defined(MYSQL_SERVER)
3361 bool is_transactional,
3362 const unsigned char *extra_row_ndb_info);
3366 bool is_transactional,
3367 const unsigned char *extra_row_ndb_info);
3380 bool is_transactional,
3382 const uchar *after_record);
3395 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3398#if defined(MYSQL_SERVER)
3404 const uchar *curr_bi_start)
override;
3417 const THD *thd_arg);
3478 bool is_transactional,
3479 const unsigned char *extra_row_ndb_info);
3486 bool is_transactional,
3487 const uchar *before_record,
3501 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3504#if defined(MYSQL_SERVER)
3556 DBUG_PRINT(
"enter", (
"incident: %d", incident_arg));
3569 DBUG_PRINT(
"enter", (
"incident: %d", incident_arg));
3596 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3599#if defined(MYSQL_SERVER)
3610 bool ends_group()
const override {
return true; }
3671 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3755 bool flush_stream) {
3757 (flush_stream ? (fflush(
file) || ferror(
file)) : 0) ||
3818 uint64_t payload_size,
3819 uint16_t compression_type,
3820 uint64_t uncompressed_size)
3827 uint64_t payload_size)
3829 thd_arg, payload, payload_size,
3844 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3850#if defined(MYSQL_SERVER)
3905 int64 sequence_number_arg,
bool may_have_sbr_stmts_arg,
3906 ulonglong original_commit_timestamp_arg,
3907 ulonglong immediate_commit_timestamp_arg,
3908 uint32_t original_server_version_arg,
3909 uint32_t immediate_server_version_arg);
3916 int64 last_committed_arg,
int64 sequence_number_arg,
3917 bool may_have_sbr_stmts_arg,
3918 ulonglong original_commit_timestamp_arg,
3919 ulonglong immediate_commit_timestamp_arg,
3921 uint32_t original_server_version_arg,
3922 uint32_t immediate_server_version_arg);
3991 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3994#if defined(MYSQL_SERVER)
4083 bool is_checksum_enabled =
false,
4084 int event_counter = 0);
4139 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4152 (
"skip writing Previous_gtids_log_event because of"
4153 "debug option 'skip_writing_previous_gtids_log_event'"));
4164 (
"writing partial Previous_gtids_log_event because of"
4165 "debug option 'write_partial_previous_gtids_log_event'"));
4197#if defined(MYSQL_SERVER)
4261 bool is_gtid_specified_arg);
4279 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4282#if defined(MYSQL_SERVER)
4377 std::map<std::string, std::string> *
map);
4404 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4407#if defined(MYSQL_SERVER)
4428 size_t *event_size);
4480 return evt !=
nullptr &&
4514template <
class EVENT>
4516 return ev->write(ostream);
4524 const char *identifier,
size_t length);
4529 const char *identifier,
4550template <
typename T>
4560std::pair<bool, mysql::binlog::event::Log_event_basic_info>
4572std::pair<bool, mysql::binlog::event::Log_event_basic_info>
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
int64 query_id_t
Definition: binlog.h:71
Contains the classes representing events occurring in the replication stream.
#define LOG_EVENT_HEADER_LEN
Definition: binlog_event.h:424
This event is created to contain the file data.
Definition: log_event.h:2056
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:6952
virtual int get_create_or_append() const
Definition: log_event.cc:6997
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:2087
size_t get_data_size() override
Definition: log_event.h:2078
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:6984
~Append_block_log_event() override=default
const char * get_db() override
Definition: log_event.h:2084
Append_block_log_event(Append_block_log_event &&) noexcept=delete
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:7027
The abstract class for basic output streams which provides write operation.
Definition: basic_ostream.h:36
Event for the first block of file to be loaded, its only difference from Append_block event is that t...
Definition: log_event.h:2200
enum_skip_reason do_shall_skip(Relay_log_info *rli) override
Decide if this event shall be skipped or not and the reason for skipping it.
Definition: log_event.cc:7238
~Begin_load_query_log_event() override=default
Begin_load_query_log_event(THD *thd)
Begin_load_query_log_event(Begin_load_query_log_event &&) noexcept=delete
int get_create_or_append() const override
Definition: log_event.cc:7234
Delete_file_log_event is created when the LOAD_DATA query fails on the master for some reason,...
Definition: log_event.h:2125
Delete_file_log_event(const Delete_file_log_event &)=delete
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:7183
size_t get_data_size() override
Definition: log_event.h:2145
~Delete_file_log_event() override=default
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:2153
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:7143
const char * get_db() override
Definition: log_event.h:2150
Delete_file_log_event(Delete_file_log_event &&) noexcept=delete
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:7171
Log row deletions.
Definition: log_event.h:3467
bool read_write_bitmaps_cmp(const TABLE *table) const override
Compares the table's read/write_set with the columns included in this event's before-image and/or aft...
Definition: log_event.h:3488
@ TYPE_CODE
Definition: log_event.h:3471
static bool binlog_row_logging_function(THD *thd, TABLE *table, bool is_transactional, const uchar *before_record, const uchar *after_record)
Definition: log_event.cc:12350
int do_after_row_operations(const Relay_log_info *const, int) override
Definition: log_event.cc:12398
Delete_rows_log_event(THD *, TABLE *, const mysql::binlog::event::Table_id &, bool is_transactional, const unsigned char *extra_row_ndb_info)
Definition: log_event.cc:12335
mysql::binlog::event::Log_event_type get_general_type_code() override
Definition: log_event.h:3494
int do_exec_row(const Relay_log_info *const) override
Definition: log_event.cc:12405
int do_before_row_operations(const Relay_log_info *const) override
Definition: log_event.cc:12372
Event responsible for LOAD DATA execution, it similar to Query_log_event but before executing the que...
Definition: log_event.h:2265
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:7387
bool is_sbr_logging_format() const override
When a query log event contains a non-transaction control statement, we assume that it is changing da...
Definition: log_event.h:2290
bool write_post_header_for_derived(Basic_ostream *ostream) override
Definition: log_event.cc:7297
int pack_info(Protocol *protocol) override
This (which is used only for SHOW BINLOG EVENTS) could be updated to print SET @session_var=.
Definition: log_event.cc:7356
ulong get_post_header_size_for_derived() override
Definition: log_event.cc:7292
Execute_load_query_log_event(THD *thd, const char *query_arg, ulong query_length, uint fn_pos_start_arg, uint fn_pos_end_arg, mysql::binlog::event::enum_load_dup_handling dup_handling_arg, bool using_trans, bool immediate, bool suppress_use, int errcode)
Definition: log_event.cc:7251
~Execute_load_query_log_event() override=default
This is a subclass if Gtid_event and Log_event.
Definition: log_event.h:3890
rpl_gno get_gno() const override
Return the GNO for this GTID.
Definition: log_event.h:4038
rpl_sidno get_sidno(bool need_lock)
Return the SIDNO relative to the global sid_map for this GTID.
Definition: log_event.cc:13396
const rpl_sid * get_sid() const
Return the SID for this GTID.
Definition: log_event.h:4008
rpl_sid sid
SID for this GTID.
Definition: log_event.h:4058
~Gtid_log_event() override=default
bool write_data_header(Basic_ostream *ostream) override
Writes the post-header to the given output stream.
Definition: log_event.cc:13107
Gtid_log_event(Gtid_log_event &&) noexcept=delete
size_t get_event_length()
Definition: log_event.h:3939
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:13328
enum_gtid_type get_type() const
Return the gtid type for this Gtid_log_event: this can be either ANONYMOUS_GTID, AUTOMATIC_GTID,...
Definition: log_event.h:4002
uint32 write_body_to_memory(uchar *buff)
Writes the body to the given memory buffer.
Definition: log_event.cc:13114
Gtid_log_event(const Gtid_log_event &)=delete
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:13185
uint32 write_post_header_to_memory(uchar *buffer)
Writes the post-header to the given memory buffer.
Definition: log_event.cc:13053
static const size_t SET_STRING_PREFIX_LENGTH
Length of SET_STRING_PREFIX.
Definition: log_event.h:4045
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:13176
void set_trx_length_by_cache_size(ulonglong cache_size, bool is_checksum_enabled=false, int event_counter=0)
Set the transaction length information based on binlog cache size.
Definition: log_event.cc:13347
static const size_t MAX_SET_STRING_LENGTH
The maximal length of the entire "SET ..." query.
Definition: log_event.h:4047
static const char * SET_STRING_PREFIX
string holding the text "SET @@GLOBAL.GTID_NEXT = '"
Definition: log_event.h:4041
Gtid_specification spec
Internal representation of the GTID.
Definition: log_event.h:4056
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12959
size_t get_data_size() override
Definition: log_event.h:3932
size_t to_string(char *buf) const
Used internally by both print() and pack_info().
Definition: log_event.cc:12967
enum_skip_reason do_shall_skip(Relay_log_info *rli) override
Decide if this event shall be skipped or not and the reason for skipping it.
Definition: log_event.cc:13342
Represents a set of GTIDs.
Definition: rpl_gtid.h:1466
Definition: rpl_utility.h:108
Definition: log_event.h:3778
Heartbeat_log_event_v2(const char *buf, const mysql::binlog::event::Format_description_event *description_event)
Definition: log_event.cc:14239
Definition: log_event.h:3770
Heartbeat_log_event(const char *buf, const mysql::binlog::event::Format_description_event *description_event)
Definition: log_event.cc:14232
Base class for ignorable log events is Ignorable_event.
Definition: log_event.h:3641
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12729
size_t get_data_size() override
Definition: log_event.h:3672
Ignorable_log_event(Ignorable_log_event &&) noexcept=delete
~Ignorable_log_event() override
Ignorable_log_event(const Ignorable_log_event &)=delete
Class representing an incident, an occurrence out of the ordinary, that happened on the master.
Definition: log_event.h:3540
Incident_log_event(const Incident_log_event &)=delete
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:12679
size_t get_data_size() override
Definition: log_event.h:3603
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:12705
~Incident_log_event() override
Definition: log_event.cc:12598
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:12639
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12612
const char * description() const
Definition: log_event.cc:12602
bool ends_group() const override
Definition: log_event.h:3608
Incident_log_event(Incident_log_event &&) noexcept=delete
The class derives from the class Intvar_event in Binlog API, defined in the header binlog_event....
Definition: log_event.h:1585
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:5793
~Intvar_log_event() override=default
Intvar_log_event(Intvar_log_event &&) noexcept=delete
size_t get_data_size() override
Definition: log_event.h:1611
enum_skip_reason do_shall_skip(Relay_log_info *rli) override
Decide if this event shall be skipped or not and the reason for skipping it.
Definition: log_event.cc:5867
Intvar_log_event(const Intvar_log_event &)=delete
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:5768
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:1619
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:5842
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:5862
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:932
Definition: sql_list.h:433
Definition: log_event.h:2299
bool has_replace
Definition: log_event.h:2319
const size_t BUF_SIZE
Definition: log_event.h:2308
const char * table_name
Definition: log_event.h:2315
const char * fname
Definition: log_event.h:2316
const sql_exchange * sql_ex
Definition: log_event.h:2313
THD * thd
Definition: log_event.h:2312
bool has_ignore
Definition: log_event.h:2320
String str
Definition: log_event.h:2309
const char * db
Definition: log_event.h:2314
bool is_concurrent
Definition: log_event.h:2318
const String * generate(size_t *fn_start, size_t *fn_end)
Definition: log_event.cc:7496
Load_query_generator(THD *thd_arg, const sql_exchange *ex, const char *db_arg, const char *table_name_arg, bool is_concurrent_arg, bool replace, bool ignore)
Definition: log_event.cc:7479
This is the abstract base class for binary log events.
Definition: log_event.h:537
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.
Definition: log_event.cc:1251
ulong mts_group_idx
Index in rli->gaq array to indicate a group that this event is purging.
Definition: log_event.h:692
bool is_mts_sequential_exec()
Is called from get_mts_execution_mode() to.
Definition: log_event.h:898
bool is_using_stmt_cache() const
Definition: log_event.h:838
enum_skip_reason continue_group(Relay_log_info *rli)
Helper function to ignore an event w.r.t.
Definition: log_event.cc:2442
bool is_no_filter_event() const
Definition: log_event.h:832
int apply_event(Relay_log_info *rli)
Apply the event to the database.
Definition: log_event.cc:3038
virtual int do_apply_event(Relay_log_info const *rli)
Primitive to apply an event to the database.
Definition: log_event.h:1151
virtual const char * get_db()
Definition: log_event.cc:1054
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.
Definition: log_event.h:675
int net_send(Protocol *protocol, const char *log_name, my_off_t pos)
Only called by SHOW BINLOG EVENTS.
Definition: log_event.cc:1059
uint32 write_header_to_memory(uchar *buf)
Writes the common header of this event to the given memory buffer.
Definition: log_event.cc:1212
virtual mysql::binlog::event::Log_event_type get_type_code() const
Definition: log_event.h:796
virtual bool starts_group() const
Events of a certain type can start or end a group of events treated transactionally wrt binlog.
Definition: log_event.h:1083
uint32 server_id
Definition: log_event.h:663
enum_mts_event_exec_mode
Definition: log_event.h:918
@ EVENT_EXEC_PARALLEL
Definition: log_event.h:922
@ EVENT_EXEC_SYNC
Definition: log_event.h:930
@ EVENT_EXEC_CAN_NOT
Definition: log_event.h:934
@ EVENT_EXEC_ASYNC
Definition: log_event.h:926
enum_skip_reason shall_skip(Relay_log_info *rli)
Decide if the event shall be skipped, and the reason for skipping it.
Definition: log_event.h:1126
bool is_valid()
Definition: log_event.cc:1304
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.
Definition: log_event.h:1045
ha_checksum crc
Placeholder for event checksum while writing to binlog.
Definition: log_event.h:685
virtual size_t get_data_size()
Definition: log_event.h:868
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.
Definition: log_event.cc:1190
enum_event_cache_type
Definition: log_event.h:566
@ EVENT_CACHE_COUNT
Definition: log_event.h:588
@ EVENT_INVALID_CACHE
Definition: log_event.h:567
@ EVENT_NO_CACHE
Definition: log_event.h:584
@ EVENT_STMT_CACHE
Definition: log_event.h:573
@ EVENT_TRANSACTIONAL_CACHE
Definition: log_event.h:579
enum_skip_reason
Enumeration of what kinds of skipping (and non-skipping) that can occur when the slave executes an ev...
Definition: log_event.h:546
@ EVENT_SKIP_IGNORE
Skip event by ignoring it.
Definition: log_event.h:557
@ EVENT_SKIP_COUNT
Skip event and decrease skip counter.
Definition: log_event.h:562
@ EVENT_SKIP_NOT
Don't skip event.
Definition: log_event.h:550
bool m_free_temp_buf_in_destructor
Definition: log_event.h:654
bool contains_partition_info(bool)
Definition: log_event.cc:2462
bool is_relay_log_event() const
Definition: log_event.h:826
bool is_ignorable_event() const
Definition: log_event.h:829
ulonglong future_event_relay_log_pos
A copy of the main rli value stored into event to pass to MTS worker rli.
Definition: log_event.h:715
int update_pos(Relay_log_info *rli)
Update the relay log position.
Definition: log_event.h:1118
virtual int do_apply_event_worker(Slave_worker *w)
Definition: log_event.cc:978
void set_artificial_event()
Definition: log_event.h:814
const char * get_type_str() const
Returns the human readable name of this event's type.
Definition: log_event.cc:894
time_t get_time()
Prints a "session_var=value" string.
Definition: log_event.cc:871
bool write_footer(Basic_ostream *ostream)
Definition: log_event.cc:1199
Relay_log_info * worker
MTS: associating the event with either an assigned Worker or Coordinator.
Definition: log_event.h:710
bool is_using_trans_cache() const
Definition: log_event.h:835
enum enum_mts_event_exec_mode get_mts_execution_mode(bool mts_in_group)
MTS Coordinator finds out a way how to execute the current event.
Definition: log_event.h:952
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.
Definition: log_event.cc:1000
db_worker_hash_entry * mts_assigned_partitions[MAX_DBS_IN_EVENT_MTS]
Partition info associate with event to deliver to MTS event applier.
Definition: log_event.h:722
virtual bool write(Basic_ostream *ostream)
Definition: log_event.h:784
ulong rbr_exec_mode
A storage to cache the global system variable's value.
Definition: log_event.h:669
mysql::binlog::event::Log_event_header * common_header
The Log_event_header class contains the variable present in the common header.
Definition: log_event.h:698
virtual void set_mts_isolate_group()
Definition: log_event.h:1024
THD * thd
Definition: log_event.h:718
int apply_gtid_event(Relay_log_info *rli)
Apply the GTID event in curr_group_data to the database.
Definition: log_event.cc:2994
mysql::binlog::event::Log_event_footer * common_footer
The Log_event_footer class contains the variable present in the common footer.
Definition: log_event.h:704
virtual bool write_data_body(Basic_ostream *)
Definition: log_event.h:793
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.
Definition: log_event.cc:930
void register_temp_buf(char *buf, bool free_in_destructor=true)
Definition: log_event.h:854
virtual uint8 mts_number_dbs()
Definition: log_event.h:1062
void free_temp_buf()
Definition: log_event.h:858
bool is_mts_group_isolated()
Definition: log_event.h:1069
ulong exec_time
Definition: log_event.h:657
virtual bool is_rbr_logging_format() const
Return true if the event has to be logged using RBR for DMLs.
Definition: log_event.h:807
virtual ~Log_event()
Definition: log_event.h:853
enum_event_logging_type event_logging_type
Defines when information, i.e.
Definition: log_event.h:681
enum_event_logging_type
Definition: log_event.h:591
@ EVENT_NORMAL_LOGGING
Definition: log_event.h:597
@ EVENT_IMMEDIATE_LOGGING
Definition: log_event.h:602
@ EVENT_INVALID_LOGGING
Definition: log_event.h:592
@ EVENT_CACHE_LOGGING_COUNT
Definition: log_event.h:606
char * temp_buf
Definition: log_event.h:647
virtual bool is_sbr_logging_format() const
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:803
virtual int pack_info(Protocol *protocol)
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:1049
bool is_using_immediate_logging() const
Definition: log_event.h:841
void set_relay_log_event()
Definition: log_event.h:822
virtual bool write_data_header(Basic_ostream *)
Definition: log_event.h:792
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 i...
Definition: log_event.cc:1082
bool is_artificial_event() const
Definition: log_event.h:823
virtual int do_update_pos(Relay_log_info *rli)
Advance relay log coordinates.
Definition: log_event.cc:992
virtual bool ends_group() const
Definition: log_event.h:1088
bool need_checksum()
A decider of whether to trigger checksum computation or not.
Definition: log_event.cc:1111
Slave_worker * get_slave_worker(Relay_log_info *rli)
The method maps the event to a Worker and return a pointer to it.
Definition: log_event.cc:2590
This is the subclass of Previous_gtids_event and Log_event It is used to record the gtid_executed in ...
Definition: log_event.h:4111
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:13492
Previous_gtids_log_event(Previous_gtids_log_event &&) noexcept=delete
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:13499
char * get_str(size_t *length, const Gtid_set::String_format *string_format) const
Return the formatted string, or NULL on error.
Definition: log_event.cc:13473
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:13436
int do_apply_event(Relay_log_info const *) override
Primitive to apply an event to the database.
Definition: log_event.h:4201
int add_to_set(Gtid_set *gtid_set) const
Add all GTIDs from this event to the given Gtid_set.
Definition: log_event.cc:13462
size_t get_data_size() override
Definition: log_event.h:4134
enum_skip_reason do_shall_skip(Relay_log_info *) override
Decide if this event shall be skipped or not and the reason for skipping it.
Definition: log_event.h:4196
bool write(Basic_ostream *ostream) override
Definition: log_event.h:4140
~Previous_gtids_log_event() override=default
const uchar * get_buf()
Return the encoded buffer, or NULL on error.
Definition: log_event.h:4177
Definition: protocol.h:32
A Query event is written to the binary log whenever the database is modified on the master,...
Definition: log_event.h:1274
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:5092
bool need_sql_require_primary_key
Whether or not the statement represented by this event requires Q_SQL_REQUIRE_PRIMARY_KEY to be logge...
Definition: log_event.h:1477
bool is_sbr_logging_format() const override
When a query log event contains a non-transaction control statement, we assume that it is changing da...
Definition: log_event.h:1447
Query_log_event(const Query_log_event &)=delete
bool is_trans_keyword() const
Definition: log_event.h:1415
mysql::binlog::event::Log_event_header::Byte * data_buf
Definition: log_event.h:1276
bool m_skip_temp_tables_handling_by_worker
Instructs the applier to skip temporary tables handling.
Definition: log_event.h:1318
static size_t get_query(const char *buf, size_t length, const mysql::binlog::event::Format_description_event *fd_event, const char **query_arg)
Return the query string pointer (and its size) from a Query log event using only the event buffer (we...
Definition: log_event.cc:5142
Query_log_event()
The simplest constructor that could possibly work.
Definition: log_event.cc:3626
enum_skip_reason do_shall_skip(Relay_log_info *rli) override
Decide if this event shall be skipped or not and the reason for skipping it.
Definition: log_event.cc:5106
virtual ulong get_post_header_size_for_derived()
Definition: log_event.h:1399
bool starts_group() const override
Notice, DDL queries are logged without BEGIN/COMMIT parentheses and identification of such single-que...
Definition: log_event.h:1455
uchar mts_number_dbs() override
Definition: log_event.h:1369
my_thread_id slave_proxy_id
Definition: log_event.h:1291
void set_skip_temp_tables_handling_by_worker()
Definition: log_event.h:1320
bool has_ddl_committed
The flag indicates whether the DDL query has been (already) committed or not.
Definition: log_event.h:1311
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:4372
~Query_log_event() override
Definition: log_event.h:1387
void attach_temp_tables_worker(THD *, const Relay_log_info *)
Associating slave Worker thread to a subset of temporary tables.
Definition: log_event.cc:4349
bool write(Basic_ostream *ostream) override
Query_log_event::write().
Definition: log_event.cc:3333
bool rollback_injected_by_coord
True if this is a ROLLBACK event injected by the mts coordinator to finish a group corresponding to a...
Definition: log_event.h:1299
bool is_query_prefix_match(const char *pattern, uint p_len)
Definition: log_event.h:1471
uint8 get_mts_dbs(Mts_db_names *arg, Rpl_filter *rpl_filter) override
Definition: log_event.h:1344
bool needs_default_table_encryption
Whether or not the statement represented by this event requires Q_DEFAULT_TABLE_ENCRYPTION to be logg...
Definition: log_event.h:1481
const char * get_db() override
Definition: log_event.h:1331