MySQL 9.1.0
Source Code Documentation
Xid_apply_log_event Class Referenceabstract

#include <log_event.h>

Inheritance diagram for Xid_apply_log_event:
[legend]

Protected Member Functions

 Xid_apply_log_event (THD *thd_arg, mysql::binlog::event::Log_event_header *header_arg, mysql::binlog::event::Log_event_footer *footer_arg)
 
 Xid_apply_log_event (mysql::binlog::event::Log_event_header *header_arg, mysql::binlog::event::Log_event_footer *footer_arg)
 
 ~Xid_apply_log_event () override=default
 
bool ends_group () const override
 
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. More...
 
int do_apply_event (Relay_log_info const *rli) override
 Primitive to apply an event to the database. More...
 
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 done in the Coordinator's Group Assigned Queue. More...
 
virtual bool do_commit (THD *thd_arg)=0
 
- Protected Member Functions inherited from Log_event
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...
 
virtual int do_update_pos (Relay_log_info *rli)
 Advance relay log coordinates. More...
 

Additional Inherited Members

- Public Types inherited from Log_event
enum  enum_skip_reason { EVENT_SKIP_NOT , EVENT_SKIP_IGNORE , EVENT_SKIP_COUNT }
 Enumeration of what kinds of skipping (and non-skipping) that can occur when the slave executes an event. More...
 
enum  enum_mts_event_exec_mode { EVENT_EXEC_PARALLEL , EVENT_EXEC_ASYNC , EVENT_EXEC_SYNC , EVENT_EXEC_CAN_NOT }
 
- Public Member Functions inherited from Log_event
 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...
 
virtual int pack_info (Protocol *protocol)
 Stores a string representation of this event in the Protocol. More...
 
virtual const char * get_db ()
 
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 bool write_data_header (Basic_ostream *)
 
virtual bool write_data_body (Basic_ostream *)
 
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...
 
virtual bool is_rbr_logging_format () const
 Return true if the event has to be logged using RBR 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 void claim_memory_ownership (bool claim)
 Allow thread to CLAIM or DISCLAIM the ownership of this object depends on the parameter value passed. More...
 
virtual ~Log_event ()
 
void register_temp_buf (char *buf, bool free_in_destructor=true)
 
void free_temp_buf ()
 
virtual size_t get_data_size ()
 
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...
 
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...
 
- Static Public Member Functions inherited from Log_event
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)
 
- Public Attributes inherited from Log_event
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_headercommon_header
 The Log_event_header class contains the variable present in the common header. More...
 
mysql::binlog::event::Log_event_footercommon_footer
 The Log_event_footer class contains the variable present in the common footer. More...
 
Relay_log_infoworker
 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...
 
THDthd
 
db_worker_hash_entrymts_assigned_partitions [MAX_DBS_IN_EVENT_MTS]
 Partition info associate with event to deliver to MTS event applier. More...
 
- Protected Types inherited from Log_event
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 }
 

Constructor & Destructor Documentation

◆ Xid_apply_log_event() [1/2]

Xid_apply_log_event::Xid_apply_log_event ( THD thd_arg,
mysql::binlog::event::Log_event_header header_arg,
mysql::binlog::event::Log_event_footer footer_arg 
)
inlineprotected

◆ Xid_apply_log_event() [2/2]

Xid_apply_log_event::Xid_apply_log_event ( mysql::binlog::event::Log_event_header header_arg,
mysql::binlog::event::Log_event_footer footer_arg 
)
inlineprotected

◆ ~Xid_apply_log_event()

Xid_apply_log_event::~Xid_apply_log_event ( )
overrideprotecteddefault

Member Function Documentation

◆ do_apply_event()

int Xid_apply_log_event::do_apply_event ( Relay_log_info const *  rli)
overrideprotectedvirtual

Primitive to apply an event to the database.

This is where the change to the database is made.

Note
The primitive is protected instead of private, since there is a hierarchy of actions to be performed in some cases.
See also
Format_description_log_event::do_apply_event()
Parameters
rliPointer to relay log info structure
Return values
0Event applied successfully
errnoError code if event application failed

Commit operation expects the global transaction state variable 'xa_state'to be set to 'XA_NOTR'. In order to simulate commit failure we set the 'xa_state' to 'XA_IDLE' so that the commit reports 'ER_XAER_RMFAIL' error.

Reimplemented from Log_event.

◆ do_apply_event_worker()

int Xid_apply_log_event::do_apply_event_worker ( Slave_worker w)
overrideprotectedvirtual

Worker commits Xid transaction and in case of its transactional info table marks the current group as done in the Coordinator's Group Assigned Queue.

Returns
zero as success or non-zero as an error

Reimplemented from Log_event.

◆ do_commit()

virtual bool Xid_apply_log_event::do_commit ( THD thd_arg)
protectedpure virtual

Implemented in XA_prepare_log_event, and Xid_log_event.

◆ do_shall_skip()

Log_event::enum_skip_reason Xid_apply_log_event::do_shall_skip ( Relay_log_info rli)
overrideprotectedvirtual

Decide if this event shall be skipped or not and the reason for skipping it.

The default implementation decide that the event shall be skipped if either:

  • the server id of the event is the same as the server id of the server and rli->replicate_same_server_id is true, or
  • if rli->slave_skip_counter is greater than zero.
See also
do_apply_event
do_update_pos
Return values
Log_event::EVENT_SKIP_NOTThe event shall not be skipped and should be applied.
Log_event::EVENT_SKIP_IGNOREThe event shall be skipped by just ignoring it, i.e., the slave skip counter shall not be changed. This happends if, for example, the originating server id of the event is the same as the server id of the slave.
Log_event::EVENT_SKIP_COUNTThe event shall be skipped because the slave skip counter was non-zero. The caller shall decrease the counter by one.

Reimplemented from Log_event.

◆ ends_group()

bool Xid_apply_log_event::ends_group ( ) const
inlineoverrideprotectedvirtual
Returns
true if the event ends a group (transaction) false otherwise

Reimplemented from Log_event.


The documentation for this class was generated from the following files: