![]() |
MySQL 9.2.0
Source Code Documentation
|
Log row deletions. More...
#include <log_event.h>
Public Member Functions | |
Delete_rows_log_event (THD *, TABLE *, const mysql::binlog::event::Table_id &, bool is_transactional, const unsigned char *extra_row_ndb_info) | |
Delete_rows_log_event (const char *buf, const mysql::binlog::event::Format_description_event *description_event) | |
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 after-image. More... | |
void | claim_memory_ownership (bool claim) override |
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed. More... | |
![]() | |
Rows_log_event (Rows_log_event &&) noexcept=delete | |
Rows_log_event & | operator= (Rows_log_event &&) noexcept=delete |
Rows_log_event (const Rows_log_event &)=delete | |
Rows_log_event & | operator= (const Rows_log_event &)=delete |
~Rows_log_event () override | |
void | set_flags (flag_set flags_arg) |
void | clear_flags (flag_set flags_arg) |
flag_set | get_flags (flag_set flags_arg) const |
int | pack_info (Protocol *protocol) override |
Stores a string representation of this event in the Protocol. More... | |
int | add_row_data (uchar *data, size_t length) |
size_t | get_data_size () override |
MY_BITMAP const * | get_cols () const |
MY_BITMAP const * | get_cols_ai () const |
const mysql::binlog::event::Table_id & | get_table_id () const |
bool | write_data_header (Basic_ostream *ostream) override |
bool | write_data_body (Basic_ostream *ostream) override |
const char * | get_db () override |
![]() | |
Rows_event (Log_event_type type_arg) | |
Constructs an event directly. More... | |
Rows_event (const char *buf, const Format_description_event *fde) | |
The constructor is responsible for decoding the event contained in the buffer. More... | |
~Rows_event () override | |
unsigned long long | get_table_id () const |
enum_flag | get_flags () const |
uint32_t | get_null_bits_len () const |
unsigned long | get_width () const |
std::string | get_enum_flag_string () const |
Gets the flags listed as strings. More... | |
![]() | |
virtual | ~Binary_log_event ()=0 |
Binary_log_event (const Binary_log_event &)=default | |
Binary_log_event (Binary_log_event &&)=default | |
Binary_log_event & | operator= (const Binary_log_event &)=default |
Binary_log_event & | operator= (Binary_log_event &&)=default |
enum Log_event_type | get_event_type () const |
Helper method. More... | |
const Log_event_header * | header () const |
Return a const pointer to the header of the log event. More... | |
Log_event_header * | header () |
Return a non-const pointer to the header of the log event. More... | |
const Log_event_footer * | footer () const |
Return a const pointer to the footer of the log event. More... | |
Log_event_footer * | footer () |
Return a non-const pointer to the footer of the log event. More... | |
Event_reader & | reader () |
Returns a reference to the event Event_reader object. More... | |
![]() | |
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. More... | |
Log_event (THD *thd_arg, uint16 flags_arg, enum_event_cache_type cache_type_arg, enum_event_logging_type logging_type_arg, mysql::binlog::event::Log_event_header *header, mysql::binlog::event::Log_event_footer *footer) | |
int | net_send (Protocol *protocol, const char *log_name, my_off_t pos) |
Only called by SHOW BINLOG EVENTS. More... | |
void * | operator new (size_t size) |
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. More... | |
virtual bool | write (Basic_ostream *ostream) |
time_t | get_time () |
Prints a "session_var=value" string. More... | |
virtual mysql::binlog::event::Log_event_type | get_type_code () const |
virtual bool | is_sbr_logging_format () const |
Return true if the event has to be logged using SBR for DMLs. More... | |
bool | is_valid () |
void | set_artificial_event () |
void | set_relay_log_event () |
bool | is_artificial_event () const |
bool | is_relay_log_event () const |
bool | is_ignorable_event () const |
bool | is_no_filter_event () const |
bool | is_using_trans_cache () const |
bool | is_using_stmt_cache () const |
bool | is_using_immediate_logging () const |
Log_event (mysql::binlog::event::Log_event_header *header, mysql::binlog::event::Log_event_footer *footer) | |
virtual | ~Log_event () |
void | register_temp_buf (char *buf, bool free_in_destructor=true) |
void | free_temp_buf () |
const char * | get_type_str () const |
Returns the human readable name of this event's type. More... | |
bool | is_mts_sequential_exec () const |
Is called from get_mts_execution_mode() to. More... | |
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. More... | |
bool | contains_partition_info (bool) |
virtual uint8 | mts_number_dbs () |
bool | is_mts_group_isolated () |
virtual bool | starts_group () const |
Events of a certain type can start or end a group of events treated transactionally wrt binlog. More... | |
virtual bool | ends_group () const |
int | apply_event (Relay_log_info *rli) |
Apply the event to the database. More... | |
int | apply_gtid_event (Relay_log_info *rli) |
Apply the GTID event in curr_group_data to the database. More... | |
int | update_pos (Relay_log_info *rli) |
Update the relay log position. More... | |
enum_skip_reason | shall_skip (Relay_log_info *rli) |
Decide if the event shall be skipped, and the reason for skipping it. More... | |
virtual int | do_apply_event_worker (Slave_worker *w) |
![]() | |
Delete_rows_event (const char *buf, const Format_description_event *fde) | |
Delete_rows_event () | |
Static Public Member Functions | |
static bool | binlog_row_logging_function (THD *thd, TABLE *table, bool is_transactional, const uchar *before_record, const uchar *after_record) |
![]() | |
static std::string | get_flag_string (enum_flag flag) |
Gets a string describing the flags. More... | |
![]() | |
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 is used only by SHOW BINLOG EVENTS. More... | |
static void | operator delete (void *ptr, size_t) |
static void * | operator new (size_t, void *ptr) |
static void | operator delete (void *, void *) |
static const char * | get_type_str (mysql::binlog::event::Log_event_type type) |
Returns the human readable name of the given event type. More... | |
static const char * | get_type_str (uint type) |
Get the name of an event type, or "Unknown" if out of range. More... | |
static bool | is_mts_sequential_exec (mysql::binlog::event::Log_event_type type_code) |
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) |
Protected Member Functions | |
mysql::binlog::event::Log_event_type | get_general_type_code () override |
int | do_before_row_operations (const Relay_log_info *const) override |
int | do_after_row_operations (const Relay_log_info *const, int) override |
int | do_exec_row (const Relay_log_info *const) override |
![]() | |
Rows_log_event (THD *, TABLE *, const mysql::binlog::event::Table_id &table_id, MY_BITMAP const *cols, bool is_transactional, mysql::binlog::event::Log_event_type event_type, const unsigned char *extra_row_ndb_info) | |
Rows_log_event (const char *row_data, const mysql::binlog::event::Format_description_event *description_event) | |
virtual int | do_add_row_data (uchar *data, size_t length) |
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]. More... | |
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 the parameter bitset fields_to_update . More... | |
void | decide_row_lookup_algorithm_and_key () |
int | row_operations_scan_and_key_setup () |
int | row_operations_scan_and_key_teardown (int error) |
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 be applied. More... | |
bool | is_rbr_logging_format () const override |
Return true if the event has to be logged using RBR for DMLs. More... | |
![]() | |
Binary_log_event (Log_event_type type_code) | |
This constructor is used to initialize the type_code of header object m_header. More... | |
Binary_log_event (const char **buf, const Format_description_event *fde) | |
This constructor will create a new object of Log_event_header and initialize the variable m_header, which in turn will be used to initialize Log_event's member common_header. More... | |
![]() | |
uint32 | write_header_to_memory (uchar *buf) |
Writes the common header of this event to the given memory buffer. More... | |
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. More... | |
bool | write_footer (Basic_ostream *ostream) |
bool | need_checksum () |
A decider of whether to trigger checksum computation or not. More... | |
enum_skip_reason | continue_group (Relay_log_info *rli) |
Helper function to ignore an event w.r.t. More... | |
Additional Inherited Members | |
![]() | |
uint | m_row_count |
![]() | |
Extra_row_info | m_extra_row_info |
![]() | |
char * | temp_buf |
bool | m_free_temp_buf_in_destructor |
ulong | exec_time |
uint32 | server_id |
ulong | rbr_exec_mode |
A storage to cache the global system variable's value. More... | |
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. More... | |
enum_event_logging_type | event_logging_type |
Defines when information, i.e. More... | |
ha_checksum | crc |
Placeholder for event checksum while writing to binlog. More... | |
ulong | mts_group_idx |
Index in rli->gaq array to indicate a group that this event is purging. More... | |
mysql::binlog::event::Log_event_header * | common_header |
The Log_event_header class contains the variable present in the common header. More... | |
mysql::binlog::event::Log_event_footer * | common_footer |
The Log_event_footer class contains the variable present in the common footer. More... | |
Relay_log_info * | worker |
MTS: associating the event with either an assigned Worker or Coordinator. More... | |
ulonglong | future_event_relay_log_pos |
A copy of the main rli value stored into event to pass to MTS worker rli. More... | |
THD * | thd |
db_worker_hash_entry * | mts_assigned_partitions [MAX_DBS_IN_EVENT_MTS] |
Partition info associate with event to deliver to MTS event applier. More... | |
![]() | |
static const int | LOG_EVENT_TYPES = (ENUM_END_EVENT - 1) |
![]() | |
enum | enum_event_cache_type { EVENT_INVALID_CACHE = 0 , EVENT_STMT_CACHE , EVENT_TRANSACTIONAL_CACHE , EVENT_NO_CACHE , EVENT_CACHE_COUNT } |
enum | enum_event_logging_type { EVENT_INVALID_LOGGING = 0 , EVENT_NORMAL_LOGGING , EVENT_IMMEDIATE_LOGGING , EVENT_CACHE_LOGGING_COUNT } |
![]() | |
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 not. More... | |
![]() | |
Rows_applier_psi_stage | m_psi_progress |
TABLE * | m_table |
MY_BITMAP | m_cols |
MY_BITMAP | m_local_cols |
Bitmap denoting columns available in the image as they appear in the table setup. More... | |
Hash_slave_rows | m_hash |
Hash table that will hold the entries for while using HASH_SCAN algorithm to search and update/delete rows. More... | |
uint | m_rows_lookup_algorithm |
The algorithm to use while searching for rows using the before image. More... | |
MY_BITMAP | m_cols_ai |
Bitmap for columns available in the after image, if present. More... | |
MY_BITMAP | m_local_cols_ai |
Bitmap denoting columns available in the after-image as they appear in the table setup. More... | |
uint32 | m_bitbuf [128/(sizeof(uint32) *8)] |
uint32 | m_bitbuf_ai [128/(sizeof(uint32) *8)] |
uchar * | m_rows_buf |
uchar * | m_rows_cur |
uchar * | m_rows_end |
const uchar * | m_curr_row |
const uchar * | m_curr_row_end |
uchar * | m_key |
uint | m_key_index |
KEY * | m_key_info |
std::set< uchar *, Key_compare > | m_distinct_keys |
std::set< uchar *, Key_compare >::iterator | m_itr |
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_SCAN search algorithm. More... | |
![]() | |
Log_event_type | m_type |
Table_id | m_table_id |
Actual event type. More... | |
uint16_t | m_flags |
unsigned long | m_width |
Flags for row-level events. More... | |
uint32_t | n_bits_len |
The width of the columns bitmap. More... | |
uint16_t | var_header_len |
value determined by (m_width + 7) / 8 More... | |
std::vector< uint8_t > | columns_before_image |
std::vector< uint8_t > | columns_after_image |
std::vector< uint8_t > | row |
Log row deletions.
The event contain several delete rows for a table. Note that each event contains only rows for one table.
RESPONSIBILITIES
COLLABORATION
Row_writer Create the event and add rows to the event. Row_reader Extract the rows from the event.
Delete_rows_log_event::Delete_rows_log_event | ( | THD * | thd_arg, |
TABLE * | tbl_arg, | ||
const mysql::binlog::event::Table_id & | tid, | ||
bool | is_transactional, | ||
const unsigned char * | extra_row_ndb_info | ||
) |
Delete_rows_log_event::Delete_rows_log_event | ( | const char * | buf, |
const mysql::binlog::event::Format_description_event * | description_event | ||
) |
|
static |
|
overridevirtual |
Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed.
claim | True - claim ownership of the memory False - disclaim ownership of the memory |
Reimplemented from Log_event.
|
overrideprotectedvirtual |
Implements Rows_log_event.
|
overrideprotectedvirtual |
Implements Rows_log_event.
|
overrideprotectedvirtual |
Implements Rows_log_event.
|
inlineoverrideprotectedvirtual |
Implements Rows_log_event.
|
inlineoverridevirtual |
Compares the table's read/write_set with the columns included in this event's before-image and/or after-image.
Each subclass (Write/Update/Delete) implements this function by comparing on the image(s) pertinent to the subclass.
[in] | table | The table to compare this events bitmaps against. |
true | if sets match |
false | otherwise (following bitmap_cmp return logic). |
Implements Rows_log_event.