MySQL 9.1.0
Source Code Documentation
|
Contains the classes representing events occurring in the replication stream. More...
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <zlib.h>
#include <climits>
#include <cstdio>
#include <iostream>
#include "my_checksum.h"
#include "my_io.h"
#include "mysql/binlog/event/debug_vars.h"
#include "mysql/binlog/event/event_decoding_error.h"
#include "mysql/binlog/event/event_reader.h"
#include <sys/times.h>
Go to the source code of this file.
Classes | |
struct | mysql::binlog::event::Log_event_type_helper |
Event type helpers, enclosed in the structure. More... | |
struct | mysql::binlog::event::Log_event_basic_info |
Holds basic information about an event: common-header fields, query, etc. More... | |
class | mysql::binlog::event::Log_event_footer |
The footer, in the current version of the MySQL server, only contains the checksum algorithm descriptor. More... | |
class | mysql::binlog::event::Log_event_header |
The Common-Header always has the same form and length within one version of MySQL. More... | |
class | mysql::binlog::event::Binary_log_event |
This is the abstract base class for binary log events. More... | |
class | mysql::binlog::event::Unknown_event |
An unknown event should never occur. More... | |
Namespaces | |
namespace | mysql::binlog::event |
The namespace contains classes representing events that can occur in a replication stream. | |
namespace | mysql |
namespace | mysql::binlog |
Macros | |
#define | SYSTEM_CHARSET_MBMAXLEN 3 |
#define | NAME_CHAR_LEN 64 /* Field/table name length */ |
#define | NAME_LEN (NAME_CHAR_LEN * SYSTEM_CHARSET_MBMAXLEN) |
#define | ST_SERVER_VER_SPLIT_LEN 3 |
#define | BIN_LOG_HEADER_SIZE 4U |
#define | BINLOG_VERSION 4 |
binlog_version 3 is MySQL 4.x; 4 is MySQL 5.0.0. More... | |
#define | MAX_DBS_IN_EVENT_MTS 16 |
The maximum number of updated databases that a status of Query-log-event can carry. More... | |
#define | OVER_MAX_DBS_IN_EVENT_MTS 254 |
When the actual number of databases exceeds MAX_DBS_IN_EVENT_MTS the value of OVER_MAX_DBS_IN_EVENT_MTS is is put into the mts_accessed_dbs status. More... | |
#define | MAX_TIME_ZONE_NAME_LENGTH (NAME_LEN + 1) |
Maximum length of time zone name that we support (Time zone name is char(64) in db). More... | |
#define | MAX_SIZE_LOG_EVENT_STATUS |
Max number of possible extra bytes in a replication event compared to a packet (i.e. More... | |
#define | MAX_COMMIT_TIMESTAMP_VALUE (1ULL << 55) |
We use 7 bytes, 1 bit being used as a flag. More... | |
#define | LOG_EVENT_IGNORABLE_F 0x80 |
Setting this flag will mark an event as Ignorable. More... | |
#define | LOG_EVENT_BINLOG_IN_USE_F 0x1 |
#define | ST_SERVER_VER_LEN 50 |
The length of the array server_version, which is used to store the version of MySQL server. More... | |
#define | EVENT_TYPE_OFFSET 4 |
#define | SERVER_ID_OFFSET 5 |
#define | EVENT_LEN_OFFSET 9 |
#define | LOG_POS_OFFSET 13 |
#define | FLAGS_OFFSET 17 |
#define | ST_BINLOG_VER_OFFSET 0 |
start event post-header (for v3 and v4) More... | |
#define | ST_SERVER_VER_OFFSET 2 |
#define | ST_CREATED_OFFSET (ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN) |
#define | ST_COMMON_HEADER_LEN_OFFSET (ST_CREATED_OFFSET + 4) |
#define | LOG_EVENT_HEADER_LEN 19U /* the fixed header length */ |
#define | LOG_EVENT_MINIMAL_HEADER_LEN 19U |
Fixed header length, where 4.x and 5.0 agree. More... | |
#define | CHECKSUM_CRC32_SIGNATURE_LEN 4 |
#define | BINLOG_CHECKSUM_LEN CHECKSUM_CRC32_SIGNATURE_LEN |
defined statically while there is just one alg implemented More... | |
#define | BINLOG_CHECKSUM_ALG_DESC_LEN 1 /* 1 byte checksum alg descriptor */ |
#define | LOG_EVENT_HEADER_SIZE 20 |
Functions | |
void | do_server_version_split (const char *version, unsigned char split_versions[3]) |
In case the variable is updated, make sure to update it in $MYSQL_SOURCE_DIR/my_io.h. More... | |
uint32_t | do_server_version_int (const char *version) |
Transforms the server version from 'XX.YY.ZZ-suffix' into an integer in the format XXYYZZ. More... | |
unsigned long | version_product (const unsigned char *version_split) |
Calculate the version product from the numeric pieces representing the server version: For a server version X.Y.Zabc (X,Y,Z numbers, a not a digit), the input is {X,Y,Z}. More... | |
const std::string & | mysql::binlog::event::get_event_type_as_string (Log_event_type type) |
Get the event type as string object. More... | |
uint32_t | mysql::binlog::event::checksum_crc32 (uint32_t crc, const unsigned char *pos, size_t length) |
Calculate a long checksum for a memoryblock. More... | |
Variables | |
const int64_t | SEQ_UNINIT = 0 |
Uninitialized timestamp value (for either last committed or sequence number). More... | |
const int64_t | UNDEFINED_COMMIT_TIMESTAMP = MAX_COMMIT_TIMESTAMP_VALUE |
Used to determine whether the original_commit_timestamp is already known or if it still needs to be determined when computing it. More... | |
const uint32_t | UNDEFINED_SERVER_VERSION = 999999 |
const uint32_t | UNKNOWN_SERVER_VERSION = 0 |
const unsigned char | checksum_version_split [3] |
Replication event checksum is introduced in the following "checksum-home" version. More... | |
const unsigned long | checksum_version_product |
constexpr size_t | mysql::binlog::event::max_log_event_size = 1024 * 1024 * 1024 |
The maximum value for MAX_ALLOWED_PACKET. More... | |
Contains the classes representing events occurring in the replication stream.
Each event is represented as a byte sequence with logical divisions as event header, event specific data and event footer. The header and footer are common to all the events and are represented as two different subclasses.
#define BINLOG_CHECKSUM_ALG_DESC_LEN 1 /* 1 byte checksum alg descriptor */ |
#define BINLOG_CHECKSUM_LEN CHECKSUM_CRC32_SIGNATURE_LEN |
defined statically while there is just one alg implemented
#define CHECKSUM_CRC32_SIGNATURE_LEN 4 |
#define EVENT_LEN_OFFSET 9 |
#define EVENT_TYPE_OFFSET 4 |
#define FLAGS_OFFSET 17 |
#define LOG_EVENT_BINLOG_IN_USE_F 0x1 |
#define LOG_EVENT_HEADER_LEN 19U /* the fixed header length */ |
#define LOG_EVENT_HEADER_SIZE 20 |
#define LOG_EVENT_MINIMAL_HEADER_LEN 19U |
Fixed header length, where 4.x and 5.0 agree.
That is, 5.0 may have a longer header (it will for sure when we have the unique event's ID), but at least the first 19 bytes are the same in 4.x and 5.0. So when we have the unique event's ID, LOG_EVENT_HEADER_LEN will be something like 26, but LOG_EVENT_MINIMAL_HEADER_LEN will remain 19.
#define LOG_POS_OFFSET 13 |
#define SERVER_ID_OFFSET 5 |
#define ST_BINLOG_VER_OFFSET 0 |
start event post-header (for v3 and v4)
#define ST_COMMON_HEADER_LEN_OFFSET (ST_CREATED_OFFSET + 4) |
#define ST_CREATED_OFFSET (ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN) |
#define ST_SERVER_VER_LEN 50 |
The length of the array server_version, which is used to store the version of MySQL server.
We could have used SERVER_VERSION_LENGTH, but this introduces an obscure dependency - if somebody decided to change SERVER_VERSION_LENGTH this would break the replication protocol both of these are used to initialize the array server_version SERVER_VERSION_LENGTH is used for global array server_version and ST_SERVER_VER_LEN for the Start_event_v3 member server_version
#define ST_SERVER_VER_OFFSET 2 |