MySQL 8.0.39
Source Code Documentation
test_trace Namespace Reference

Classes

class  Logger
 
struct  st_trace_data
 State information maintained by the test trace plugin for each traced connection. More...
 

Typedefs

typedef unsigned char byte
 

Functions

static int plugin_init (char *a, size_t b, int argc, va_list args)
 
static int plugin_deinit ()
 
void * trace_start (struct st_mysql_client_plugin_TRACE *, MYSQL *conn, enum protocol_stage stage)
 
void trace_stop (struct st_mysql_client_plugin_TRACE *, MYSQL *conn, void *data)
 
int trace_event (struct st_mysql_client_plugin_TRACE *, void *data_ptr, MYSQL *conn, enum protocol_stage stage, enum trace_event ev, struct st_trace_event_args args)
 
int check_event_CONNECTING (MYSQL *, struct st_trace_data *, enum trace_event ev, struct st_trace_event_args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_INIT_PACKET (MYSQL *, struct st_trace_data *, enum trace_event ev, struct st_trace_event_args, enum protocol_stage *next_stage)
 
int check_event_AUTHENTICATE (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_SSL_NEGOTIATION (MYSQL *conn, struct st_trace_data *, enum trace_event ev, struct st_trace_event_args, enum protocol_stage *next_stage)
 
int check_event_READY_FOR_COMMAND (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_PACKET (MYSQL *conn, struct st_trace_data *, enum trace_event ev, struct st_trace_event_args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_RESULT (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_FIELD_DEF (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_ROW (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_PS_DESCRIPTION (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_WAIT_FOR_PARAM_DEF (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_FILE_REQUEST (MYSQL *conn, struct st_trace_data *data, enum trace_event ev, struct st_trace_event_args args, enum protocol_stage *next_stage)
 
int check_event_DISCONNECTED (MYSQL *, struct st_trace_data *, enum trace_event, struct st_trace_event_args, enum protocol_stage *)
 

Variables

static tracing_start_callback trace_start
 
static tracing_stop_callback trace_stop
 
static trace_event_handler trace_event
 
static bool logger_enabled = false
 
static Logger logger
 The "top-level" logger used when no connection context is given. More...
 
static bool opt_crash = false
 Global flag telling if test trace plugin should crash if it detects incorrect protocol flow (unexpected stage or invalid event for the current stage). More...
 

Typedef Documentation

◆ byte

typedef unsigned char test_trace::byte

Function Documentation

◆ check_event_AUTHENTICATE()

int test_trace::check_event_AUTHENTICATE ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_CONNECTING()

int test_trace::check_event_CONNECTING ( MYSQL ,
struct st_trace_data ,
enum trace_event  ev,
struct st_trace_event_args  ,
enum protocol_stage next_stage 
)

◆ check_event_DISCONNECTED()

int test_trace::check_event_DISCONNECTED ( MYSQL ,
struct st_trace_data ,
enum  trace_event,
struct st_trace_event_args  ,
enum protocol_stage  
)

◆ check_event_FILE_REQUEST()

int test_trace::check_event_FILE_REQUEST ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_READY_FOR_COMMAND()

int test_trace::check_event_READY_FOR_COMMAND ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_SSL_NEGOTIATION()

int test_trace::check_event_SSL_NEGOTIATION ( MYSQL conn,
struct st_trace_data ,
enum trace_event  ev,
struct st_trace_event_args  ,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_FIELD_DEF()

int test_trace::check_event_WAIT_FOR_FIELD_DEF ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_INIT_PACKET()

int test_trace::check_event_WAIT_FOR_INIT_PACKET ( MYSQL ,
struct st_trace_data ,
enum trace_event  ev,
struct st_trace_event_args  ,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_PACKET()

int test_trace::check_event_WAIT_FOR_PACKET ( MYSQL conn,
struct st_trace_data ,
enum trace_event  ev,
struct st_trace_event_args  ,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_PARAM_DEF()

int test_trace::check_event_WAIT_FOR_PARAM_DEF ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_PS_DESCRIPTION()

int test_trace::check_event_WAIT_FOR_PS_DESCRIPTION ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_RESULT()

int test_trace::check_event_WAIT_FOR_RESULT ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ check_event_WAIT_FOR_ROW()

int test_trace::check_event_WAIT_FOR_ROW ( MYSQL conn,
struct st_trace_data data,
enum trace_event  ev,
struct st_trace_event_args  args,
enum protocol_stage next_stage 
)

◆ plugin_deinit()

int test_trace::plugin_deinit ( )
static

◆ plugin_init()

int test_trace::plugin_init ( char *  a,
size_t  b,
int  argc,
va_list  args 
)
static

◆ trace_event()

int test_trace::trace_event ( struct st_mysql_client_plugin_TRACE ,
void *  data_ptr,
MYSQL conn,
enum protocol_stage  stage,
enum trace_event  ev,
struct st_trace_event_args  args 
)

◆ trace_start()

void * test_trace::trace_start ( struct st_mysql_client_plugin_TRACE ,
MYSQL conn,
enum protocol_stage  stage 
)

◆ trace_stop()

void test_trace::trace_stop ( struct st_mysql_client_plugin_TRACE ,
MYSQL conn,
void *  data 
)

Variable Documentation

◆ logger

Logger test_trace::logger
static

The "top-level" logger used when no connection context is given.

◆ logger_enabled

bool test_trace::logger_enabled = false
static

◆ opt_crash

bool test_trace::opt_crash = false
static

Global flag telling if test trace plugin should crash if it detects incorrect protocol flow (unexpected stage or invalid event for the current stage).

This can be used for detecting invalid protocol trace events in MTR tests, for example. The flag is set from environment variable MYSQL_TEST_TRACE_CRASH upon plugin initialization. By default it is disabled.

◆ trace_event

trace_event_handler test_trace::trace_event
static

◆ trace_start

tracing_start_callback test_trace::trace_start
static

◆ trace_stop

tracing_stop_callback test_trace::trace_stop
static