MySQL 8.0.39
Source Code Documentation
binary_log::Transaction_context_event Class Reference

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...

#include <control_events.h>

Inheritance diagram for binary_log::Transaction_context_event:
[legend]

Public Member Functions

 Transaction_context_event (const char *buf, const Format_description_event *fde)
 Decodes the transaction_context_log_event of the ongoing transaction. More...
 
 Transaction_context_event (unsigned int thread_id_arg, bool is_gtid_specified_arg)
 
 ~Transaction_context_event () override
 Destructor of the Transaction_context_event class. More...
 
- Public Member Functions inherited from binary_log::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_eventoperator= (const Binary_log_event &)=default
 
Binary_log_eventoperator= (Binary_log_event &&)=default
 
enum Log_event_type get_event_type () const
 Helper method. More...
 
const Log_event_headerheader () const
 Return a const pointer to the header of the log event. More...
 
Log_event_headerheader ()
 Return a non-const pointer to the header of the log event. More...
 
const Log_event_footerfooter () const
 Return a const pointer to the footer of the log event. More...
 
Log_event_footerfooter ()
 Return a non-const pointer to the footer of the log event. More...
 
Event_readerreader ()
 Returns a reference to the event Event_reader object. More...
 

Static Public Member Functions

static const char * read_data_set (const char *pos, uint32_t set_len, std::list< const char * > *set, uint32_t remaining_buffer)
 
static void clear_set (std::list< const char * > *set)
 Function to clear the memory of the write_set and the read_set. More...
 

Protected Attributes

const char * server_uuid
 
uint32_t thread_id
 
bool gtid_specified
 
const unsigned char * encoded_snapshot_version
 
uint32_t encoded_snapshot_version_length
 
std::list< const char * > write_set
 
std::list< const char * > read_set
 

Static Protected Attributes

static const int ENCODED_SERVER_UUID_LEN_OFFSET = 0
 
static const int ENCODED_THREAD_ID_OFFSET = 1
 
static const int ENCODED_GTID_SPECIFIED_OFFSET = 5
 
static const int ENCODED_SNAPSHOT_VERSION_LEN_OFFSET = 6
 
static const int ENCODED_WRITE_SET_ITEMS_OFFSET = 10
 
static const int ENCODED_READ_SET_ITEMS_OFFSET = 14
 
static const int ENCODED_READ_WRITE_SET_ITEM_LEN = 2
 
static const int ENCODED_SNAPSHOT_VERSION_LEN = 2
 

Additional Inherited Members

- Public Types inherited from binary_log::Binary_log_event
enum  enum_post_header_length {
  QUERY_HEADER_MINIMAL_LEN = (4 + 4 + 1 + 2) , QUERY_HEADER_LEN = (QUERY_HEADER_MINIMAL_LEN + 2) , STOP_HEADER_LEN = 0 , START_V3_HEADER_LEN = (2 + ST_SERVER_VER_LEN + 4) ,
  ROTATE_HEADER_LEN = 8 , INTVAR_HEADER_LEN = 0 , APPEND_BLOCK_HEADER_LEN = 4 , DELETE_FILE_HEADER_LEN = 4 ,
  RAND_HEADER_LEN = 0 , USER_VAR_HEADER_LEN = 0 , FORMAT_DESCRIPTION_HEADER_LEN = (START_V3_HEADER_LEN + 1 + LOG_EVENT_TYPES) , XID_HEADER_LEN = 0 ,
  BEGIN_LOAD_QUERY_HEADER_LEN = APPEND_BLOCK_HEADER_LEN , ROWS_HEADER_LEN_V1 = 8 , TABLE_MAP_HEADER_LEN = 8 , EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN = (4 + 4 + 4 + 1) ,
  EXECUTE_LOAD_QUERY_HEADER_LEN , INCIDENT_HEADER_LEN = 2 , HEARTBEAT_HEADER_LEN = 0 , IGNORABLE_HEADER_LEN = 0 ,
  ROWS_HEADER_LEN_V2 = 10 , TRANSACTION_CONTEXT_HEADER_LEN = 18 , VIEW_CHANGE_HEADER_LEN = 52 , XA_PREPARE_HEADER_LEN = 0 ,
  TRANSACTION_PAYLOAD_HEADER_LEN = 0
}
 The lengths for the fixed data part of each event. More...
 
