![]() |
MySQL 9.1.0
Source Code Documentation
|
The namespace contains classes representing events that can occur in a replication stream. More...
Namespaces | |
namespace | codecs |
namespace | compression |
namespace | debug |
Classes | |
class | Append_block_event |
This event is created to contain the file data. More... | |
class | Begin_load_query_event |
Event for the first block of file to be loaded, its only difference from Append_block event is that this event creates or truncates existing file before writing data. More... | |
class | Binary_log_event |
This is the abstract base class for binary log events. More... | |
class | Delete_file_event |
DELETE_FILE_EVENT occurs when the LOAD DATA failed on the master. More... | |
class | Delete_rows_event |
Log row deletions. More... | |
class | Event_reader |
Event_reader class purpose is to avoid out-of-buffer reads when deserializing binary log events and increase robustness when dealing with corrupted event buffers. More... | |
class | Execute_load_query_event |
Event responsible for LOAD DATA execution, it similar to Query_event but before executing the query it substitutes original filename in LOAD DATA query with name of temporary file. More... | |
class | Format_description_event |
For binlog version 4. More... | |
class | Gtid_event |
GTID stands for Global Transaction IDentifier It is composed of two parts: More... | |
struct | gtid_info |
Structure to hold the members declared in the class Gtid_log_event those member are objects of classes defined in server(rpl_gtid.h). More... | |
class | Heartbeat_event |
Replication event to ensure to replica that source is alive. More... | |
class | Heartbeat_event_v2 |
Replication event to ensure to replica that source is alive. More... | |
class | Ignorable_event |
Base class for ignorable log events. More... | |
class | Incident_event |
Class representing an incident, an occurrence out of the ordinary, that happened on the master. More... | |
class | Intvar_event |
An Intvar_event will be created just before a Query_event, if the query uses one of the variables LAST_INSERT_ID or INSERT_ID. More... | |
struct | Log_event_basic_info |
Holds basic information about an event: common-header fields, query, etc. More... | |
class | Log_event_footer |
The footer, in the current version of the MySQL server, only contains the checksum algorithm descriptor. More... | |
class | Log_event_header |
The Common-Header always has the same form and length within one version of MySQL. More... | |
struct | Log_event_type_helper |
Event type helpers, enclosed in the structure. More... | |
class | Previous_gtids_event |
class | Query_event |
A Query_event is created for each query that modifies the database, unless the query is logged row-based. More... | |
class | Rand_event |
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0. More... | |
class | Rotate_event |
When a binary log file exceeds a size limit, a ROTATE_EVENT is written at the end of the file that points to the next file in the sequence. More... | |
class | Rows_event |
Common base class for all row-containing binary log events. More... | |
class | Rows_query_event |
Rows query event type, which is a subclass of the Ignorable_event, to record the original query for the rows events in RBR. More... | |
class | Stop_event |
A stop event is written to the log files under these circumstances: More... | |
class | Table_id |
Each table share has a table id, it is mainly used for row based replication. More... | |
class | Table_map_event |
In row-based mode, every row operation event is preceded by a Table_map_event which maps a table definition to a number. More... | |
class | Transaction_boundary_parser |
This is the base class for verifying transaction boundaries. More... | |
class | Transaction_context_event |
This class is used to combine the information of the ongoing transaction including the write set and other information of the thread executing the transaction. More... | |
class | Transaction_payload_event |
Event that encloses all the events of a transaction. More... | |
class | Unknown_event |
An unknown event should never occur. More... | |
class | Update_rows_event |
Log row updates with a before image. More... | |
class | User_var_event |
Written every time a statement uses a user variable; precedes other events for the statement. More... | |
class | View_change_event |
This class is used to add view change markers in the binary log when a member of the group enters or leaves the group. More... | |
class | Write_rows_event |
Log row insertions. More... | |
class | XA_prepare_event |
An XA_prepare event is generated for a XA prepared transaction. More... | |
class | Xid_event |
An XID event is generated for a commit of a transaction that modifies one or more tables of an XA-capable storage engine. More... | |
Functions | |
const std::string & | get_event_type_as_string (Log_event_type type) |
Get the event type as string object. More... | |
uint32_t | checksum_crc32 (uint32_t crc, const unsigned char *pos, size_t length) |
Calculate a long checksum for a memoryblock. More... | |
static void | parse_signedness (std::vector< bool > &vec, Event_reader &reader_obj, unsigned int length) |
Parses SIGNEDNESS field. More... | |
static void | parse_default_charset (Table_map_event::Optional_metadata_fields::Default_charset &default_charset, Event_reader &reader_obj, unsigned int length) |
Parses DEFAULT_CHARSET field. More... | |
static void | parse_column_charset (std::vector< unsigned int > &vec, Event_reader &reader_obj, unsigned int length) |
Parses COLUMN_CHARSET field. More... | |
static void | parse_column_name (std::vector< std::string > &vec, Event_reader &reader_obj, unsigned int length) |
Parses COLUMN_NAME field. More... | |
static void | parse_set_str_value (std::vector< Table_map_event::Optional_metadata_fields::str_vector > &vec, Event_reader &reader_obj, unsigned int length) |
Parses SET_STR_VALUE/ENUM_STR_VALUE field. More... | |
static void | parse_geometry_type (std::vector< unsigned int > &vec, Event_reader &reader_obj, unsigned int length) |
Parses GEOMETRY_TYPE field. More... | |
static void | parse_vector_dimensionality (std::vector< unsigned int > &vec, Event_reader &reader_obj, unsigned int length) |
Parses VECTOR_DIMENSIONALITY field. More... | |
static void | parse_simple_pk (std::vector< Table_map_event::Optional_metadata_fields::uint_pair > &vec, Event_reader &reader_obj, unsigned int length) |
Parses SIMPLE_PRIMARY_KEY field. More... | |
static void | parse_pk_with_prefix (std::vector< Table_map_event::Optional_metadata_fields::uint_pair > &vec, Event_reader &reader_obj, unsigned int length) |
Parses PRIMARY_KEY_WITH_PREFIX field. More... | |
static void | parse_column_visibility (std::vector< bool > *vec, Event_reader &reader_obj, unsigned int length) |
Parses column visibility attribute. More... | |
static void | copy_str_and_move (Log_event_header::Byte **dst, const char **src, size_t len) |
Utility function for the Query_event constructor. More... | |
template<class T > | |
T | available_buffer (const char *buf_start, const char *buf_current, T buf_len) |
template<class T > | |
bool | valid_buffer_range (T jump, const char *buf_start, const char *buf_current, T buf_len) |
Check if jump value is within buffer limits. More... | |
char * | strndup (const char *s, size_t n) |
The strndup() function returns a pointer to a new string which is a duplicate of the string s, but it only copies at most n bytes. More... | |
const char * | bapi_strndup (const char *destination, size_t n) |
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input string. More... | |
void * | bapi_memdup (const void *source, size_t len) |
This is a wrapper function, and returns a pointer to a new memory with the contents copied from the input memory pointer, up to a given length. More... | |
void * | bapi_malloc (size_t size, int flags) |
This is a wrapper function in order to allocate memory from the heap in the binlogevent library. More... | |
void | bapi_free (void *ptr) |
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent library. More... | |
Variables | |
static const std::unordered_map< Log_event_type, const std::string > | event_type_to_string |
constexpr size_t | max_log_event_size = 1024 * 1024 * 1024 |
The maximum value for MAX_ALLOWED_PACKET. More... | |
const uint64_t | INVALID_XID = 0xffffffffffffffffULL |
The following constant represents the maximum of MYSQL_XID domain. More... | |
The namespace contains classes representing events that can occur in a replication stream.
Enumeration spcifying checksum algorithm used to encode a binary log event.
|
strong |
Errors that we distinguish during event decoding, that are translated to specific error returned by the Server.
Enumeration type for the different types of log events.
T mysql::binlog::event::available_buffer | ( | const char * | buf_start, |
const char * | buf_current, | ||
T | buf_len | ||
) |
|
inline |
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent library.
If compiled with the MySQL server, and memory is allocated using memory allocating methods from the mysys library, my_free is called. Otherwise, the standard free() is called from the function.
ptr | Pointer to the memory which is to be freed. |
|
inline |
This is a wrapper function in order to allocate memory from the heap in the binlogevent library.
If compiled with the MySQL server, and memory is allocated using memory allocating methods from the mysys library, my_malloc is called. Otherwise, the standard malloc() is called from the function.
size | Size of the memory to be allocated. |
flags | flags to pass to MySQL server my_malloc functions |
|
inline |
This is a wrapper function, and returns a pointer to a new memory with the contents copied from the input memory pointer, up to a given length.
source | Pointer to the buffer from which data is to be copied |
len | Length up to which the source should be copied |
|
inline |
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input string.
The terminating Null character is added.
If compiled with MySQL server,the strndup function from the mysys library is called, which allow instrumenting memory allocated. Else, the standard string function is called.
destination | The string to be duplicated |
n | The number of bytes to be copied |
|
inline |
Calculate a long checksum for a memoryblock.
crc | start value for crc |
pos | pointer to memory block |
length | length of the block |
|
static |
Utility function for the Query_event constructor.
The function copies n bytes from the source string and moves the destination pointer by the number of bytes copied.
dst | Pointer to the buffer into which the string is to be copied |
src | Source string |
len | The number of bytes to be copied |
const std::string & mysql::binlog::event::get_event_type_as_string | ( | Log_event_type | type | ) |
Get the event type as string object.
type | the event type for which to get a textual representation. |
|
static |
Parses COLUMN_CHARSET field.
[out] | vec | stores collation numbers extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses COLUMN_NAME field.
[out] | vec | stores column names extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses column visibility attribute.
[out] | vec | Stores the column visibility extracted from the field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses DEFAULT_CHARSET field.
[out] | default_charset | stores collation numbers extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses GEOMETRY_TYPE field.
[out] | vec | stores geometry column's types extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses PRIMARY_KEY_WITH_PREFIX field.
[out] | vec | stores primary key's column information extracted from field. Each column has an index and a prefix which are stored as a unit_pair. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses SET_STR_VALUE/ENUM_STR_VALUE field.
[out] | vec | stores SET/ENUM column's string values extracted from field. Each SET/ENUM column's string values are stored into a string separate vector. All of them are stored in 'vec'. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses SIGNEDNESS field.
[out] | vec | stores the signedness flags extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses SIMPLE_PRIMARY_KEY field.
[out] | vec | stores primary key's column information extracted from field. Each column has an index and a prefix which are stored as a unit_pair. prefix is always 0 for SIMPLE_PRIMARY_KEY field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
static |
Parses VECTOR_DIMENSIONALITY field.
[out] | vec | stores vector columns's dimensionality extracted from field. |
[in] | reader_obj | the Event_reader object containing the serialized field. |
[in] | length | length of the field |
|
inline |
The strndup() function returns a pointer to a new string which is a duplicate of the string s, but it only copies at most n bytes.
If s is longer than n, only n bytes are copied, and a terminating null byte ('\0') is added. Memory for the new string is obtained with malloc, and can be freed with free.
s | The string whose copy we want to create |
n | Number of bytes to be copied |
bool mysql::binlog::event::valid_buffer_range | ( | T | jump, |
const char * | buf_start, | ||
const char * | buf_current, | ||
T | buf_len | ||
) |
Check if jump value is within buffer limits.
jump | Number of positions we want to advance. |
buf_start | Pointer to buffer start |
buf_current | Pointer to the current position on buffer. |
buf_len | Buffer length. |
True | If jump value is within buffer limits. |
False | Otherwise. |
|
static |
const uint64_t mysql::binlog::event::INVALID_XID = 0xffffffffffffffffULL |
The following constant represents the maximum of MYSQL_XID domain.
The maximum XID value practically is never supposed to grow beyond UINT64 range.
|
constexpr |
The maximum value for MAX_ALLOWED_PACKET.
This is also the maxmium size of binlog events, and dump threads always use this value for max_allowed_packet.