MySQL 8.0.39
Source Code Documentation
binary_log::Incident_event Class Reference

Class representing an incident, an occurrence out of the ordinary, that happened on the master. More...

#include <control_events.h>

Inheritance diagram for binary_log::Incident_event:
[legend]

Public Types

enum  enum_incident { INCIDENT_NONE = 0 , INCIDENT_LOST_EVENTS = 1 , INCIDENT_COUNT }
 Enumeration of the incidents that can occur for the server. More...
 
- Public Types inherited from binary_log::Binary_log_event
enum  enum_post_header_length {
  QUERY_HEADER_MINIMAL_LEN = (4 + 4 + 1 + 2) , QUERY_HEADER_LEN = (QUERY_HEADER_MINIMAL_LEN + 2) , STOP_HEADER_LEN = 0 , START_V3_HEADER_LEN = (2 + ST_SERVER_VER_LEN + 4) ,
  ROTATE_HEADER_LEN = 8 , INTVAR_HEADER_LEN = 0 , APPEND_BLOCK_HEADER_LEN = 4 , DELETE_FILE_HEADER_LEN = 4 ,
  RAND_HEADER_LEN = 0 , USER_VAR_HEADER_LEN = 0 , FORMAT_DESCRIPTION_HEADER_LEN = (START_V3_HEADER_LEN + 1 + LOG_EVENT_TYPES) , XID_HEADER_LEN = 0 ,
  BEGIN_LOAD_QUERY_HEADER_LEN = APPEND_BLOCK_HEADER_LEN , ROWS_HEADER_LEN_V1 = 8 , TABLE_MAP_HEADER_LEN = 8 , EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN = (4 + 4 + 4 + 1) ,
  EXECUTE_LOAD_QUERY_HEADER_LEN , INCIDENT_HEADER_LEN = 2 , HEARTBEAT_HEADER_LEN = 0 , IGNORABLE_HEADER_LEN = 0 ,
  ROWS_HEADER_LEN_V2 = 10 , TRANSACTION_CONTEXT_HEADER_LEN = 18 , VIEW_CHANGE_HEADER_LEN = 52 , XA_PREPARE_HEADER_LEN = 0 ,
  TRANSACTION_PAYLOAD_HEADER_LEN = 0
}
 The lengths for the fixed data part of each event. More...
 

Public Member Functions

enum_incident get_incident_type ()
 
char * get_message ()
 
 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 the header object in Binary_log_event. More...
 
 Incident_event (const char *buf, const Format_description_event *fde)
 Constructor of Incident_event The buffer layout is as follows: More...
 
- Public Member Functions inherited from binary_log::Binary_log_event
virtual ~Binary_log_event ()=0
 
 Binary_log_event (const Binary_log_event &)=default
 
 Binary_log_event (Binary_log_event &&)=default
 
Binary_log_eventoperator= (const Binary_log_event &)=default
 
Binary_log_eventoperator= (Binary_log_event &&)=default
 
enum Log_event_type get_event_type () const
 Helper method. More...
 
const Log_event_headerheader () const
 Return a const pointer to the header of the log event. More...
 
Log_event_headerheader ()
 Return a non-const pointer to the header of the log event. More...
 
const Log_event_footerfooter () const
 Return a const pointer to the footer of the log event. More...
 
Log_event_footerfooter ()
 Return a non-const pointer to the footer of the log event. More...
 
Event_readerreader ()
 Returns a reference to the event Event_reader object. More...
 

Protected Attributes

enum_incident incident
 
char * message
 
size_t message_length
 

Additional Inherited Members

- Static Public Attributes inherited from binary_log::Binary_log_event
static const int LOG_EVENT_TYPES = (ENUM_END_EVENT - 1)
 
- Protected Member Functions inherited from binary_log::Binary_log_event
 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...
 

Detailed Description

Class representing an incident, an occurrence out of the ordinary, that happened on the master.

The event is used to inform the slave that something out of the ordinary happened on the master that might cause the database to be in an inconsistent state.

Binary Format

Incident event format
Symbol Format Description
INCIDENT 2 Incident number as an unsigned integer
MSGLEN 1 Message length as an unsigned integer
MESSAGE MSGLEN The message, if present. Not null terminated.

Member Enumeration Documentation

◆ enum_incident

Enumeration of the incidents that can occur for the server.

Enumerator
INCIDENT_NONE 

No incident.

INCIDENT_LOST_EVENTS 

There are possibly lost events in the replication stream.

INCIDENT_COUNT 

Shall be last event of the enumeration.

Constructor & Destructor Documentation

◆ Incident_event() [1/2]

binary_log::Incident_event::Incident_event ( enum_incident  incident_arg)
inlineexplicit

This will create an Incident_event with an empty message and set the type_code as INCIDENT_EVENT in the header object in Binary_log_event.

◆ Incident_event() [2/2]

binary_log::Incident_event::Incident_event ( const char *  buf,
const Format_description_event fde 
)

Constructor of Incident_event The buffer layout is as follows:

+-----------------------------------------------------+
| Incident_number | message_length | Incident_message |
+-----------------------------------------------------+

Incident number codes are listed in binlog_evnet.h. The only code currently used is INCIDENT_LOST_EVENTS, which indicates that there may be lost events (a "gap") in the replication stream that requires databases to be resynchronized.

Parameters
bufContains the serialized event.
fdeAn FDE event (see Rotate_event constructor for more info).

Member Function Documentation

◆ get_incident_type()

enum_incident binary_log::Incident_event::get_incident_type ( )
inline

◆ get_message()

char * binary_log::Incident_event::get_message ( )
inline

Member Data Documentation

◆ incident

enum_incident binary_log::Incident_event::incident
protected

◆ message

char* binary_log::Incident_event::message
protected

◆ message_length

size_t binary_log::Incident_event::message_length
protected

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