34#ifndef MYSQL_BINLOG_EVENT_CONTROL_EVENTS_H
35#define MYSQL_BINLOG_EVENT_CONTROL_EVENTS_H
139 unsigned int flags_arg, uint64_t pos_arg)
142 ident_len(ident_len_arg ? ident_len_arg : strlen(new_log_ident_arg)),
167 void print_event_info(std::ostream &)
override;
168 void print_long_info(std::ostream &)
override;
348 void print_event_info(std::ostream &info)
override;
349 void print_long_info(std::ostream &info)
override;
398 void print_event_info(std::ostream &)
override {}
399 void print_long_info(std::ostream &info)
override;
486 void print_event_info(std::ostream &info)
override;
487 void print_long_info(std::ostream &info)
override;
542 void print_event_info(std::ostream &info)
override;
543 void print_long_info(std::ostream &info)
override;
634 void print_event_info(std::ostream &)
override {}
635 void print_long_info(std::ostream &)
override {}
691 void print_event_info(std::ostream &)
override {}
692 void print_long_info(std::ostream &)
override {}
831 uint16_t compression_type,
832 uint64_t uncompressed_size);
921 void print_event_info(std::ostream &)
override;
922 void print_long_info(std::ostream &)
override;
1064 long long int sequence_number_arg,
1065 bool may_have_sbr_stmts_arg,
1066 unsigned long long int original_commit_timestamp_arg,
1067 unsigned long long int immediate_commit_timestamp_arg,
1068 uint32_t original_server_version_arg,
1069 uint32_t immediate_server_version_arg)
1079 if (may_have_sbr_stmts_arg) {
1086 void print_event_info(std::ostream &)
override {}
1087 void print_long_info(std::ostream &)
override {}
1112 return std::make_tuple(
1114 mysql::serialization::define_field_with_size<Uuid::BYTE_LENGTH>(
1125 this->original_commit_timestamp =
1150 return std::make_tuple(
1152 mysql::serialization::define_field_with_size<Uuid::BYTE_LENGTH>(
1163 return this->original_commit_timestamp !=
1282 constexpr std::size_t max_tagged_length =
1283 Encoder_type::get_max_size<Gtid_event>();
1285 return max_tagged_length;
1342 std::uint64_t value);
1404 void print_event_info(std::ostream &)
override {}
1405 void print_long_info(std::ostream &)
override {}
1491 std::list<const char *> *
set,
1492 uint32_t remaining_buffer);
1497 void print_event_info(std::ostream &)
override {}
1498 void print_long_info(std::ostream &)
override {}
1588 void print_event_info(std::ostream &)
override {}
1589 void print_long_info(std::ostream &)
override {}
1701 void print_event_info(std::ostream &info)
override;
1702 void print_long_info(std::ostream &info)
override;
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Contains the classes representing events occurring in the replication stream.
#define LOG_EVENT_HEADER_LEN
Definition: binlog_event.h:443
#define LOG_EVENT_MINIMAL_HEADER_LEN
Fixed header length, where 4.x and 5.0 agree.
Definition: binlog_event.h:457
#define ST_SERVER_VER_LEN
The length of the array server_version, which is used to store the version of MySQL server.
Definition: binlog_event.h:425
Container class that provides a sequence of buffers to the caller.
This is the abstract base class for binary log events.
Definition: binlog_event.h:859
@ TRANSACTION_PAYLOAD_HEADER_LEN
Definition: binlog_event.h:901
GTID stands for Global Transaction IDentifier It is composed of two parts:
Definition: control_events.h:1016
static const int ORIGINAL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1206
int get_server_version_length() const
We only store the immediate_server_version if both server versions are the same.
Definition: control_events.h:1236
mysql::gtid::Tsid tsid_parent_struct
Definition: control_events.h:1243
uint64_t transaction_length
The length of the transaction in bytes.
Definition: control_events.h:1040
mysql::gtid::Tag_plain Tag_plain
Definition: control_events.h:1104
static const int ENCODED_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1211
Tag_plain generate_tag_specification() const
Definition: control_events.h:1268
static const int ENCODED_SID_LENGTH
Definition: control_events.h:1196
int get_commit_timestamp_length() const
Definition: control_events.h:1226
int64_t sequence_number
Definition: control_events.h:1025
mysql::serialization::Field_encode_predicate Field_encode_predicate
Definition: control_events.h:1102
static const int64_t MIN_GNO
Definition: control_events.h:1246
static constexpr std::size_t get_max_payload_size()
Get maximum size of event payload.
Definition: control_events.h:1281
uint32_t original_server_version
The version of the server where the transaction was originally executed.
Definition: control_events.h:1318
bool may_have_sbr_stmts
Transaction might have changes logged with SBR.
Definition: control_events.h:1029
Gtid_event(long long int last_committed_arg, long long int sequence_number_arg, bool may_have_sbr_stmts_arg, unsigned long long int original_commit_timestamp_arg, unsigned long long int immediate_commit_timestamp_arg, uint32_t original_server_version_arg, uint32_t immediate_server_version_arg)
Constructor.
Definition: control_events.h:1063
uint32_t immediate_server_version
The version of the immediate server.
Definition: control_events.h:1320
int64_t last_committed
Definition: control_events.h:1024
unsigned const char FLAG_MAY_HAVE_SBR
GTID flags constants.
Definition: control_events.h:1027
static constexpr int COMMIT_GROUP_TICKET_LENGTH
Definition: control_events.h:1094
static const int IMMEDIATE_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1205
static const std::int64_t GNO_END
One-past-the-max value of GNO.
Definition: control_events.h:1248
static constexpr std::uint64_t kGroupTicketUnset
Definition: control_events.h:1099
mysql::gtid::Tsid get_tsid() const
Definition: control_events.h:1252
void update_untagged_transaction_length()
Updates transaction length which was not yet considered.
Definition: control_events.cpp:657
gtid_info gtid_info_struct
Definition: control_events.h:1242
int get_commit_group_ticket_length() const
Returns the length of the packed commit_group_ticket field.
Definition: control_events.cpp:620
unsigned char gtid_flags
GTID flags, used bits:
Definition: control_events.h:1032
static const int LOGICAL_TIMESTAMP_TYPECODE_LENGTH
Length of typecode for logical timestamps.
Definition: control_events.h:1199
void set_commit_group_ticket_and_update_transaction_length(std::uint64_t value)
Set the commit_group_ticket and update the transaction length if needed, that is, if the commit_group...
Definition: control_events.cpp:628
void update_tagged_transaction_length(std::size_t trx_len_without_event_len)
Updated transaction length based on transaction length without event length.
Definition: control_events.cpp:672
uint64_t immediate_commit_timestamp
Timestamp when the transaction was committed on the nearest source.
Definition: control_events.h:1036
static const int TRANSACTION_LENGTH_MAX_LENGTH
Definition: control_events.h:1214
static const int FULL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1208
static const int ENCODED_GNO_LENGTH
Definition: control_events.h:1197
bool is_tagged() const
Checks whether this Gtid log event contains a tag.
Definition: control_events.cpp:650
static constexpr std::size_t get_max_event_length()
Get maximum size of event.
Definition: control_events.h:1274
static const int ENCODED_FLAG_LENGTH
Definition: control_events.h:1195
Gtid_event(const char *buf, const Format_description_event *fde)
Ctor of Gtid_event.
Definition: control_events.cpp:450
unsigned long long get_trx_length() const
Definition: control_events.h:1315
static const int LOGICAL_TIMESTAMP_TYPECODE
Definition: control_events.h:1203
std::uint64_t commit_group_ticket
Ticket number used to group sessions together during the BGC.
Definition: control_events.h:1323
static const int LOGICAL_TIMESTAMP_LENGTH
Length of two logical timestamps.
Definition: control_events.h:1201
void read_gtid_tagged_log_event(const char *buf, std::size_t buf_size)
Function that reads GTID_TAGGED_LOG_EVENT event type from the given buffer.
Definition: control_events.cpp:429
decltype(auto) define_fields() const
Definition: control_events.h:1149
mysql::serialization::Field_missing_functor Field_missing_functor
Definition: control_events.h:1101
uint64_t original_commit_timestamp
Timestamp when the transaction was committed on the originating source.
Definition: control_events.h:1034
void set_trx_length(unsigned long long int transaction_length_arg)
Set the transaction length information.
Definition: control_events.h:1311
static const int IMMEDIATE_SERVER_VERSION_LENGTH
Length of immediate_server_version.
Definition: control_events.h:1218
static const int ENCODED_SERVER_VERSION_LENGTH
Definition: control_events.h:1223
static const int FULL_SERVER_VERSION_LENGTH
Length of original and immediate server version.
Definition: control_events.h:1220
static const int MAX_DATA_LENGTH
Definition: control_events.h:1297
static const int TRANSACTION_LENGTH_MIN_LENGTH
Definition: control_events.h:1213
bool has_commit_timestamps
Flag indicating whether this event contains commit timestamps.
Definition: control_events.h:1038
static const int ORIGINAL_SERVER_VERSION_LENGTH
Length of original_server_version.
Definition: control_events.h:1216
static const int POST_HEADER_LENGTH
Total length of post header.
Definition: control_events.h:1254
decltype(auto) define_fields()
Definition: control_events.h:1111
virtual std::int64_t get_gno() const
Definition: control_events.h:1251
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1669
uint64_t m_log_position
Definition: control_events.h:1706
Heartbeat_event_v2()
Creates an empty heartbeat event.
Definition: control_events.cpp:842
virtual ~Heartbeat_event_v2() override=default
const std::string get_log_filename() const
Definition: control_events.cpp:851
uint64_t get_log_position() const
Definition: control_events.cpp:854
void set_log_position(uint64_t position)
Definition: control_events.cpp:848
static uint64_t max_encoding_length()
This member function returns the len of the event.
Definition: control_events.cpp:861
void set_log_filename(const std::string name)
Definition: control_events.cpp:845
std::string m_log_filename
Definition: control_events.h:1705
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1743
unsigned int get_ident_len()
Definition: control_events.h:1759
Heartbeat_event(const char *buf, const Format_description_event *fde)
Sent by a source to a replica to let the replica know that the source is still alive.
Definition: control_events.cpp:801
const char * log_ident
Definition: control_events.h:1766
const char * get_log_ident()
Definition: control_events.h:1757
unsigned int ident_len
Definition: control_events.h:1767
~Heartbeat_event()
Definition: control_events.h:1761
Base class for ignorable log events.
Definition: control_events.h:674
Ignorable_event(Log_event_type type_arg=IGNORABLE_LOG_EVENT)
The minimal constructor and all it will do is set the type_code as IGNORABLE_LOG_EVENT in the header ...
Definition: control_events.h:683
Class representing an incident, an occurrence out of the ordinary, that happened on the master.
Definition: control_events.h:440
char * message
Definition: control_events.h:491
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:461
size_t message_length
Definition: control_events.h:492
enum_incident
Enumeration of the incidents that can occur for the server.
Definition: control_events.h:445
@ INCIDENT_NONE
No incident.
Definition: control_events.h:447
@ INCIDENT_LOST_EVENTS
There are possibly lost events in the replication stream.
Definition: control_events.h:449
@ INCIDENT_COUNT
Shall be last event of the enumeration.
Definition: control_events.h:451
enum_incident incident
Definition: control_events.h:490
char * get_message()
Definition: control_events.h:455
enum_incident get_incident_type()
Definition: control_events.h:454
Definition: control_events.h:1380
size_t buf_size
Definition: control_events.h:1408
Previous_gtids_event()
This is the minimal constructor, and set the type_code as PREVIOUS_GTIDS_LOG_EVENT in the header obje...
Definition: control_events.h:1400
const unsigned char * buf
Definition: control_events.h:1409
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:116
const char * new_log_ident
Definition: control_events.h:118
@ R_IDENT_OFFSET
Definition: control_events.h:132
@ R_POS_OFFSET
Definition: control_events.h:131
Rotate_event(const char *new_log_ident_arg, size_t ident_len_arg, unsigned int flags_arg, uint64_t pos_arg)
This is the minimal constructor, it will set the type code as ROTATE_EVENT.
Definition: control_events.h:138
@ DUP_NAME
Definition: control_events.h:125
@ RELAY_LOG
Definition: control_events.h:126
uint64_t pos
Definition: control_events.h:121
~Rotate_event() override
Definition: control_events.h:171
unsigned int flags
Definition: control_events.h:120
size_t ident_len
Definition: control_events.h:119
A stop event is written to the log files under these circumstances:
Definition: control_events.h:379
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:385
This class is used to combine the information of the ongoing transaction including the write set and ...
Definition: control_events.h:1468
static const int ENCODED_SNAPSHOT_VERSION_LEN_OFFSET
Definition: control_events.h:1520
~Transaction_context_event() override
Destructor of the Transaction_context_event class.
Definition: control_events.cpp:755
bool gtid_specified
Definition: control_events.h:1504
static const int ENCODED_SERVER_UUID_LEN_OFFSET
Definition: control_events.h:1514
static const int ENCODED_GTID_SPECIFIED_OFFSET
Definition: control_events.h:1518
static const int ENCODED_READ_WRITE_SET_ITEM_LEN
Definition: control_events.h:1528
static const char * read_data_set(const char *pos, uint32_t set_len, std::list< const char * > *set, uint32_t remaining_buffer)
static const int ENCODED_WRITE_SET_ITEMS_OFFSET
Definition: control_events.h:1522
static void clear_set(std::list< const char * > *set)
Function to clear the memory of the write_set and the read_set.
Definition: control_events.cpp:745
const unsigned char * encoded_snapshot_version
Definition: control_events.h:1505
uint32_t thread_id
Definition: control_events.h:1503
Transaction_context_event(const char *buf, const Format_description_event *fde)
Decodes the transaction_context_log_event of the ongoing transaction.
Definition: control_events.cpp:707
static const int ENCODED_READ_SET_ITEMS_OFFSET
Definition: control_events.h:1524
static const int ENCODED_THREAD_ID_OFFSET
Definition: control_events.h:1516
Transaction_context_event(unsigned int thread_id_arg, bool is_gtid_specified)
Definition: control_events.h:1483
std::list< const char * > read_set
Definition: control_events.h:1508
uint32_t encoded_snapshot_version_length
Definition: control_events.h:1506
static const int ENCODED_SNAPSHOT_VERSION_LEN
Definition: control_events.h:1529
const char * server_uuid
Definition: control_events.h:1502
std::list< const char * > write_set
Definition: control_events.h:1507
Event that encloses all the events of a transaction.
Definition: control_events.h:735
uint64_t m_payload_size
The size of the compressed data.
Definition: control_events.h:753
uint64_t get_uncompressed_size() const
Return the alleged uncompressed size according to the field stored in the event.
Definition: control_events.h:887
static constexpr size_t compression_type_max_length
There are four fields: "compression type", "payload size", "uncompressed size", and "end mark".
Definition: control_events.h:787
~Transaction_payload_event() override
const char * get_payload() const
Definition: control_events.h:902
void set_payload(const char *data)
Set the (possibly compressed) payload for the event.
Definition: control_events.h:899
Buffer_sequence_view_t * m_buffer_sequence_view
The compressed data, when payload consists of a sequence of buffers.
Definition: control_events.h:750
static constexpr size_t uncompressed_size_max_length
Definition: control_events.h:789
const char * m_payload
The compressed data, when entire payload is in one chunk.
Definition: control_events.h:747
mysql::binlog::event::compression::type m_compression_type
The compression algorithm that was used.
Definition: control_events.h:756
static constexpr size_t payload_size_max_length
Definition: control_events.h:788
Transaction_payload_event & operator=(const Transaction_payload_event &)=delete
static constexpr size_t max_length_of_all_headers
The maximum size of all headers, i.e., everything but the payload.
Definition: control_events.h:809
mysql::binlog::event::compression::type get_compression_type() const
Definition: control_events.h:857
void set_uncompressed_size(uint64_t size)
Set the uncompressed size of the payload.
Definition: control_events.h:880
static constexpr size_t max_payload_length
The maximum length of the payload size, defined such that the total event size does not exceed max_lo...
Definition: control_events.h:814
uint64_t get_payload_size() const
Definition: control_events.h:871
void set_payload_size(uint64_t size)
Set the (compressed) size of the payload in this event.
Definition: control_events.h:868
static constexpr size_t max_payload_data_header_length
The maximum size of the "payload data header".
Definition: control_events.h:800
static constexpr size_t end_mark_max_length
Definition: control_events.h:790
mysql::binlog::event::compression::buffer::Buffer_sequence_view<> Buffer_sequence_view_t
Definition: control_events.h:738
Transaction_payload_event(const Transaction_payload_event &)=delete
uint64_t m_uncompressed_size
The uncompressed size of the data.
Definition: control_events.h:761
void set_compression_type(mysql::binlog::event::compression::type type)
Set the compression type used for the enclosed payload.
Definition: control_events.h:852
std::string to_string() const
Definition: control_events.cpp:401
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:1568
static const int ENCODED_SEQ_NUMBER_OFFSET
Definition: control_events.h:1599
static const int ENCODED_VIEW_ID_MAX_LEN
Definition: control_events.h:1616
long long int seq_number
Definition: control_events.h:1622
~View_change_event() override
Destructor of the View_change_event class.
Definition: control_events.cpp:799
static const int ENCODED_CERT_INFO_SIZE_OFFSET
Definition: control_events.h:1601
View_change_event(const char *buf, const Format_description_event *fde)
Decodes the view_change_log_event generated in case a server enters or leaves the group.
Definition: control_events.cpp:774
static const int ENCODED_CERT_INFO_KEY_SIZE_LEN
Definition: control_events.h:1617
static const int ENCODED_VIEW_ID_OFFSET
Definition: control_events.h:1597
static const int ENCODED_CERT_INFO_VALUE_LEN
Definition: control_events.h:1618
std::map< std::string, std::string > certification_info
Definition: control_events.h:1624
char view_id[ENCODED_VIEW_ID_MAX_LEN]
Definition: control_events.h:1620
An XA_prepare event is generated for a XA prepared transaction.
Definition: control_events.h:588
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:617
static const uint16_t ser_buf_size
Definition: control_events.h:605
bool is_one_phase() const
Whether or not this XA_prepare_event represents an XA COMMIT ONE PHASE.
Definition: control_events.cpp:361
bool one_phase
Definition: control_events.h:609
MY_XID my_xid
Definition: control_events.h:607
void * xid
Definition: control_events.h:608
MY_XID const & get_xid() const
Retrieves the content of my_xid member variable.
Definition: control_events.cpp:363
static const int MY_XIDDATASIZE
Definition: control_events.h:593
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:523
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:530
uint64_t xid
Definition: control_events.h:540
Sequence of memory buffers.
Definition: buffer_sequence_view.h:72
Represents Transaction Source Identifier which is composed of source UUID and transaction tag.
Definition: tsid.h:47
const Tag & get_tag() const
Tag accessor.
Definition: tsid.h:111
Tag & get_tag_ref()
Tag accessor, non const (serialization)
Definition: tsid.h:115
const Uuid & get_uuid() const
UUID accessor.
Definition: tsid.h:123
Binary, read only archive implementation based on vector of bytes.
Definition: read_archive_binary.h:43
Interface for serializable data structures.
Definition: serializable.h:86
Basic serializer that is implementing Serializer interface.
Definition: serializer_default.h:63
Binary, write only archive implementation based on vector of bytes.
Definition: write_archive_binary.h:44
constexpr DWORD buf_size
Definition: create_def.cc:229
helpers aimed at deducing Field_type in case size is provided, and basic field and compound field def...
#define ST_SERVER_VER_SPLIT_LEN
Definition: binlog_event.h:88
Definition: buf0block_hint.cc:30
type
Definition: base.h:40
@ NONE
Definition: base.h:45
The namespace contains classes representing events that can occur in a replication stream.
Definition: binlog_event.cpp:36
constexpr size_t max_log_event_size
The maximum value for MAX_ALLOWED_PACKET.
Definition: binlog_event.h:448
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:286
@ INCIDENT_EVENT
Something out of the ordinary happened on the master.
Definition: binlog_event.h:330
@ XID_EVENT
Definition: binlog_event.h:313
@ IGNORABLE_LOG_EVENT
In some situations, it is necessary to send over ignorable data to the slave: data that a slave can h...
Definition: binlog_event.h:344
@ XA_PREPARE_LOG_EVENT
Definition: binlog_event.h:362
@ PREVIOUS_GTIDS_LOG_EVENT
Definition: binlog_event.h:355
@ STOP_EVENT
Definition: binlog_event.h:301
@ GTID_LOG_EVENT
Definition: binlog_event.h:352
@ ROTATE_EVENT
Definition: binlog_event.h:302
@ TRANSACTION_CONTEXT_EVENT
Definition: binlog_event.h:357
void bapi_free(void *ptr)
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent lib...
Definition: wrapper_functions.h:213
mysql::gtid::Uuid Uuid
Definition: global.h:38
constexpr std::size_t tag_max_length
Maximal number of characters in a tag.
Definition: gtid_constants.h:44
auto define_field_with_size(Field_type &arg, Args &&... args)
Definition: field_definition_helpers.h:49
Field_encode_functor_type Field_encode_predicate
Type of the predicate telling serializer whether field is provided or not.
Definition: field_functor.h:47
auto define_field(Field_type &arg, Args &&... args)
Definition: field_definition_helpers.h:54
Field_decode_functor_type Field_missing_functor
Type of the predicate telling serializer what to do in case field is not provided.
Definition: field_functor.h:43
size_t size(const char *const c)
Definition: base64.h:46
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:29
Definition: control_events.h:596
long formatID
Definition: control_events.h:597
char data[MY_XIDDATASIZE]
Definition: control_events.h:600
long bqual_length
Definition: control_events.h:599
long gtrid_length
Definition: control_events.h:598
Structure to hold the members declared in the class Gtid_log_event those member are objects of classe...
Definition: control_events.h:726
int64_t rpl_gtid_gno
Definition: control_events.h:728
int32_t rpl_gtid_sidno
Definition: control_events.h:727
Tag representation so that:
Definition: tag_plain.h:48
Uuid is a trivial and of standard layout The structure contains the following components.
Definition: uuid.h:64
std::array< unsigned char, BYTE_LENGTH > bytes
The data for this Uuid.
Definition: uuid.h:146
Include file for Sun RPC to compile out of the box.