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
bool is_using_trans_cache() const
Definition: log_event.h:836
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:1004
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:723
virtual bool write(Basic_ostream *ostream)
Definition: log_event.h:785
ulong rbr_exec_mode
A storage to cache the global system variable's value.
Definition: log_event.h:670
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:699
virtual void set_mts_isolate_group()
Definition: log_event.h:1046
THD * thd
Definition: log_event.h:719
int apply_gtid_event(Relay_log_info *rli)
Apply the GTID event in curr_group_data to the database.
Definition: log_event.cc:3044
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:705
virtual bool write_data_body(Basic_ostream *)
Definition: log_event.h:794
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:934
void register_temp_buf(char *buf, bool free_in_destructor=true)
Definition: log_event.h:865
virtual uint8 mts_number_dbs()
Definition: log_event.h:1084
void free_temp_buf()
Definition: log_event.h:869
bool is_mts_group_isolated()
Definition: log_event.h:1091
ulong exec_time
Definition: log_event.h:658
virtual bool is_rbr_logging_format() const
Return true if the event has to be logged using RBR for DMLs.
Definition: log_event.h:808
virtual ~Log_event()
Definition: log_event.h:864
enum_event_logging_type event_logging_type
Defines when information, i.e.
Definition: log_event.h:682
enum_event_logging_type
Definition: log_event.h:592
@ EVENT_NORMAL_LOGGING
Definition: log_event.h:598
@ EVENT_IMMEDIATE_LOGGING
Definition: log_event.h:603
@ EVENT_INVALID_LOGGING
Definition: log_event.h:593
@ EVENT_CACHE_LOGGING_COUNT
Definition: log_event.h:607
char * temp_buf
Definition: log_event.h:648
virtual bool is_sbr_logging_format() const
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:804
virtual int pack_info(Protocol *protocol)
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:1053
bool is_using_immediate_logging() const
Definition: log_event.h:842
void set_relay_log_event()
Definition: log_event.h:823
virtual bool write_data_header(Basic_ostream *)
Definition: log_event.h:793
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:1086
bool is_artificial_event() const
Definition: log_event.h:824
virtual int do_update_pos(Relay_log_info *rli)
Advance relay log coordinates.
Definition: log_event.cc:996
virtual bool ends_group() const
Definition: log_event.h:1110
bool need_checksum()
A decider of whether to trigger checksum computation or not.
Definition: log_event.cc:1115
virtual void claim_memory_ownership(bool claim)
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
Definition: log_event.h:862
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:2621
This is the subclass of Previous_gtids_event and Log_event It is used to record the gtid_executed in ...
Definition: log_event.h:4223
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:13756
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:13763
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:13737
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:13700
int do_apply_event(Relay_log_info const *) override
Primitive to apply an event to the database.
Definition: log_event.h:4315
int add_to_set(Gtid_set *gtid_set) const
Add all GTIDs from this event to the given Gtid_set.
Definition: log_event.cc:13726
size_t get_data_size() override
Definition: log_event.h:4246
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:4310
bool write(Basic_ostream *ostream) override
Definition: log_event.h:4254
~Previous_gtids_log_event() override=default
const uchar * get_buf()
Return the encoded buffer, or NULL on error.
Definition: log_event.h:4291
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:13674
Definition: protocol.h:33
A Query event is written to the binary log whenever the database is modified on the master,...
Definition: log_event.h:1296
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:5142
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:1502
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:1472
Query_log_event(const Query_log_event &)=delete
bool is_trans_keyword() const
Definition: log_event.h:1440
mysql::binlog::event::Log_event_header::Byte * data_buf
Definition: log_event.h:1298
bool m_skip_temp_tables_handling_by_worker
Instructs the applier to skip temporary tables handling.
Definition: log_event.h:1340
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:5192
Query_log_event()
The simplest constructor that could possibly work.
Definition: log_event.cc:3676
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:5156
virtual ulong get_post_header_size_for_derived()
Definition: log_event.h:1424
bool starts_group() const override
Notice, DDL queries are logged without BEGIN/COMMIT parentheses and identification of such single-que...
Definition: log_event.h:1480
uchar mts_number_dbs() override
Definition: log_event.h:1391
my_thread_id slave_proxy_id
Definition: log_event.h:1313
void set_skip_temp_tables_handling_by_worker()
Definition: log_event.h:1342
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:5245
bool has_ddl_committed
The flag indicates whether the DDL query has been (already) committed or not.
Definition: log_event.h:1333
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:4422
~Query_log_event() override
Definition: log_event.h:1409
void attach_temp_tables_worker(THD *, const Relay_log_info *)
Associating slave Worker thread to a subset of temporary tables.
Definition: log_event.cc:4399
bool write(Basic_ostream *ostream) override
Query_log_event::write().
Definition: log_event.cc:3383
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:1321
bool is_query_prefix_match(const char *pattern, uint p_len)
Definition: log_event.h:1496
uint8 get_mts_dbs(Mts_db_names *arg, Rpl_filter *rpl_filter) override
Definition: log_event.h:1366
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:1506
const char * get_db() override
Definition: log_event.h:1353
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:3332
bool ends_group() const override
Definition: log_event.h:1485
bool is_skip_temp_tables_handling_by_worker()
Definition: log_event.h:1346
virtual bool write_post_header_for_derived(Basic_ostream *)
Definition: log_event.h:1417
void detach_temp_tables_worker(THD *, const Relay_log_info *)
Dissociating slave Worker thread from its thd->temporary_tables to possibly update the involved entri...
Definition: log_event.cc:4413
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0.
Definition: log_event.h:1685
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:5986
bool is_sbr_logging_format() const override
Return true if the event has to be logged using SBR for DMLs.
Definition: log_event.h:1719
~Rand_log_event() override=default
size_t get_data_size() override
Definition: log_event.h:1714
Rand_log_event(const Rand_log_event &)=delete
Rand_log_event(Rand_log_event &&) noexcept=delete
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:6031
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:6012
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:5962
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:6026
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:5980
Definition: rpl_rli.h:206
This will be deprecated when we move to using sequence ids.
Definition: log_event.h:2038
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:5674
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:5562
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:5817
~Rotate_log_event() override=default
Rotate_log_event(Rotate_log_event &&) noexcept=delete
Rotate_log_event(const Rotate_log_event &)=delete
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:5635
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:5645
size_t get_data_size() override
Definition: log_event.h:2058
Definition: log_event.h:2668
bool is_enabled()
If instrumentation is enabled this member function SHALL return true.
Definition: log_event.h:2695
Rows_applier_psi_stage & operator=(const Rows_applier_psi_stage &rhs)
void inc_n_rows_applied(ulonglong delta)
Updates the counter of processed rows.
Definition: log_event.h:2741
ulonglong m_n_rows_applied
Counter that is unconditionally incremented on each row that is processed.
Definition: log_event.h:2683
ulonglong get_n_rows_applied()
Gets the value of the counter of rows that have been processed.
Definition: log_event.h:2747
Rows_applier_psi_stage()
Definition: log_event.h:2686
void update_work_estimated_and_completed(const uchar *cursor, const uchar *begin, const uchar *end)
This member function shall update the progress and reestimate the remaining work needed.
Definition: log_event.h:2708
void set_progress(PSI_stage_progress *progress)
Definition: log_event.h:2688
void end_work()
Resets this object.
Definition: log_event.h:2732
PSI_stage_progress * m_progress
A cached pointer to this stage PSI_stage_progress.
Definition: log_event.h:2676
Definition: log_event.h:2967
KEY ** m_key_info
Definition: log_event.h:2987
Key_compare(KEY **ki=nullptr)
Definition: log_event.h:2980
bool operator()(uchar *k1, uchar *k2) const
Definition: log_event.h:2981
Common base class for all row-containing log events.
Definition: log_event.h:2785
MY_BITMAP write_set_backup
This bitmap is used as a backup for the write set while we calculate the values for any hidden genera...
Definition: log_event.h:3289
uint32 m_bitbuf[128/(sizeof(uint32) *8)]
Definition: log_event.h:2948
uchar * m_rows_end
Definition: log_event.h:2957
int close_record_scan()
Does the cleanup.
Definition: log_event.cc:8880
virtual mysql::binlog::event::Log_event_type get_general_type_code()=0
int handle_idempotent_and_ignored_errors(Relay_log_info const *rli, int *err)
Private member function called while handling idempotent errors.
Definition: log_event.cc:8825
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:10409
virtual int do_before_row_operations(const Relay_log_info *const log)=0
uchar * m_rows_buf
Definition: log_event.h:2955
void decide_row_lookup_algorithm_and_key()
Definition: log_event.cc:8433
uint m_rows_lookup_algorithm
The algorithm to use while searching for rows using the before image.
Definition: log_event.h:2929
TABLE * m_table
Definition: log_event.h:2908
ColumnViewPtr m_column_view
Wrapper around TABLE *m_table that abstracts the table field set iteration logic, since it is not man...
Definition: log_event.h:3089
bool is_rbr_logging_format() const override
Return true if the event has to be logged using RBR for DMLs.
Definition: log_event.h:3076
int do_hash_row(Relay_log_info const *rli)
Populates the m_hash when using HASH_SCAN.
Definition: log_event.cc:9262
@ RLE_NO_FLAGS
Definition: log_event.h:2821
Hash_slave_rows m_hash
Hash table that will hold the entries for while using HASH_SCAN algorithm to search and update/delete...
Definition: log_event.h:2923
uchar * m_distinct_key_spare_buf
A spare buffer which will be used when saving the distinct keys for doing an index scan with HASH_SCA...
Definition: log_event.h:2995
int do_hash_scan_and_update(Relay_log_info const *rli)
Implementation of the hash_scan and update algorithm.
Definition: log_event.cc:9505
int add_row_data(uchar *data, size_t length)
Definition: log_event.h:2846
uint m_key_index
Definition: log_event.h:2965
int do_apply_row(Relay_log_info const *rli)
Commodity wrapper around do_exec_row(), that deals with resetting the thd reference in the table.
Definition: log_event.cc:8855
int row_operations_scan_and_key_setup()
Definition: log_event.cc:8531
MY_BITMAP const * get_cols_ai() const
Definition: log_event.h:2855
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:10271
Rows_log_event(const Rows_log_event &)=delete
MY_BITMAP m_local_cols_ai
Bitmap denoting columns available in the after-image as they appear in the table setup.
Definition: log_event.h:2945
uchar * m_key
Definition: log_event.h:2964
int do_index_scan_and_update(Relay_log_info const *rli)
Implementation of the index scan and update algorithm.
Definition: log_event.cc:9031
int do_scan_and_update(Relay_log_info const *rli)
This member function scans the table and applies the changes that had been previously hashed.
Definition: log_event.cc:9330
virtual int do_add_row_data(uchar *data, size_t length)
Definition: log_event.cc:8166
Rows_applier_psi_stage m_psi_progress
Definition: log_event.h:2788
static bool is_trx_retryable_upon_engine_error(int error)
Helper function to check whether the storage engine error allows for the transaction to be retried or...
Definition: log_event.cc:8622
size_t get_data_size() override
Definition: log_event.cc:8133
const char * get_db() override
Definition: log_event.h:2879
uint16 flag_set
Definition: log_event.h:2798
row_lookup_mode
Definition: log_event.h:2800
@ ROW_LOOKUP_INDEX_SCAN
Definition: log_event.h:2803
@ ROW_LOOKUP_UNDEFINED
Definition: log_event.h:2801
@ ROW_LOOKUP_NOT_NEEDED
Definition: log_event.h:2802
@ ROW_LOOKUP_TABLE_SCAN
Definition: log_event.h:2804
@ ROW_LOOKUP_HASH_SCAN
Definition: log_event.h:2805
virtual bool read_write_bitmaps_cmp(const TABLE *table) const =0
Compares the table's read/write_set with the columns included in this event's before-image and/or aft...
virtual int skip_after_image_for_update_event(const Relay_log_info *rli, const uchar *curr_bi_start)
Seek past the after-image of an update event, in case a row was processed without reading the after-i...
Definition: log_event.h:3214
bool is_auto_inc_in_extra_columns(const Relay_log_info *const rli)
Helper function to check whether there is an auto increment column on the table where the event is to...
Definition: log_event.cc:8604
uchar * m_rows_cur
Definition: log_event.h:2956
const mysql::binlog::event::Table_id & get_table_id() const
Definition: log_event.h:2856
uint m_row_count
Definition: log_event.h:2882
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:9609
int next_record_scan(bool first_read)
Fetches next row.
Definition: log_event.cc:8893
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:10515
int do_table_scan_and_update(Relay_log_info const *rli)
Implementation of the legacy table_scan and update algorithm.
Definition: log_event.cc:9526
MY_BITMAP m_local_cols
Bitmap denoting columns available in the image as they appear in the table setup.
Definition: log_event.h:2917
int open_record_scan()
Initializes scanning of rows.
Definition: log_event.cc:8955
void clear_flags(flag_set flags_arg)
Definition: log_event.h:2826
virtual int do_exec_row(const Relay_log_info *const rli)=0
std::set< uchar *, Key_compare >::iterator m_itr
Definition: log_event.h:2990
enum_error
Enumeration of the errors that can be returned.
Definition: log_event.h:2811
@ ERR_TABLE_LIMIT_EXCEEDED
No more room for tables.
Definition: log_event.h:2814
@ ERR_BAD_TABLE_DEF
Table definition does not match.
Definition: log_event.h:2816
@ ERR_OPEN_FAILURE
Failure to open table.
Definition: log_event.h:2812
@ ERR_RBR_TO_SBR
daisy-chanining RBR to SBR not allowed
Definition: log_event.h:2817
@ ERR_OUT_OF_MEM
Out of memory.
Definition: log_event.h:2815
@ ERR_OK
No error.
Definition: log_event.h:2813
int row_operations_scan_and_key_teardown(int error)
Definition: log_event.cc:8574
int update_generated_columns(MY_BITMAP const &fields_to_update)
Updates the generated columns of the TABLE object referenced by m_table, that have an active bit in t...
Definition: log_event.cc:8110
virtual int do_after_row_operations(const Relay_log_info *const log, int error)=0
MY_BITMAP const * get_cols() const
Definition: log_event.h:2854
std::set< uchar *, Key_compare > m_distinct_keys
Definition: log_event.h:2989
void do_post_row_operations(Relay_log_info const *rli, int err)
Private member function called after updating/deleting a row.
Definition: log_event.cc:8737
Rows_log_event(Rows_log_event &&) noexcept=delete
const uchar * m_curr_row
Definition: log_event.h:2962
MY_BITMAP m_cols_ai
Bitmap for columns available in the after image, if present.
Definition: log_event.h:2938
int add_key_to_distinct_keyset()
Populates the m_distinct_keys with unique keys to be modified during HASH_SCAN over keys.
Definition: log_event.cc:9011
KEY * m_key_info
Definition: log_event.h:2966
int unpack_current_row(const Relay_log_info *const rli, MY_BITMAP const *cols, bool is_after_image, bool only_seek=false)
Unpack the current row image from the event into m_table->record[0].
Definition: log_event.cc:8017
int do_update_pos(Relay_log_info *rli) override
The method either increments the relay log position or commits the current statement and increments t...
Definition: log_event.cc:10377
~Rows_log_event() override
Definition: log_event.cc:7997
void set_flags(flag_set flags_arg)
Definition: log_event.h:2825
friend class Old_rows_log_event
Definition: log_event.h:3281
const uchar * m_curr_row_end
Definition: log_event.h:2963
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:10482
uint32 m_bitbuf_ai[128/(sizeof(uint32) *8)]
Definition: log_event.h:2949
MY_BITMAP m_cols
Definition: log_event.h:2910
It is used to record the original query for the rows events in RBR.
Definition: log_event.h:3776
size_t get_data_size() override
Definition: log_event.h:3825
~Rows_query_log_event() override
Definition: log_event.h:3818
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:13004
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:12987
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:12902
int pack_info(Protocol *) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:12909
Rows_query_log_event(THD *thd_arg, const char *query, size_t query_len)
Definition: log_event.h:3779
Rpl_filter.
Definition: rpl_filter.h:214
const char * get_rewrite_db(const char *db, size_t *new_len)
Definition: rpl_filter.cc:1176
bool is_rewrite_empty()
Definition: rpl_filter.cc:571
Mix-in to handle the message logging and reporting for relay log info and master log info structures.
Definition: rpl_reporting.h:54
Definition: rpl_rli_pdb.h:501
Definition: log_event.h:1962
mysql::binlog::event::Log_event_type get_type_code() const override
Definition: log_event.h:1991
Stop_log_event()
Definition: log_event.h:1971
~Stop_log_event() override=default
Stop_log_event(const Stop_log_event &)=delete
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:6976
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:2000
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:6996
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:685
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Table_map_log_event which maps a table definition to a number.
Definition: log_event.h:2440
@ TM_GENERATED_INVISIBLE_PK_F
Table has generated invisible primary key.
Definition: log_event.h:2483
@ TM_BIT_LEN_EXACT_F
Definition: log_event.h:2476
@ TM_NO_FLAGS
Definition: log_event.h:2475
@ TM_REFERRED_FK_DB_F
Definition: log_event.h:2477
Table_map_log_event(Table_map_log_event &&) noexcept=delete
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:11041
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:10906
Table_map_log_event(const Table_map_log_event &)=delete
uint8 mts_number_dbs() override
Definition: log_event.h:2532
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:11050
const char * get_db_name() const
Definition: log_event.h:2524
virtual int save_field_metadata()
Save the field metadata based on the real_type of the field.
Definition: log_event.cc:10603
bool init_set_str_value_field()
Definition: log_event.cc:11358
flag_set get_flags(flag_set flag) const
Definition: log_event.h:2486
~Table_map_log_event() override
bool init_geometry_type_field()
Definition: log_event.cc:11406
bool init_charset_field(std::function< bool(const Field *)> include_type, Optional_metadata_field_type default_charset_type, Optional_metadata_field_type column_charset_type)
Capture and serialize character sets.
Definition: log_event.cc:11252
bool init_primary_key_field()
Definition: log_event.cc:11437
enum_flag
Definition: log_event.h:2463
@ ENUM_FLAG_COUNT
Nothing here right now, but the flags support is there in preparation for changes that are coming.
Definition: log_event.h:2470
bool is_rbr_logging_format() const override
Return true if the event has to be logged using RBR for DMLs.
Definition: log_event.h:2594
const mysql::binlog::event::Table_id & get_table_id() const
Definition: log_event.h:2520
bool init_column_visibility_field()
Definition: log_event.cc:11485
const char * get_table_name() const
Definition: log_event.h:2523
uint8 get_mts_dbs(Mts_db_names *arg, Rpl_filter *rpl_filter) override
Definition: log_event.h:2544
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:11055
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:11069
@ TYPE_CODE
Definition: log_event.h:2449
bool init_enum_str_value_field()
Definition: log_event.cc:11385
bool init_column_name_field()
Definition: log_event.cc:11346
ColumnViewPtr m_column_view
Wrapper around TABLE *m_table that abstracts the table field set iteration logic, since it is not man...
Definition: log_event.h:2618
const char * get_db() override
Definition: log_event.h:2531
size_t get_data_size() override
Definition: log_event.h:2526
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:11517
TABLE * m_table
Definition: log_event.h:2604
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:10787
void init_metadata_fields()
Capture the optional metadata fields which should be logged into table_map_log_event and serialize th...
Definition: log_event.cc:11198
enum_error
Enumeration of the errors that can be returned.
Definition: log_event.h:2454
@ ERR_OK
No error.
Definition: log_event.h:2456
@ ERR_TABLE_LIMIT_EXCEEDED
No more room for tables.
Definition: log_event.h:2457
@ ERR_OPEN_FAILURE
Failure to open table.
Definition: log_event.h:2455
@ ERR_OUT_OF_MEM
Out of memory.
Definition: log_event.h:2458
@ ERR_BAD_TABLE_DEF
Table definition does not match.
Definition: log_event.h:2459
@ ERR_RBR_TO_SBR
daisy-chanining RBR to SBR not allowed
Definition: log_event.h:2460
bool has_generated_invisible_primary_key() const
Definition: log_event.cc:10783
bool init_vector_dimensionality_field()
Definition: log_event.cc:11423
StringBuffer< 1024 > m_metadata_buf
Definition: log_event.h:2607
bool init_signedness_field()
Definition: log_event.cc:11221
This is the subclass of Transaction_context_event and Log_event This class encodes the transaction_co...
Definition: log_event.h:4345
static int get_data_set_size(std::list< const char * > *set)
Definition: log_event.cc:13998
void add_write_set(const char *hash)
Add a hash which identifies a inserted/updated/deleted row on the ongoing transaction.
Definition: log_event.cc:14010
my_thread_id get_thread_id() const
Return the id of the committing thread.
Definition: log_event.h:4449
Transaction_context_log_event(const char *server_uuid_arg, bool using_trans, my_thread_id thread_id_arg, bool is_gtid_specified)
Definition: log_event.cc:13772
void add_read_set(const char *hash)
Add a hash which identifies a read row on the ongoing transaction.
Definition: log_event.cc:14015
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:13890
Gtid_set * get_snapshot_version()
Return the transaction snapshot timestamp.
Definition: log_event.h:4439
size_t get_data_size() override
Definition: log_event.cc:13897
int do_apply_event(Relay_log_info const *) override
Primitive to apply an event to the database.
Definition: log_event.h:4399
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:13865
bool read_snapshot_version()
Read snapshot version from encoded buffers.
Definition: log_event.cc:13978
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:13857
Gtid_set * snapshot_version
A gtid_set which is used to store the transaction set used for conflict detection.
Definition: log_event.h:4351
size_t get_event_length()
Definition: log_event.cc:13909
Tsid_map * tsid_map
The Tsid_map to use for creating the Gtid_set.
Definition: log_event.h:4348
std::list< const char * > * get_read_set()
Return a pointer to read-set list.
Definition: log_event.h:4426
size_t get_snapshot_version_size()
Definition: log_event.cc:13992
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:13914
bool is_gtid_specified() const
Return true if transaction has GTID fully specified, false otherwise.
Definition: log_event.h:4456
~Transaction_context_log_event() override
Definition: log_event.cc:13840
bool write_data_set(Basic_ostream *ostream, std::list< const char * > *set)
Definition: log_event.cc:13958
std::list< const char * > * get_write_set()
Return a pointer to write-set list.
Definition: log_event.h:4414
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:13930
size_t to_string(char *buf, ulong len) const
Definition: log_event.cc:13851
const char * get_server_uuid()
Return the server uuid.
Definition: log_event.h:4444
bool write_snapshot_version(Basic_ostream *ostream)
Definition: log_event.cc:13942
Definition: log_event.h:3883
Mts_db_names & get_mts_db_names()
Definition: log_event.h:3892
Mts_db_names m_mts_db_names
Definition: log_event.h:3886
void reset()
Definition: log_event.h:3891
virtual ~Applier_context()
Definition: log_event.h:3890
Applier_context()=default
Definition: log_event.h:3879
size_t get_event_length()
Definition: log_event.h:3927
void set_mts_dbs(Mts_db_names &arg)
Definition: log_event.cc:14263
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:14242
uint8 get_mts_dbs(Mts_db_names *arg, Rpl_filter *rpl_filter) override
The method fills in pointers to event's database name c-strings to a supplied array.
Definition: log_event.cc:14248
bool apply_payload_event(Relay_log_info const *rli, const uchar *event_buf)
Definition: log_event.cc:14334
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:14422
bool ends_group() const override
Definition: log_event.cc:14469
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:14427
~Transaction_payload_log_event() override=default
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:14459
size_t get_data_size() override
Definition: log_event.cc:14234
Transaction_payload_log_event(THD *thd_arg, const char *payload, uint64_t payload_size, uint16_t compression_type, uint64_t uncompressed_size)
Definition: log_event.h:3895
Applier_context m_applier_ctx
Definition: log_event.h:3932
uint8 mts_number_dbs() override
Definition: log_event.cc:14279
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:14283
Represents a bidirectional map between TSID and SIDNO.
Definition: rpl_gtid.h:750
rpl_sidno add_tsid(const Tsid &tsid)
Add the given TSID to this map if it does not already exist.
Definition: rpl_gtid_tsid_map.cc:61
Log row updates with a before image.
Definition: log_event.h:3418
@ TYPE_CODE
Definition: log_event.h:3422
int do_exec_row(const Relay_log_info *const) override
Definition: log_event.cc:12673
static mysql::binlog::event::Log_event_type get_update_rows_event_type(const THD *thd_arg)
Auxiliary function used in the (THD*, ...) constructor to determine the type code based on configurat...
Definition: log_event.cc:12560
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:12588
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:3451
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:12633
int do_after_row_operations(const Relay_log_info *const, int) override
Definition: log_event.cc:12666
Update_rows_log_event(THD *, TABLE *, const mysql::binlog::event::Table_id &table_id, MY_BITMAP const *cols_bi, MY_BITMAP const *cols_ai, bool is_transactional, const unsigned char *extra_row_ndb_info)
int do_before_row_operations(const Relay_log_info *const) override
Definition: log_event.cc:12640
mysql::binlog::event::Log_event_type get_general_type_code() override
Definition: log_event.h:3460
~Update_rows_log_event() override
Definition: log_event.cc:12611
int skip_after_image_for_update_event(const Relay_log_info *rli, const uchar *curr_bi_start) override
Seek past the after-image of an update event, in case a row was processed without reading the after-i...
Definition: log_event.cc:9204
void init(MY_BITMAP const *cols)
Definition: log_event.cc:12595
Every time a query uses the value of a user variable, a User_var_log_event is written before the Quer...
Definition: log_event.h:1893
~User_var_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:1947
bool is_deferred()
Definition: log_event.h:1936
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:6924
query_id_t query_id
Definition: log_event.h:1903
void set_deferred(query_id_t qid)
Definition: log_event.h:1941
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:6545
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:6814
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:6943
User_var_log_event(const User_var_log_event &)=delete
User_var_log_event(User_var_log_event &&) noexcept=delete
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:6929
bool deferred
Definition: log_event.h:1902
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:6643
This is the subclass of View_change_log_event and Log_event This class created the view_change_log_ev...
Definition: log_event.h:4485
std::map< std::string, std::string > * get_certification_info()
Returns the certification info.
Definition: log_event.h:4553
int do_update_pos(Relay_log_info *rli) override
Advance relay log coordinates.
Definition: log_event.cc:14155
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:14082
bool write_data_body(Basic_ostream *ostream) override
Definition: log_event.cc:14172
void set_seq_number(rpl_gno number)
Set the certification sequence number.
Definition: log_event.h:4562
char * get_view_id()
Returns the view id.
Definition: log_event.h:4535
size_t get_size_data_map(std::map< std::string, std::string > *map)
Definition: log_event.cc:14063
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:14088
size_t get_data_size() override
Definition: log_event.cc:14054
bool write_data_header(Basic_ostream *ostream) override
Definition: log_event.cc:14161
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:14114
rpl_gno get_seq_number()
Returns the certification sequence number.
Definition: log_event.h:4567
bool write_data_map(Basic_ostream *ostream, std::map< std::string, std::string > *map)
Definition: log_event.cc:14180
void set_certification_info(std::map< std::string, std::string > *info, size_t *event_size)
Sets the certification info in the event.
Definition: log_event.cc:14216
View_change_log_event(const View_change_log_event &)=delete
size_t to_string(char *buf, ulong len) const
Definition: log_event.cc:14077
Log row insertions and updates.
Definition: log_event.h:3329
int do_before_row_operations(const Relay_log_info *const) override
Definition: log_event.cc:12003
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:12450
mysql::binlog::event::Log_event_type get_general_type_code() override
Definition: log_event.h:3362
Write_rows_log_event(THD *, TABLE *, const mysql::binlog::event::Table_id &table_id, bool is_transactional, const unsigned char *extra_row_ndb_info)
Definition: log_event.cc:11973
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:3351
int do_exec_row(const Relay_log_info *const) override
Definition: log_event.cc:12427
int write_row(const Relay_log_info *const, const bool)
Write the current row into event's table.
Definition: log_event.cc:12192
@ TYPE_CODE
Definition: log_event.h:3333
int do_after_row_operations(const Relay_log_info *const, int) override
Definition: log_event.cc:12111
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:11983
Similar to Xid_log_event except that.
Definition: log_event.h:1832
static const int xid_bufs_size
Definition: log_event.h:1835
bool do_commit(THD *thd) override
Differs from Xid_log_event::do_commit in that it carries out XA prepare (not the commit).
Definition: log_event.cc:6501
XA_prepare_log_event(THD *thd_arg, XID *xid_arg, bool one_phase_arg=false)
Definition: log_event.h:1839
size_t get_data_size() override
Definition: log_event.h:1855
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:6439
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:6467
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:6425
mysql::binlog::event::Log_event_type get_type_code() const override
Definition: log_event.h:1852
Definition: log_event.h:1758
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:6411
bool ends_group() const override
Definition: log_event.h:1771
Xid_apply_log_event(THD *thd_arg, mysql::binlog::event::Log_event_header *header_arg, mysql::binlog::event::Log_event_footer *footer_arg)
Definition: log_event.h:1761
virtual bool do_commit(THD *thd_arg)=0
int do_apply_event_worker(Slave_worker *rli) override
Worker commits Xid transaction and in case of its transactional info table marks the current group as...
Definition: log_event.cc:6166
~Xid_apply_log_event() override=default
int do_apply_event(Relay_log_info const *rli) override
Primitive to apply an event to the database.
Definition: log_event.cc:6239
This is the subclass of Xid_event defined in libbinlogevent, An XID event is generated for a commit o...
Definition: log_event.h:1781
~Xid_log_event() override=default
bool write(Basic_ostream *ostream) override
Definition: log_event.cc:6092
Xid_log_event(const Xid_log_event &)=delete
int pack_info(Protocol *protocol) override
Stores a string representation of this event in the Protocol.
Definition: log_event.cc:6069
size_t get_data_size() override
Definition: log_event.h:1807
bool do_commit(THD *thd_arg) override
The methods combines few commit actions to make it usable as in the single- so multi- threaded case.
Definition: log_event.cc:6125
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:6086
Xid_log_event(Xid_log_event &&) noexcept=delete
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
This event is created to contain the file data.
Definition: load_data_events.h:274
const char * db
'db' is filled when the event is created in mysql_load() (the event needs to have a 'db' member to be...
Definition: load_data_events.h:311
unsigned int block_len
Definition: load_data_events.h:298
Event for the first block of file to be loaded, its only difference from Append_block event is that t...
Definition: load_data_events.h:358
@ APPEND_BLOCK_HEADER_LEN
Definition: binlog_event.h:874
@ IGNORABLE_HEADER_LEN
Definition: binlog_event.h:888
@ FORMAT_DESCRIPTION_HEADER_LEN
Definition: binlog_event.h:878
@ INCIDENT_HEADER_LEN
Definition: binlog_event.h:886
@ DELETE_FILE_HEADER_LEN
Definition: binlog_event.h:875
@ ROTATE_HEADER_LEN
Definition: binlog_event.h:872
const Log_event_header * header() const
Return a const pointer to the header of the log event.
Definition: binlog_event.h:951
Binary_log_event & operator=(const Binary_log_event &)=default
const Log_event_footer * footer() const
Return a const pointer to the footer of the log event.
Definition: binlog_event.h:959
DELETE_FILE_EVENT occurs when the LOAD DATA failed on the master.
Definition: load_data_events.h:202
const char * db
Definition: load_data_events.h:215
Log row deletions.
Definition: rows_event.h:1136
Event responsible for LOAD DATA execution, it similar to Query_event but before executing the query i...
Definition: load_data_events.h:119
GTID stands for Global Transaction IDentifier It is composed of two parts:
Definition: control_events.h:1017
int get_server_version_length() const
We only store the immediate_server_version if both server versions are the same.
Definition: control_events.h:1237
int get_commit_timestamp_length() const
Definition: control_events.h:1227
int get_commit_group_ticket_length() const
Returns the length of the packed commit_group_ticket field.
Definition: control_events.cpp:620
bool is_tagged() const
Checks whether this Gtid log event contains a tag.
Definition: control_events.cpp:650
unsigned long long get_trx_length() const
Definition: control_events.h:1316
static const int POST_HEADER_LENGTH
Total length of post header.
Definition: control_events.h:1255
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1670
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1744
Base class for ignorable log events.
Definition: control_events.h:675
Class representing an incident, an occurrence out of the ordinary, that happened on the master.
Definition: control_events.h:441
char * message
Definition: control_events.h:492
Incident_event(enum_incident incident_arg)
This will create an Incident_event with an empty message and set the type_code as INCIDENT_EVENT in t...
Definition: control_events.h:462
size_t message_length
Definition: control_events.h:493
enum_incident
Enumeration of the incidents that can occur for the server.
Definition: control_events.h:446
@ INCIDENT_NONE
No incident.
Definition: control_events.h:448
@ INCIDENT_COUNT
Shall be last event of the enumeration.
Definition: control_events.h:452
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
Definition: control_events.h:1381
size_t buf_size
Definition: control_events.h:1409
const unsigned char * buf
Definition: control_events.h:1410
A Query_event is created for each query that modifies the database, unless the query is logged row-ba...
Definition: statement_events.h:451
const char * db
Definition: statement_events.h:535
const char * query
Definition: statement_events.h:534
unsigned char mts_accessed_dbs
Definition: statement_events.h:640
char mts_accessed_db_names[MAX_DBS_IN_EVENT_MTS][NAME_LEN]
Definition: statement_events.h:641
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
When a binary log file exceeds a size limit, a ROTATE_EVENT is written at the end of the file that po...
Definition: control_events.h:117
unsigned int flags
Definition: control_events.h:121
size_t ident_len
Definition: control_events.h:120
Common base class for all row-containing binary log events.
Definition: rows_event.h:882
Table_id m_table_id
Actual event type.
Definition: rows_event.h:954
enum_flag get_flags() const
Definition: rows_event.h:1034
uint16_t m_flags
Definition: rows_event.h:955
Rows query event type, which is a subclass of the Ignorable_event, to record the original query for t...
Definition: rows_event.h:1177
char * m_rows_query
Definition: rows_event.h:1207
size_t m_rows_query_length
Definition: rows_event.h:1208
A stop event is written to the log files under these circumstances:
Definition: control_events.h:380
Stop_event()
It is the minimal constructor, and all it will do is set the type_code as STOP_EVENT in the header ob...
Definition: control_events.h:386
Each table share has a table id, it is mainly used for row based replication.
Definition: table_id.h:42
In row-based mode, every row operation event is preceded by a Table_map_event which maps a table defi...
Definition: rows_event.h:525
unsigned char * m_coltype
Definition: rows_event.h:686
std::string m_tblnam
Definition: rows_event.h:683
uint16_t flag_set
Definition: rows_event.h:534
unsigned char * m_null_bits
field metadata
Definition: rows_event.h:693
Optional_metadata_field_type
DEFAULT_CHARSET and COLUMN_CHARSET don't appear together, and ENUM_AND_SET_DEFAULT_CHARSET and ENUM_A...
Definition: rows_event.h:548
unsigned long m_colcnt
Definition: rows_event.h:685
unsigned char * m_field_metadata
Definition: rows_event.h:692
unsigned long m_field_metadata_size
The size of field metadata buffer set by calling save_field_metadata()
Definition: rows_event.h:691
size_t m_data_size
Definition: rows_event.h:678
std::string m_dbnam
event data size
Definition: rows_event.h:681
flag_set m_flags
Definition: rows_event.h:676
unsigned int m_optional_metadata_len
Definition: rows_event.h:694
Table_id m_table_id
Event post header contents.
Definition: rows_event.h:675
unsigned char * m_optional_metadata
Definition: rows_event.h:695
This class is used to combine the information of the ongoing transaction including the write set and ...
Definition: control_events.h:1469
bool gtid_specified
Definition: control_events.h:1505
uint32_t thread_id
Definition: control_events.h:1504
std::list< const char * > read_set
Definition: control_events.h:1509
const char * server_uuid
Definition: control_events.h:1503
std::list< const char * > write_set
Definition: control_events.h:1508
Event that encloses all the events of a transaction.
Definition: control_events.h:736
Transaction_payload_event(const Transaction_payload_event &)=delete
An unknown event should never occur.
Definition: binlog_event.h:989
Log row updates with a before image.
Definition: rows_event.h:1117
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
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
This class is used to add view change markers in the binary log when a member of the group enters or ...
Definition: control_events.h:1569
long long int seq_number
Definition: control_events.h:1623
std::map< std::string, std::string > certification_info
Definition: control_events.h:1625
char view_id[ENCODED_VIEW_ID_MAX_LEN]
Definition: control_events.h:1621
Log row insertions.
Definition: rows_event.h:1099
An XA_prepare event is generated for a XA prepared transaction.
Definition: control_events.h:589
XA_prepare_event(void *xid_arg, bool oph_arg)
The minimal constructor of XA_prepare_event, it initializes the instance variable xid and set the typ...
Definition: control_events.h:618
void * xid
Definition: control_events.h:609
An XID event is generated for a commit of a transaction that modifies one or more tables of an XA-cap...
Definition: control_events.h:524
Xid_event(uint64_t xid_arg)
The minimal constructor of Xid_event, it initializes the instance variable xid and set the type_code ...
Definition: control_events.h:531
uint64_t xid
Definition: control_events.h:541
Represents Transaction Source Identifier which is composed of source UUID and transaction tag.
Definition: tsid.h:44
static std::size_t get_size(const T &arg)
Definition: serializer_impl.hpp:70
Definition: partition_info.h:209
Used to hold information about file and file structure in exchange via non-DB file (....
Definition: sql_exchange.h:79
A table definition from the master.
Definition: rpl_utility.h:249
static uint vector_column_count(const unsigned char *types, ulong size)
Return the number of VECTOR columns.
Definition: rpl_utility.h:315
Maps table id's (integers) to table pointers.
Definition: rpl_tblmap.h:51
static char buf[MAX_BUF]
Definition: conf_to_src.cc:73
Contains the classes representing events operating in the replication stream properties.
#define U
Definition: ctype-tis620.cc:74
uint64_t sql_mode_t
Definition: dd_event.h:39
#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 MAX_TIME_ZONE_NAME_LENGTH
Maximum length of time zone name that we support (Time zone name is char(64) in db).
Definition: binlog_event.h:122
#define OVER_MAX_DBS_IN_EVENT_MTS
When the actual number of databases exceeds MAX_DBS_IN_EVENT_MTS the value of OVER_MAX_DBS_IN_EVENT_M...
Definition: binlog_event.h:116
void close_cached_file(IO_CACHE *cache)
Definition: mf_cache.cc:87
bool my_b_inited(const IO_CACHE *info)
Definition: my_sys.h:483
#define MY_WME
Definition: my_sys.h:130
int my_b_copy_to_file(IO_CACHE *cache, FILE *file)
Definition: mf_iocache2.cc:72
bool reinit_io_cache(IO_CACHE *info, enum cache_type type, my_off_t seek_offset, bool use_async_io, bool clear_cache)
Definition: mf_iocache.cc:328
@ WRITE_CACHE
Definition: my_sys.h:286
std::pair< bool, mysql::binlog::event::Log_event_basic_info > extract_log_event_basic_info(Log_event *log_event)
Extract basic info about an event: type, query, is it ignorable.
Definition: log_event.cc:14582
size_t my_strmov_quoted_identifier(THD *thd, char *buffer, const char *identifier, size_t length)
Definition: log_event.cc:14542
bool is_atomic_ddl_event(Log_event const *evt)
The function checks the argument event properties to deduce whether it represents an atomic DDL.
Definition: log_event.h:4598
char * str_to_hex(char *to, const char *from, size_t len)
Transforms a string into "" or its expression in 0x... form.
Definition: log_event.cc:801
bool binary_event_serialize(EVENT *ev, Basic_ostream *ostream)
Serialize an binary event to the given output stream.
Definition: log_event.h:4634
bool net_field_length_checked(const uchar **packet, size_t *max_length, T *out)
Read an integer in net_field_length format, guarding against read out of bounds and advancing the pos...
Definition: log_event.cc:761
TYPELIB binlog_checksum_typelib
Definition: log_event.cc:221
bool is_atomic_ddl(THD *thd, bool using_trans)
The function lists all DDL instances that are supported for crash-recovery (WL9175).
Definition: log_event.cc:3749
int ignored_error_code(int err_code)
Ignore error code specified on command line.
Definition: log_event.cc:607
MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH]
Definition: log_event.h:125
std::unique_ptr< cs::util::ReplicatedColumnsView > ColumnViewPtr
Definition: log_event.h:121
bool is_any_gtid_event(const Log_event *evt)
Definition: log_event.h:4570
size_t my_strmov_quoted_identifier_helper(int q, char *buffer, const char *identifier, size_t length)
Definition: log_event.cc:14555
bool is_session_control_event(Log_event *evt)
Check if the given event is a session control event, one of User_var_event, Intvar_event or Rand_even...
Definition: log_event.h:4584
PSI_memory_key key_memory_Rows_query_log_event_rows_query
Definition: log_event.cc:196
const int64 SEQ_MAX_TIMESTAMP
Maximum value of binlog logical timestamp.
Definition: log_event.h:355
MYSQL_PLUGIN_IMPORT ulong server_id
Definition: log_event.h:118
static bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file, bool flush_stream)
Definition: log_event.h:3831
PSI_memory_key key_memory_Incident_log_event_message
Definition: log_event.cc:195
bool slave_execute_deferred_events(THD *thd)
The function is called by slave applier in case there are active table filtering rules to force gathe...
Definition: log_event.cc:6051
int append_query_string(const THD *thd, const CHARSET_INFO *csinfo, String const *from, String *to)
Append a version of the 'from' string suitable for use in a query to the 'to' string.
Definition: log_event.cc:819
int get_rpl_part_id(partition_info *part_info)
This method is used to extract the partition_id from a partitioned table.
Definition: log_event.cc:7772
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49
#define mysql_stage_set_work_completed(P1, P2)
Definition: mysql_stage.h:115
#define mysql_stage_get_work_estimated(P1)
Definition: mysql_stage.h:143
#define mysql_stage_set_work_estimated(P1, P2)
Definition: mysql_stage.h:140
static int flag
Definition: hp_test1.cc:40
int key_cmp2(KEY_PART_INFO *key_part, const uchar *key1, uint key1_length, const uchar *key2, uint key2_length)
Compare two given keys.
Definition: key.cc:505
#define free(A)
Definition: lexyy.cc:915
LOAD DATA INFILE is not written to the binary log like other statements.
static int native_strncasecmp(const char *s1, const char *s2, size_t n)
Definition: m_string.h:216
static bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
Quite unlike other C comparison functions ending with 'cmp', e.g.
Definition: my_bitmap.h:108
Abstraction functions over zlib/intrinsics.
std::uint32_t ha_checksum
Definition: my_checksum.h:106
Header for compiler-dependent features.
#define DBUG_EXECUTE_IF(keyword, a1)
Definition: my_dbug.h:171
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
#define DBUG_EVALUATE_IF(keyword, a1, a2)
Definition: my_dbug.h:179
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
int64_t int64
Definition: my_inttypes.h:68
#define MYF(v)
Definition: my_inttypes.h:97
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
#define FN_REFLEN
Definition: my_io.h:83
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Allocates size bytes of memory.
Definition: my_memory.cc:57
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
Common header for many mysys elements.
static my_thread_id thread_id
Definition: my_thr_init.cc:63
uint32 my_thread_id
Definition: my_thread_local.h:34
static char * query
Definition: myisam_ftdump.cc:47
Common definition between mysql server & client.
unsigned int net_length_size(unsigned long long num)
#define SERVER_VERSION_LENGTH
Definition: mysql_com.h:74
Instrumentation helpers for stages.
static void print_header(MYSQL_RES *result)
Definition: mysqladmin.cc:1279
static uint verbose
Definition: mysqlcheck.cc:66
static bool replace
Definition: mysqlimport.cc:70
static bool ignore
Definition: mysqlimport.cc:70
static const char * sql_mode
Definition: mysqlslap.cc:199
const char * delimiter
Definition: mysqlslap.cc:160
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
const std::string charset("charset")
const std::string FILE("FILE")
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
bool is_valid(const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *is_valid) noexcept
Decides if a geometry is valid.
Definition: is_valid.cc:95
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:908
void print(trx_t *trx, dict_index_t *index, std::ostream &out, ref_t ref, bool fatal)
Print information about the given LOB.
Definition: lob0impl.cc:1333
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
@ INCIDENT_EVENT
Something out of the ordinary happened on the master.
Definition: binlog_event.h:322
@ FORMAT_DESCRIPTION_EVENT
Definition: binlog_event.h:304
@ EXECUTE_LOAD_QUERY_EVENT
Definition: binlog_event.h:307
@ ROWS_QUERY_LOG_EVENT
Definition: binlog_event.h:337
@ WRITE_ROWS_EVENT
Version 2 of the Row events.
Definition: binlog_event.h:340
@ DELETE_ROWS_EVENT
Definition: binlog_event.h:342
@ XA_PREPARE_LOG_EVENT
Definition: binlog_event.h:354
@ QUERY_EVENT
Definition: binlog_event.h:292
@ UNKNOWN_EVENT
Every time you add a type, you have to.
Definition: binlog_event.h:286
@ PREVIOUS_GTIDS_LOG_EVENT
Definition: binlog_event.h:347
@ UPDATE_ROWS_EVENT
Definition: binlog_event.h:341
@ RAND_EVENT
Definition: binlog_event.h:302
@ TABLE_MAP_EVENT
Definition: binlog_event.h:309
@ STOP_EVENT
Definition: binlog_event.h:293
@ INTVAR_EVENT
Definition: binlog_event.h:295
@ USER_VAR_EVENT
Definition: binlog_event.h:303
@ ROTATE_EVENT
Definition: binlog_event.h:294
@ SLAVE_EVENT
Definition: binlog_event.h:297
const uint64_t INVALID_XID
The following constant represents the maximum of MYSQL_XID domain.
Definition: statement_events.h:49
enum_load_dup_handling
Elements of this enum describe how LOAD DATA handles duplicates.
Definition: load_data_events.h:64
constexpr auto tsid_max_length
Maximum TSID text length (without null character)
Definition: tsid.h:38
HARNESS_EXPORT std::string string_format(const char *format,...)
Definition: utilities.cc:64
Definition: instrumented_condition_variable.h:32
const char * begin(const char *const c)
Definition: base64.h:44
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
const char * db_name
Definition: rules_table_service.cc:55
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2884
std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > > map
Specialization of map which uses ut_allocator.
Definition: ut0new.h:2894
Performance schema instrumentation interface.
required string type
Definition: replication_group_member_actions.proto:34
required string event
Definition: replication_group_member_actions.proto:32
Contains the classes representing events which are used for row based replication.
mysql::gtid::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of mysql::gtid::gno_t.
Definition: rpl_gtid.h:113
const int MAX_GNO_TEXT_LENGTH
The length of MAX_GNO when printed in decimal.
Definition: rpl_gtid.h:287
enum_gtid_type
Enumeration of different types of values for Gtid_specification, i.e, the different internal states t...
Definition: rpl_gtid.h:3882
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:109
mysql::gtid::Tsid Tsid
Definition: rpl_gtid_state.cc:56
enum_row_image_type
Definition: rpl_record.h:40
ulonglong my_xid
Definition: handler.h:1235
File containing constants that can be used throughout the server.
Our own string classes, used pervasively throughout the executor.
Contains the classes representing statement events occurring in the replication stream.
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:29
char * strmake(char *dst, const char *src, size_t length)
Definition: strmake.cc:42
Definition: m_ctype.h:421
This struct represents a specification of a GTID for a statement to be executed: either "AUTOMATIC",...
Definition: rpl_gtid.h:3999
enum_gtid_type type
The type of this GTID.
Definition: rpl_gtid.h:4012
Gtid gtid
The GTID: { SIDNO, GNO } if type == GTID; { 0, 0 } if type == AUTOMATIC or ANONYMOUS.
Definition: rpl_gtid.h:4018
rpl_gno gno
GNO of this Gtid.
Definition: rpl_gtid.h:1107
const char * str
Definition: mysql_lex_string.h:41
Definition: my_bitmap.h:43
Definition: log_event.h:507
const char * name[MAX_DBS_IN_EVENT_MTS]
Definition: log_event.h:508
int num
Definition: log_event.h:509
void reset_and_dispose()
Definition: log_event.h:513
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:63
LEX_CSTRING db
Definition: table.h:782
TABLE_SHARE * s
Definition: table.h:1422
Legends running throughout the module:
Definition: rpl_rli_pdb.h:77
static bool is_any_gtid_event(const Log_event_type &type)
Helps to identify any GTID event - returns true for GTID_LOG_EVENT, GTID_TAGGED_LOG_EVENT and ANONYMO...
Definition: binlog_event.h:391
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: xa.h:83
Include file for Sun RPC to compile out of the box.
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
synode_no q[FIFO_SIZE]
Definition: xcom_base.cc:4086
static uint64_t cache_size
Definition: xcom_cache.cc:362