105#include <sys/types.h>
108#ifdef HAVE_PSI_STAGE_INTERFACE
120#if defined(MYSQL_SERVER)
128#if defined(MYSQL_SERVER)
131#define PREFIX_SQL_LOAD "SQL_LOAD-"
143#define TEMP_FILE_MAX_LEN UUID_LENGTH + 38
155#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \
157 if (!(COND)) return ERRNO; \
160#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) assert(COND)
163#define LOG_EVENT_OFFSET 4
165#define NUM_LOAD_DELIM_STRS 5
188#define MAX_LOG_EVENT_HEADER \
190 (LOG_EVENT_HEADER_LEN + \
191 mysql::binlog::event::Binary_log_event::QUERY_HEADER_LEN +
193 mysql::binlog::event::Binary_log_event:: \
194 EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN) +
196 MAX_SIZE_LOG_EVENT_STATUS + \
202#define SL_MASTER_PORT_OFFSET 8
203#define SL_MASTER_POS_OFFSET 0
204#define SL_MASTER_HOST_OFFSET 10
209#define I_TYPE_OFFSET 0
210#define I_VAL_OFFSET 1
213#define BINLOG_MAGIC "\xfe\x62\x69\x6e"
214#define BINLOG_MAGIC_SIZE 4
245#define LOG_EVENT_THREAD_SPECIFIC_F 0x4
260#define LOG_EVENT_SUPPRESS_USE_F 0x8
277#define LOG_EVENT_ARTIFICIAL_F 0x20
285#define LOG_EVENT_RELAY_LOG_F 0x40
296#define LOG_EVENT_IGNORABLE_F 0x80
305#define LOG_EVENT_NO_FILTER_F 0x100
316#define LOG_EVENT_MTS_ISOLATE_F 0x200
341#define OPTIONS_WRITTEN_TO_BIN_LOG \
342 (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \
343 OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT)
346#define EXPECTED_OPTIONS \
347 ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19))
349#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
350#error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
352#undef EXPECTED_OPTIONS
386enum enum_base64_output_mode {
387 BASE64_OUTPUT_NEVER = 0,
388 BASE64_OUTPUT_AUTO = 1,
389 BASE64_OUTPUT_UNSPEC = 2,
390 BASE64_OUTPUT_DECODE_ROWS = 3,
392 BASE64_OUTPUT_MODE_COUNT
407struct PRINT_EVENT_INFO {
417 bool sql_mode_inited;
419 ulong auto_increment_increment, auto_increment_offset;
423 uint lc_time_names_number;
424 uint charset_database_number;
425 uint default_collation_for_utf8mb4_number;
426 uint8_t sql_require_primary_key;
428 bool thread_id_printed;
429 uint8_t default_table_encryption;
433 ~PRINT_EVENT_INFO() {
448 enum_base64_output_mode base64_output_mode;
458 bool printed_fd_event;
460 uint8 common_header_len;
477 bool have_unflushed_events;
487 bool skipped_event_in_transaction;
489 bool print_table_metadata;
497 bool require_row_format;
502 uint32_t immediate_server_version;
754 virtual const char *
get_db();
757 virtual void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const = 0;
761 void print_base64(
IO_CACHE *
file, PRINT_EVENT_INFO *print_event_info,
765 void *
operator new(
size_t size);
767 static void operator delete(
void *ptr, size_t) {
my_free(ptr); }
770 static void *
operator new(size_t,
void *ptr) {
return ptr; }
771 static void operator delete(
void *,
void *) {}
897#if defined(MYSQL_SERVER)
1004 (log_pos == 0 && mts_in_group))))
1112 virtual bool ends_group()
const {
return false; }
1153 DBUG_PRINT(
"info", (
"skip reason=%d=%s", ret,
1353 bool using_trans,
bool immediate,
bool suppress_use,
1354 int error,
bool ignore_command =
false);
1355 const char *
get_db()
override {
return db; }
1379 const char *db_filtered =
1398 PRINT_EVENT_INFO *print_event_info)
const;
1399 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1400 static bool rewrite_db_in_buffer(
1401 char **
buf, ulong *event_len,
1430#if defined(MYSQL_SERVER)
1496 const char **query_arg);
1499 return !strncmp(
query, pattern, p_len);
1566 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1582#if defined(MYSQL_SERVER)
1633 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1654#if defined(MYSQL_SERVER)
1706 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1724#if defined(MYSQL_SERVER)
1773 bool ends_group()
const override {
return true; }
1774#if defined(MYSQL_SERVER)
1799 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1814#if defined(MYSQL_SERVER)
1866 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1868#if defined(MYSQL_SERVER)
1907 char *val_arg, ulong val_len_arg,
Item_result type_arg,
1908 uint charset_number_arg,
uchar flags_arg,
1912 val_len_arg, type_arg,
1913 charset_number_arg, flags_arg),
1921 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
1952#if defined(MYSQL_SERVER)
1980 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2000#if defined(MYSQL_SERVER)
2053 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2072#if defined(MYSQL_SERVER)
2116 uint block_len_arg,
bool using_trans);
2120 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2136 const char *
get_db()
override {
return db; }
2142#if defined(MYSQL_SERVER)
2189 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2190 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info,
bool enable_local);
2205 const char *
get_db()
override {
return db; }
2211#if defined(MYSQL_SERVER)
2267 uint block_len_arg,
bool using_trans);
2279#if defined(MYSQL_SERVER)
2326 THD *
thd,
const char *query_arg, ulong query_length,
2327 uint fn_pos_start_arg, uint fn_pos_end_arg,
2329 bool using_trans,
bool immediate,
bool suppress_use,
int errcode);
2332 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2335 const char *local_fname)
const;
2352#if defined(MYSQL_SERVER)
2357#if defined MYSQL_SERVER
2361 const char *table_name_arg,
bool is_concurrent_arg,
2391 Unknown_log_event(Unknown_log_event &&)
noexcept =
delete;
2392 Unknown_log_event &
operator=(Unknown_log_event &&)
noexcept =
delete;
2393 Unknown_log_event(
const Unknown_log_event &) =
delete;
2394 Unknown_log_event &
operator=(
const Unknown_log_event &) =
delete;
2412 ~Unknown_log_event()
override =
default;
2413 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2419char *
str_to_hex(
char *to,
const char *from,
size_t len);
2506 uint vector_column_count =
2508 std::vector<unsigned int> vector_dimensionality;
2509 if (vector_column_count > 0) {
2512 vector_dimensionality = fields.m_vector_dimensionality;
2516 vector_dimensionality);
2518 static bool rewrite_db_in_buffer(
2519 char **
buf, ulong *event_len,
2563#if defined(MYSQL_SERVER)
2568 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
2580 const Optional_metadata_fields &fields)
const;
2591 const Optional_metadata_fields &fields)
const;
2599#if defined(MYSQL_SERVER)
2660 class Charset_iterator;
2661 class Default_charset_iterator;
2662 class Column_charset_iterator;
2666#ifdef HAVE_PSI_STAGE_INTERFACE
2718 if (estimated == 0) {
2719 assert(cursor >
begin);
2721 estimated = (
end -
begin) / avg_row_change_size;
2788#ifdef HAVE_PSI_STAGE_INTERFACE
2834#if defined(MYSQL_SERVER)
2839 void print_verbose(
IO_CACHE *
file, PRINT_EVENT_INFO *print_event_info);
2841 PRINT_EVENT_INFO *print_event_info,
2843 const uchar *prefix,
2862#if defined(MYSQL_SERVER)
2893 MY_BITMAP const *cols,
bool is_transactional,
2895 const unsigned char *extra_row_ndb_info);
2898 const char *row_data,
2902 void print_helper(
FILE *, PRINT_EVENT_INFO *)
const;
2963#if defined(MYSQL_SERVER)
2984 return key_cmp2((*m_key_info)->key_part, k1, (*m_key_info)->key_length,
2985 k2, (*m_key_info)->key_length) < 0;
2992 std::set<uchar *, Key_compare>::iterator
m_itr;
3021 bool is_after_image,
bool only_seek =
false);
3081#if defined(MYSQL_SERVER)
3218 const uchar *curr_bi_start
3338#if defined(MYSQL_SERVER)
3341 bool is_transactional,
3342 const unsigned char *extra_row_ndb_info);
3347#if defined(MYSQL_SERVER)
3349 bool is_transactional,
3350 const uchar *before_record
3352 const uchar *after_record);
3369 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3372#if defined(MYSQL_SERVER)
3431 bool is_transactional,
3432 const unsigned char *extra_row_ndb_info);
3436 bool is_transactional,
3437 const unsigned char *extra_row_ndb_info);
3450 bool is_transactional,
3452 const uchar *after_record);
3467 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3470#if defined(MYSQL_SERVER)
3476 const uchar *curr_bi_start)
override;
3488 const THD *thd_arg);
3549 bool is_transactional,
3550 const unsigned char *extra_row_ndb_info);
3557 bool is_transactional,
3558 const uchar *before_record,
3574 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3577#if defined(MYSQL_SERVER)
3625 std::string_view msg)
3630 DBUG_PRINT(
"enter", (
"incident: %d", incident_arg));
3659 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3662#if defined(MYSQL_SERVER)
3673 bool ends_group()
const override {
return true; }
3736 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3835 bool flush_stream) {
3837 (flush_stream ? (fflush(
file) || ferror(
file)) : 0) ||
3898 uint64_t payload_size,
3899 uint16_t compression_type,
3900 uint64_t uncompressed_size)
3907 uint64_t payload_size)
3909 thd_arg, payload, payload_size,
3926 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
3932#if defined(MYSQL_SERVER)
3987 int64 sequence_number_arg,
bool may_have_sbr_stmts_arg,
3988 ulonglong original_commit_timestamp_arg,
3989 ulonglong immediate_commit_timestamp_arg,
3990 uint32_t original_server_version_arg,
3991 uint32_t immediate_server_version_arg);
3998 int64 last_committed_arg,
int64 sequence_number_arg,
3999 bool may_have_sbr_stmts_arg,
4000 ulonglong original_commit_timestamp_arg,
4001 ulonglong immediate_commit_timestamp_arg,
4003 uint32_t original_server_version_arg,
4004 uint32_t immediate_server_version_arg);
4024 { size_calculated += 2; });
4025 return size_calculated;
4094 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4097#if defined(MYSQL_SERVER)
4189 bool is_checksum_enabled =
false,
4190 int event_counter = 0);
4195 bool is_checksum_enabled =
false,
4196 int event_counter = 0);
4253 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4266 (
"skip writing Previous_gtids_log_event because of"
4267 "debug option 'skip_writing_previous_gtids_log_event'"));
4278 (
"writing partial Previous_gtids_log_event because of"
4279 "debug option 'write_partial_previous_gtids_log_event'"));
4311#if defined(MYSQL_SERVER)
4397 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4400#if defined(MYSQL_SERVER)
4497 std::map<std::string, std::string> *
map);
4526 void print(
FILE *
file, PRINT_EVENT_INFO *print_event_info)
const override;
4529#if defined(MYSQL_SERVER)
4550 size_t *event_size);
4601 return evt !=
nullptr &&
4635template <
class EVENT>
4637 return ev->write(ostream);
4645 const char *identifier,
size_t length);
4650 const char *identifier,
4671template <
typename T>
4681std::pair<bool, mysql::binlog::event::Log_event_basic_info>
4693std::pair<bool, mysql::binlog::event::Log_event_basic_info>
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
int64 query_id_t
Definition: binlog.h:72
Contains the classes representing events occurring in the replication stream.
#define LOG_EVENT_HEADER_LEN
Definition: binlog_event.h:435
This event is created to contain the file data.
Definition: log_event.h:2103
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:7055
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:7082
virtual int get_create_or_append() const
Definition: log_event.cc:7105
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:2137
size_t get_data_size() override
Definition: log_event.h:2128
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:7092
~Append_block_log_event() override=default
const char * get_db() override
Definition: log_event.h:2134
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:7135
The abstract class for basic output streams which provides write operation.
Definition: basic_ostream.h:37
Event for the first block of file to be loaded, its only difference from Append_block event is that t...
Definition: log_event.h:2253
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:7356
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:7346
~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:7352
Delete_file_log_event is created when the LOAD_DATA query fails on the master for some reason,...
Definition: log_event.h:2175
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:7296
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:7274
size_t get_data_size() override
Definition: log_event.h:2198
~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:2206
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:7251
const char * get_db() override
Definition: log_event.h:2203
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:7284
Log row deletions.
Definition: log_event.h:3538
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:3559
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:12475
int do_after_row_operations(const Relay_log_info *const, int) override
Definition: log_event.cc:12528
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:12495
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:12464
mysql::binlog::event::Log_event_type get_general_type_code() override
Definition: log_event.h:3567
int do_exec_row(const Relay_log_info *const) override
Definition: log_event.cc:12535
@ TYPE_CODE
Definition: log_event.h:3542
int do_before_row_operations(const Relay_log_info *const) override
Definition: log_event.cc:12502
Event responsible for LOAD DATA execution, it similar to Query_log_event but before executing the que...
Definition: log_event.h:2320
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:7510
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:2345
bool write_post_header_for_derived(Basic_ostream *ostream) override
Definition: log_event.cc:7420
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:7479
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:7414
ulong get_post_header_size_for_derived() override
Definition: log_event.cc:7410
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:7369
~Execute_load_query_log_event() override=default
This is a subclass if Gtid_event and Log_event.
Definition: log_event.h:3972
void set_trx_length_by_cache_size_tagged(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:13621
rpl_gno get_gno() const override
Return the GNO for this GTID.
Definition: log_event.h:4141
rpl_sidno get_sidno(bool need_lock)
Return the SIDNO relative to the global tsid_map for this GTID.
Definition: log_event.cc:13652
~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:13335
Gtid_log_event(Gtid_log_event &&) noexcept=delete
size_t get_event_length()
Definition: log_event.h:4037
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:13602
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:4105
uint32 write_body_to_memory(uchar *buff)
Writes the body to the given memory buffer.
Definition: log_event.cc:13372
Gtid_log_event(const Gtid_log_event &)=delete
uint32 write_tagged_event_body_to_memory(uchar *buffer)
Writes the body to the given memory buffer.
Definition: log_event.cc:13345
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:13446
uint32 write_post_header_to_memory(uchar *buffer)
Writes the post-header to the given memory buffer.
Definition: log_event.cc:13275
static const size_t SET_STRING_PREFIX_LENGTH
Length of SET_STRING_PREFIX.
Definition: log_event.h:4151
Tsid tsid
TSID for this GTID.
Definition: log_event.h:4164
const Tsid & get_tsid() const
Return the TSID for this GTID.
Definition: log_event.h:4111
Gtid_specification get_gtid_spec()
Definition: log_event.cc:13665
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:13437
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:13631
static const size_t MAX_SET_STRING_LENGTH
The maximal length of the entire "SET ..." query.
Definition: log_event.h:4153
void update_parent_gtid_info()
Updates parent tsid and gtid info structure.
Definition: log_event.cc:13100
static const char * SET_STRING_PREFIX
string holding the text "SET @@GLOBAL.GTID_NEXT = '"
Definition: log_event.h:4147
void clear_gtid_and_spec()
Clears tsid and spec.
Definition: log_event.cc:13106
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:13190
Gtid_specification spec
Internal representation of the GTID.
Definition: log_event.h:4162
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:13171
size_t get_data_size() override
Definition: log_event.h:4018
size_t to_string(char *buf) const
Used internally by both print() and pack_info().
Definition: log_event.cc:13179
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:13616
Represents a set of GTIDs.
Definition: rpl_gtid.h:1557
Definition: rpl_utility.h:110
Definition: log_event.h:3858
Heartbeat_log_event_v2(const char *buf, const mysql::binlog::event::Format_description_event *description_event)
Definition: log_event.cc:14522
Definition: log_event.h:3850
Heartbeat_log_event(const char *buf, const mysql::binlog::event::Format_description_event *description_event)
Definition: log_event.cc:14515
Base class for ignorable log events is Ignorable_event.
Definition: log_event.h:3704
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12872
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:12865
size_t get_data_size() override
Definition: log_event.h:3737
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:3613
Incident_log_event(const Incident_log_event &)=delete
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:12817
size_t get_data_size() override
Definition: log_event.h:3666
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:12843
~Incident_log_event() override
Definition: log_event.cc:12731
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:12777
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12750
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:12744
const char * description() const
Definition: log_event.cc:12735
bool ends_group() const override
Definition: log_event.h:3671
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:1612
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:5866
~Intvar_log_event() override=default
Intvar_log_event(Intvar_log_event &&) noexcept=delete
size_t get_data_size() override
Definition: log_event.h:1641
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:5945
void claim_memory_ownership(bool claim) override
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.cc:5876
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:5841
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:1649
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:5920
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:5940
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Definition: sql_list.h:494
Definition: log_event.h:2356
bool has_replace
Definition: log_event.h:2376
const size_t BUF_SIZE
Definition: log_event.h:2365
const char * table_name
Definition: log_event.h:2372
const char * fname
Definition: log_event.h:2373
const sql_exchange * sql_ex
Definition: log_event.h:2370
THD * thd
Definition: log_event.h:2369
bool has_ignore
Definition: log_event.h:2377
String str
Definition: log_event.h:2366
const char * db
Definition: log_event.h:2371
bool is_concurrent
Definition: log_event.h:2375
const String * generate(size_t *fn_start, size_t *fn_end)
Definition: log_event.cc:7619
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:7602
This is the abstract base class for binary log events.
Definition: log_event.h:538
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:1255
ulong mts_group_idx
Index in rli->gaq array to indicate a group that this event is purging.
Definition: log_event.h:693
bool is_using_stmt_cache() const
Definition: log_event.h:839
enum_skip_reason continue_group(Relay_log_info *rli)
Helper function to ignore an event w.r.t.
Definition: log_event.cc:2473
bool is_no_filter_event() const
Definition: log_event.h:833
int apply_event(Relay_log_info *rli)
Apply the event to the database.
Definition: log_event.cc:3087
virtual int do_apply_event(Relay_log_info const *rli)
Primitive to apply an event to the database.
Definition: log_event.h:1173
virtual const char * get_db()
Definition: log_event.cc:1058
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)
Definition: log_event.h:952
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:676
int net_send(Protocol *protocol, const char *log_name, my_off_t pos)
Only called by SHOW BINLOG EVENTS.
Definition: log_event.cc:1063
uint32 write_header_to_memory(uchar *buf)
Writes the common header of this event to the given memory buffer.
Definition: log_event.cc:1216
virtual mysql::binlog::event::Log_event_type get_type_code() const
Definition: log_event.h:797
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:1105
uint32 server_id
Definition: log_event.h:664
enum_mts_event_exec_mode
Definition: log_event.h:933
@ EVENT_EXEC_PARALLEL
Definition: log_event.h:937
@ EVENT_EXEC_SYNC
Definition: log_event.h:945
@ EVENT_EXEC_CAN_NOT
Definition: log_event.h:949
@ EVENT_EXEC_ASYNC
Definition: log_event.h:941
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:1148
bool is_valid()
Definition: log_event.cc:1308
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:1067
ha_checksum crc
Placeholder for event checksum while writing to binlog.
Definition: log_event.h:686
virtual size_t get_data_size()
Definition: log_event.h:879
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:1194
enum_event_cache_type
Definition: log_event.h:567
@ EVENT_CACHE_COUNT
Definition: log_event.h:589
@ EVENT_INVALID_CACHE
Definition: log_event.h:568
@ EVENT_NO_CACHE
Definition: log_event.h:585
@ EVENT_STMT_CACHE
Definition: log_event.h:574
@ EVENT_TRANSACTIONAL_CACHE
Definition: log_event.h:580
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:547
@ EVENT_SKIP_IGNORE
Skip event by ignoring it.
Definition: log_event.h:558
@ EVENT_SKIP_COUNT
Skip event and decrease skip counter.
Definition: log_event.h:563
@ EVENT_SKIP_NOT
Don't skip event.
Definition: log_event.h:551
bool is_mts_sequential_exec() const
Is called from get_mts_execution_mode() to.
Definition: log_event.h:909
bool m_free_temp_buf_in_destructor
Definition: log_event.h:655
bool contains_partition_info(bool)
Definition: log_event.cc:2493
bool is_relay_log_event() const
Definition: log_event.h:827
bool is_ignorable_event() const
Definition: log_event.h:830
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:716
int update_pos(Relay_log_info *rli)
Update the relay log position.
Definition: log_event.h:1140
virtual int do_apply_event_worker(Slave_worker *w)
Definition: log_event.cc:982
void set_artificial_event()
Definition: log_event.h:815
const char * get_type_str() const
Returns the human readable name of this event's type.
Definition: log_event.cc:898
time_t get_time()
Prints a "session_var=value" string.
Definition: log_event.cc:875
bool write_footer(Basic_ostream *ostream)
Definition: log_event.cc:1203
Relay_log_info * worker
MTS: associating the event with either an assigned Worker or Coordinator.
Definition: log_event.h:711