- Static Public Attributes inherited from binary_log::Binary_log_event
static const int LOG_EVENT_TYPES = (ENUM_END_EVENT - 1)
 
- Protected Member Functions inherited from binary_log::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...
 

Detailed Description

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.

Name

Format

Description

thread_id

4 byte integer

The identifier for the thread executing the transaction.

gtid_specified

bool type variable

Variable to identify whether the Gtid have been specified for the ongoing transaction or not.

encoded_snapshot_version

unsigned char array

A gtid_set which is used to store the transaction set used for conflict detection.

encoded_snapshot_version_length

4 byte integer

Length of the above char array.

write_set

variable length list to store the hash values.

Used to store the hash values of the rows identifier for the rows which have changed in the ongoing transaction.

read_set

variable length list to store the read set values. Currently empty.

Will be used to store the read set values of the current transaction.

Constructor & Destructor Documentation

◆ Transaction_context_event() [1/2]

binary_log::Transaction_context_event::Transaction_context_event ( const char *  buf,
const Format_description_event fde 
)

Decodes the transaction_context_log_event of the ongoing transaction.

The buffer layout is as follows
Parameters
bufContains the serialized event.
fdeAn FDE event (see Rotate_event constructor for more info).

◆ Transaction_context_event() [2/2]

binary_log::Transaction_context_event::Transaction_context_event ( unsigned int  thread_id_arg,
bool  is_gtid_specified_arg 
)
inline

◆ ~Transaction_context_event()

binary_log::Transaction_context_event::~Transaction_context_event ( )
override

Destructor of the Transaction_context_event class.

Member Function Documentation

◆ clear_set()

void binary_log::Transaction_context_event::clear_set ( std::list< const char * > *  set)
static

Function to clear the memory of the write_set and the read_set.

Parameters
[in]set- pointer to write_set or read_set.

◆ read_data_set()

static const char * binary_log::Transaction_context_event::read_data_set ( const char *  pos,
uint32_t  set_len,
std::list< const char * > *  set,
uint32_t  remaining_buffer 
)
static

Member Data Documentation

◆ ENCODED_GTID_SPECIFIED_OFFSET

const int binary_log::Transaction_context_event::ENCODED_GTID_SPECIFIED_OFFSET = 5
staticprotected

◆ ENCODED_READ_SET_ITEMS_OFFSET

const int binary_log::Transaction_context_event::ENCODED_READ_SET_ITEMS_OFFSET = 14
staticprotected

◆ ENCODED_READ_WRITE_SET_ITEM_LEN

const int binary_log::Transaction_context_event::ENCODED_READ_WRITE_SET_ITEM_LEN = 2
staticprotected

◆ ENCODED_SERVER_UUID_LEN_OFFSET

const int binary_log::Transaction_context_event::ENCODED_SERVER_UUID_LEN_OFFSET = 0
staticprotected

◆ encoded_snapshot_version

const unsigned char* binary_log::Transaction_context_event::encoded_snapshot_version
protected

◆ ENCODED_SNAPSHOT_VERSION_LEN

const int binary_log::Transaction_context_event::ENCODED_SNAPSHOT_VERSION_LEN = 2
staticprotected

◆ ENCODED_SNAPSHOT_VERSION_LEN_OFFSET

const int binary_log::Transaction_context_event::ENCODED_SNAPSHOT_VERSION_LEN_OFFSET = 6
staticprotected

◆ encoded_snapshot_version_length

uint32_t binary_log::Transaction_context_event::encoded_snapshot_version_length
protected

◆ ENCODED_THREAD_ID_OFFSET

const int binary_log::Transaction_context_event::ENCODED_THREAD_ID_OFFSET = 1
staticprotected

◆ ENCODED_WRITE_SET_ITEMS_OFFSET

const int binary_log::Transaction_context_event::ENCODED_WRITE_SET_ITEMS_OFFSET = 10
staticprotected

◆ gtid_specified

bool binary_log::Transaction_context_event::gtid_specified
protected

◆ read_set

std::list<const char *> binary_log::Transaction_context_event::read_set
protected

◆ server_uuid

const char* binary_log::Transaction_context_event::server_uuid
protected

◆ thread_id

uint32_t binary_log::Transaction_context_event::thread_id
protected

◆ write_set

std::list<const char *> binary_log::Transaction_context_event::write_set
protected

The documentation for this class was generated from the following files: