MySQL 9.0.0
Source Code Documentation
|
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...
#include <statement_events.h>
Public Member Functions | |
std::string | get_var_type_string () const |
This method returns the string representing the type of the variable used in the event. More... | |
Intvar_event (const char *buf, const Format_description_event *fde) | |
Constructor receives a packet from the MySQL master or the binary log and decodes it to create an Intvar_event. More... | |
Intvar_event (uint8_t type_arg, uint64_t val_arg) | |
The minimal constructor for Intvar_event it initializes the instance variables type & val and set the type_code as INTVAR_EVENT in the header object in Binary_log_event. More... | |
~Intvar_event () override=default | |
Public Member Functions inherited from mysql::binlog::event::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_event & | operator= (const Binary_log_event &)=default |
Binary_log_event & | operator= (Binary_log_event &&)=default |
enum Log_event_type | get_event_type () const |
Helper method. More... | |
const Log_event_header * | header () const |
Return a const pointer to the header of the log event. More... | |
Log_event_header * | header () |
Return a non-const pointer to the header of the log event. More... | |
const Log_event_footer * | footer () const |
Return a const pointer to the footer of the log event. More... | |
Log_event_footer * | footer () |
Return a non-const pointer to the footer of the log event. More... | |
Event_reader & | reader () |
Returns a reference to the event Event_reader object. More... | |
Public Attributes | |
uint8_t | type |
uint64_t | val |
Additional Inherited Members | |
Static Public Attributes inherited from mysql::binlog::event::Binary_log_event | |
static const int | LOG_EVENT_TYPES = (ENUM_END_EVENT - 1) |
Protected Member Functions inherited from mysql::binlog::event::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... | |
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.
Each Intvar_event holds the value of one of these variables.
The Post-Header for this event type is empty. The Body has two components:
Name | Format | Description |
---|---|---|
type | 1 byte enumeration | One byte identifying the type of variable stored. Currently, two identifiers are supported: LAST_INSERT_ID_EVENT == 1 and INSERT_ID_EVENT == 2. |
val | 8 byte unsigned integer | The value of the variable. |
mysql::binlog::event::Intvar_event::Intvar_event | ( | const char * | buf, |
const Format_description_event * | fde | ||
) |
Constructor receives a packet from the MySQL master or the binary log and decodes it to create an Intvar_event.
The post header for the event is empty. Buffer layout for the variable data part is as follows:
+--------------------------------+ | type (4 bytes) | val (8 bytes) | +--------------------------------+
buf | Contains the serialized event. |
fde | An FDE event (see Rotate_event constructor for more info). |
Written every time a statement uses an AUTO_INCREMENT column or the LAST_INSERT_ID() function; precedes other events for the statement. This is written only before a QUERY_EVENT and is not used with row-based logging. An INTVAR_EVENT is written with a "subtype" in the event data part:
INSERT_ID_EVENT indicates the value to use for an AUTO_INCREMENT column in the next statement.
LAST_INSERT_ID_EVENT indicates the value to use for the LAST_INSERT_ID() function in the next statement.
|
inline |
The minimal constructor for Intvar_event it initializes the instance variables type & val and set the type_code as INTVAR_EVENT in the header object in Binary_log_event.
|
overridedefault |
|
inline |
This method returns the string representing the type of the variable used in the event.
Changed the definition to be similar to that previously defined in log_event.cc.
uint8_t mysql::binlog::event::Intvar_event::type |
uint64_t mysql::binlog::event::Intvar_event::val |