MySQL 9.1.0
Source Code Documentation
|
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0. More...
#include <statement_events.h>
Public Member Functions | |
Rand_event (unsigned long long seed1_arg, unsigned long long seed2_arg) | |
Rand_event (const char *buf, const Format_description_event *fde) | |
Written every time a statement uses the RAND() function; precedes other events for the statement. More... | |
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 | |
unsigned long long | seed1 |
unsigned long long | seed2 |
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... | |
Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0.
4.1.1 does not need it (it's repeatable again) so this event needn't be written in 4.1.1 for PASSWORD() (but the fact that it is written is just a waste, it does not cause bugs).
The state of the random number generation consists of 128 bits, which are stored internally as two 64-bit numbers.
The Post-Header for this event type is empty. The Body has two components:
Name | Format | Description |
---|---|---|
seed1 | 8 byte unsigned integer | 64 bit random seed1. |
seed2 | 8 byte unsigned integer | 64 bit random seed2. |
|
inline |
This will initialize the instance variables seed1 & seed2, and set the
type_code as RAND_EVENT in the header object in Binary_log_event
mysql::binlog::event::Rand_event::Rand_event | ( | const char * | buf, |
const Format_description_event * | fde | ||
) |
Written every time a statement uses the RAND() function; precedes other events for the statement.
Indicates the seed values to use for generating a random number with RAND() 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 part is as follows: +----------------------------------------------+ | value for first seed | value for second seed | +----------------------------------------------+
buf | Contains the serialized event. |
fde | An FDE event (see Rotate_event constructor for more info). |
unsigned long long mysql::binlog::event::Rand_event::seed1 |
unsigned long long mysql::binlog::event::Rand_event::seed2 |