MySQL 9.1.0
Source Code Documentation
|
Written every time a statement uses a user variable; precedes other events for the statement. More...
#include <statement_events.h>
Public Member Functions | |
User_var_event (const char *name_arg, unsigned int name_len_arg, char *val_arg, unsigned long val_len_arg, Value_type type_arg, unsigned int charset_number_arg, unsigned char flags_arg) | |
This constructor will initialize the instance variables and the type_code, it will be used only by the server code. More... | |
User_var_event (const char *buf, const Format_description_event *fde) | |
The constructor receives a buffer and instantiates a User_var_event filled in with the data from the buffer Written every time a statement uses a user variable, precedes other events for the statement. More... | |
~User_var_event () override | |
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 | |
const char * | name |
unsigned int | name_len |
char * | val |
uint32_t | val_len |
Value_type | type |
unsigned int | charset_number |
bool | is_null |
unsigned char | flags |
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... | |
Written every time a statement uses a user variable; precedes other events for the statement.
Indicates the value to use for the user variable in the next statement. This is written only before a QUERY_EVENT and is not used with row-based logging
The Post-Header has following components:
Name | Format | Description |
---|---|---|
Value_type | enum | The user variable type. |
User_var_event_data | enum | User_var event data |
name | const char pointer | User variable name. |
name_len | unsigned int | Length of the user variable name |
val | char pointer | value of the user variable. |
val_len | unsigned long | Length of the value of the user variable |
type | enum Value_type | Type of the user variable |
charset_number | unsigned int | The number of the character set for the user variable (needed for a string variable). The character set number is really a collation number that indicates a character set/collation pair. |
is_null | bool | Non-zero if the variable value is the SQL NULL value, 0 otherwise. |
|
inline |
This constructor will initialize the instance variables and the type_code, it will be used only by the server code.
mysql::binlog::event::User_var_event::User_var_event | ( | const char * | buf, |
const Format_description_event * | fde | ||
) |
The constructor receives a buffer and instantiates a User_var_event filled in with the data from the buffer Written every time a statement uses a user variable, precedes other events for the statement.
Indicates the value to use for the user variable in the next statement. This is written only before a QUERY_EVENT and is not used with row-based logging.
The buffer layout for variable data part is as follows:
+-------------------------------------------------------------------+ | name_len | name | is_null | type | charset_number | val_len | val | +-------------------------------------------------------------------+
buf | Contains the serialized event. |
fde | An FDE event (see Rotate_event constructor for more info). |
We need to check if this is from an old server that did not pack information for flags. We do this by checking if there are extra bytes after the packed value. If there are we take the extra byte and it's value is assumed to contain the flags value.
Old events will not have this extra byte, thence, we keep the flags set to UNDEF_F.
|
override |
unsigned int mysql::binlog::event::User_var_event::charset_number |
unsigned char mysql::binlog::event::User_var_event::flags |
bool mysql::binlog::event::User_var_event::is_null |
const char* mysql::binlog::event::User_var_event::name |
unsigned int mysql::binlog::event::User_var_event::name_len |
Value_type mysql::binlog::event::User_var_event::type |
char* mysql::binlog::event::User_var_event::val |
uint32_t mysql::binlog::event::User_var_event::val_len |