37#define MYSQL_THD THD *
39#define MYSQL_THD void *
223#define TRANS_PARAM_ZERO(trans_param_obj) \
224 memset(&trans_param_obj, 0, sizeof(Trans_param));
524 unsigned char *header,
unsigned long size,
540 unsigned char *packet,
unsigned long len,
560 const char *event_buf,
unsigned long len,
561 const char *skipped_log_file,
692 const char *packet,
unsigned long len,
693 const char **event_buf,
694 unsigned long *event_len);
708 const char *event_buf,
888 const char *src_function,
const char *src_file,
891#define THD_ENTER_COND(P1, P2, P3, P4, P5) \
892 thd_enter_cond(P1, P2, P3, P4, P5, __func__, __FILE__, __LINE__)
909 const char *src_function,
const char *src_file,
912#define THD_EXIT_COND(P1, P2) \
913 thd_exit_cond(P1, P2, __func__, __FILE__, __LINE__)
967 unsigned int precision,
int *null_value);
Byte container that provides a storage for serializing session binlog events.
Definition: binlog_ostream.h:174
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
const char * p
Definition: ctype-mb.cc:1235
static int flags[50]
Definition: hp_test1.cc:40
Instrumentation helpers for mysys threads.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
uint32_t uint32
Definition: my_inttypes.h:67
uint32 my_thread_id
Definition: my_thread_local.h:34
Logfile log_file
Definition: mysqltest.cc:271
size_t size(const char *const c)
Definition: base64.h:46
int(* after_commit_t)(Trans_param *param)
This callback is called after transaction commit.
Definition: replication.h:270
int(* after_dd_upgrade_t)(Server_state_param *param)
This is called just after an upgrade from MySQL 5.7 populates the data dictionary for the first time.
Definition: replication.h:404
struct Server_state_observer Server_state_observer
Observer server state.
int(* applier_start_t)(Binlog_relay_IO_param *param)
This callback is called when a relay log consumer thread starts.
Definition: replication.h:650
int(* after_send_event_t)(Binlog_transmit_param *param, const char *event_buf, unsigned long len, const char *skipped_log_file, my_off_t skipped_log_pos)
This callback is called after an event packet is sent to the slave or is skipped.
Definition: replication.h:559
int(* thread_stop_t)(Binlog_relay_IO_param *param)
This callback is called when slave IO thread stops.
Definition: replication.h:640
int(* after_reset_slave_t)(Binlog_relay_IO_param *param)
This callback is called after reset replica relay log IO status.
Definition: replication.h:719
int(* thread_start_t)(Binlog_relay_IO_param *param)
This callback is called when slave IO thread starts.
Definition: replication.h:630
struct Trans_context_info Trans_context_info
This represents some of the context in which a transaction is running It summarizes all necessary req...
struct Trans_param Trans_param
Transaction observer parameter.
Binlog_storage_flags
Binlog storage flags.
Definition: replication.h:319
@ BINLOG_STORAGE_IS_SYNCED
Binary log was sync:ed.
Definition: replication.h:321
int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
Register a binlog relay IO (slave IO thread) observer.
Definition: rpl_handler.cc:1336
Binlog_relay_IO_flags
Binlog relay IO flags.
Definition: replication.h:594
@ BINLOG_RELAY_IS_SYNCED
Binary relay log was sync:ed.
Definition: replication.h:596
int register_server_state_observer(Server_state_observer *observer, void *p)
Register a server state observer.
Definition: rpl_handler.cc:1312
int get_user_var_str(const char *name, char *value, size_t len, unsigned int precision, int *null_value)
Get the value of user variable as a string.
Definition: rpl_handler.cc:333
int(* before_request_transmit_t)(Binlog_relay_IO_param *param, uint32 flags)
This callback is called before slave requesting binlog transmission from master.
Definition: replication.h:676
void thd_exit_cond(void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line)
Set thread leaving a condition.
Definition: sql_thd_internal_api.cc:203
int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p)
Unregister a binlog storage observer.
Definition: rpl_handler.cc:1307
struct Server_state_param Server_state_param
int(* begin_t)(Trans_param *param, int &out_val)
This callback is called before a sql command is executed.
Definition: replication.h:300
struct Trans_table_info Trans_table_info
This represents table metadata involved in a transaction.
int(* after_reset_master_t)(Binlog_transmit_param *param)
This callback is called after resetting master status.
Definition: replication.h:575
int register_trans_observer(Trans_observer *observer, void *p)
Register a transaction observer.
Definition: rpl_handler.cc:1291
int get_user_var_real(const char *name, double *value, int *null_value)
Get the value of user variable as a double precision float number.
Definition: rpl_handler.cc:315
int register_binlog_storage_observer(Binlog_storage_observer *observer, void *p)
Register a binlog storage observer.
Definition: rpl_handler.cc:1299
int(* transmit_stop_t)(Binlog_transmit_param *param)
This callback is called when binlog dumping stops.
Definition: replication.h:502
struct Binlog_storage_observer Binlog_storage_observer
Observe binlog logging storage.
int(* after_recovery_t)(Server_state_param *param)
This callback is called after the end of the recovery procedure.
Definition: replication.h:371
int(* after_server_shutdown_t)(Server_state_param *param)
This callback is called after the end of the shutdown procedure.
Definition: replication.h:393
int(* before_recovery_t)(Server_state_param *param)
This callback is called before the start of the recovery.
Definition: replication.h:348
int(* before_commit_t)(Trans_param *param)
This callback is called before transaction commit.
Definition: replication.h:239
int(* after_sync_t)(Binlog_storage_param *param, const char *log_file, my_off_t log_pos)
Definition: replication.h:444
struct Binlog_relay_IO_observer Binlog_relay_IO_observer
Observes and extends the service of slave IO thread.
int(* before_rollback_t)(Trans_param *param)
This callback is called before transaction rollback.
Definition: replication.h:251
int(* after_read_event_t)(Binlog_relay_IO_param *param, const char *packet, unsigned long len, const char **event_buf, unsigned long *event_len)
This callback is called after read an event packet from master.
Definition: replication.h:691
int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
Unregister a binlog transmit observer.
Definition: rpl_handler.cc:1331
int(* applier_log_event_t)(Binlog_relay_IO_param *param, Trans_param *trans_param, int &out)
This callback is called before event gets applied.
Definition: replication.h:732
int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
Unregister a binlog relay IO (slave IO thread) observer.
Definition: rpl_handler.cc:1341
struct Binlog_storage_param Binlog_storage_param
Binlog storage observer parameters.
int(* before_dml_t)(Trans_param *param, int &out_val)
Definition: replication.h:226
void thd_enter_cond(void *opaque_thd, mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)
Set thread entering a condition.
Definition: sql_thd_internal_api.cc:190
int(* before_server_shutdown_t)(Server_state_param *param)
This callback is called before the start of the shutdown procedure.
Definition: replication.h:382
int(* after_engine_recovery_t)(Server_state_param *param)
This callback is called after the end of the engine recovery.
Definition: replication.h:361
struct Trans_gtid_info Trans_gtid_info
This represents the GTID context of the transaction.
struct Trans_observer Trans_observer
Observes and extends transaction execution.
Trans_flags
Transaction observer flags.
Definition: replication.h:69
@ TRANS_IS_REAL_TRANS
Transaction is a real transaction.
Definition: replication.h:71
int(* before_handle_connection_t)(Server_state_param *param)
This is called just before the server is ready to accept the client connections to the Server/Node.
Definition: replication.h:338
int(* after_flush_t)(Binlog_storage_param *param, const char *log_file, my_off_t log_pos)
This callback is called after binlog has been flushed.
Definition: replication.h:442
struct Binlog_relay_IO_param Binlog_relay_IO_param
Replication binlog relay IO observer parameter.
int(* applier_stop_t)(Binlog_relay_IO_param *param, bool aborted)
This callback is called when a relay log consumer thread stops.
Definition: replication.h:661
int(* after_queue_event_t)(Binlog_relay_IO_param *param, const char *event_buf, unsigned long event_len, uint32 flags)
This callback is called after written an event packet to relay log.
Definition: replication.h:707
int register_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
Register a binlog transmit observer.
Definition: rpl_handler.cc:1326
int unregister_trans_observer(Trans_observer *observer, void *p)
Unregister a transaction observer.
Definition: rpl_handler.cc:1295
int get_user_var_int(const char *name, long long int *value, int *null_value)
Get the value of user variable as an integer.
Definition: rpl_handler.cc:297
int(* after_rollback_t)(Trans_param *param)
This callback is called after transaction rollback.
Definition: replication.h:289
int(* transmit_start_t)(Binlog_transmit_param *param, const char *log_file, my_off_t log_pos)
This callback is called when binlog dumping starts.
Definition: replication.h:491
struct Binlog_transmit_param Binlog_transmit_param
Replication binlog transmitter (binlog dump) observer parameter.
int unregister_server_state_observer(Server_state_observer *observer, void *p)
Unregister a server state observer.
Definition: rpl_handler.cc:1320
int(* before_send_event_t)(Binlog_transmit_param *param, unsigned char *packet, unsigned long len, const char *log_file, my_off_t log_pos)
This callback is called before sending an event packet to slave.
Definition: replication.h:539
int(* reserve_header_t)(Binlog_transmit_param *param, unsigned char *header, unsigned long size, unsigned long *len)
This callback is called to reserve bytes in packet header for event transmission.
Definition: replication.h:523
struct Binlog_transmit_observer Binlog_transmit_observer
Observe and extends the binlog dumping thread.
enum_rpl_channel_type
Type of replication channel thread/transaction might be associated to.
Definition: rpl_context.h:50
enum_tx_isolation
Definition: handler.h:3186
case opt name
Definition: sslopt-case.h:29
Observes and extends the service of slave IO thread.
Definition: replication.h:738
applier_start_t applier_start
Definition: replication.h:743
applier_log_event_t applier_log_event
Definition: replication.h:749
after_read_event_t after_read_event
Definition: replication.h:746
after_reset_slave_t after_reset_slave
Definition: replication.h:748
thread_start_t thread_start
Definition: replication.h:741
before_request_transmit_t before_request_transmit
Definition: replication.h:745
after_queue_event_t after_queue_event
Definition: replication.h:747
uint32 len
Definition: replication.h:739
applier_stop_t applier_stop
Definition: replication.h:744
thread_stop_t thread_stop
Definition: replication.h:742
Replication binlog relay IO observer parameter.
Definition: replication.h:602
my_off_t master_log_pos
Definition: replication.h:615
unsigned int port
Definition: replication.h:612
bool source_connection_auto_failover
Definition: replication.h:619
char * channel_name
Definition: replication.h:607
char * host
Definition: replication.h:610
char * master_log_name
Definition: replication.h:614
char * user
Definition: replication.h:611
MYSQL * mysql
Definition: replication.h:617
uint32 server_id
Definition: replication.h:603
my_thread_id thread_id
Definition: replication.h:604
Observe binlog logging storage.
Definition: replication.h:450
uint32 len
Definition: replication.h:451
after_flush_t after_flush
Definition: replication.h:453
after_sync_t after_sync
Definition: replication.h:454
Binlog storage observer parameters.
Definition: replication.h:425
uint32 server_id
Definition: replication.h:426
Observe and extends the binlog dumping thread.
Definition: replication.h:580
before_send_event_t before_send_event
Definition: replication.h:586
after_reset_master_t after_reset_master
Definition: replication.h:588
after_send_event_t after_send_event
Definition: replication.h:587
uint32 len
Definition: replication.h:581
transmit_start_t transmit_start
Definition: replication.h:583
reserve_header_t reserve_header
Definition: replication.h:585
transmit_stop_t transmit_stop
Definition: replication.h:584
Replication binlog transmitter (binlog dump) observer parameter.
Definition: replication.h:460
static const uint32 F_DONT_OBSERVE
Definition: replication.h:465
bool should_observe()
If F_OBSERVE is set by any plugin, then it should observe binlog transmission, even F_DONT_OBSERVE is...
Definition: replication.h:476
void set_observe_flag()
Definition: replication.h:467
static const uint32 F_OBSERVE
Definition: replication.h:464
void set_dont_observe_flag()
Definition: replication.h:468
uint32 server_id
Definition: replication.h:461
uint32 flags
Definition: replication.h:462
Stage instrument information.
Definition: psi_stage_bits.h:74
Observer server state.
Definition: replication.h:409
after_engine_recovery_t after_engine_recovery
Definition: replication.h:414
before_recovery_t before_recovery
Definition: replication.h:413
before_server_shutdown_t before_server_shutdown
Definition: replication.h:416
before_handle_connection_t before_handle_connection
Definition: replication.h:412
after_dd_upgrade_t after_dd_upgrade_from_57
Definition: replication.h:419
after_server_shutdown_t after_server_shutdown
Definition: replication.h:417
uint32 len
Definition: replication.h:410
after_recovery_t after_recovery
Definition: replication.h:415
Definition: replication.h:324
uint32 server_id
Definition: replication.h:325
This represents some of the context in which a transaction is running It summarizes all necessary req...
Definition: replication.h:100
ulong gtid_mode
Definition: replication.h:102
bool parallel_applier_preserve_commit_order
Definition: replication.h:110
bool log_replica_updates
Definition: replication.h:103
enum_tx_isolation tx_isolation
Definition: replication.h:111
ulong parallel_applier_workers
Definition: replication.h:109
ulong binlog_format
Definition: replication.h:106
bool default_table_encryption
Definition: replication.h:113
bool binlog_enabled
Definition: replication.h:101
ulong parallel_applier_type
Definition: replication.h:108
uint lower_case_table_names
Definition: replication.h:112
ulong binlog_checksum_options
Definition: replication.h:104
This represents the GTID context of the transaction.
Definition: replication.h:119
int sidno
transaction sidno
Definition: replication.h:125
long long int gno
transaction gno
Definition: replication.h:127
ulong type
enum values in enum_gtid_type
Definition: replication.h:123
mysql::gtid::Tsid_plain tsid
transaction specified TSID, filled in the after-commit hook
Definition: replication.h:121
mysql::gtid::Tag_plain automatic_tag
defined tag for automatic GTIDs, propagated in the before-commit hook
Definition: replication.h:129
Observes and extends transaction execution.
Definition: replication.h:305
before_commit_t before_commit
Definition: replication.h:309
begin_t begin
Definition: replication.h:313
before_dml_t before_dml
Definition: replication.h:308
before_rollback_t before_rollback
Definition: replication.h:310
after_commit_t after_commit
Definition: replication.h:311
uint32 len
Definition: replication.h:306
after_rollback_t after_rollback
Definition: replication.h:312
Transaction observer parameter.
Definition: replication.h:136
THD * thd
pointer to server THD
Definition: replication.h:217
Binlog_cache_storage * trx_cache_log
Definition: replication.h:160
const char * server_uuid
Definition: replication.h:138
enum_rpl_channel_type rpl_channel_type
Replication channel info associated to this transaction/THD.
Definition: replication.h:185
uint32 server_id
Definition: replication.h:137
ulonglong cache_log_max_size
Definition: replication.h:162
my_off_t log_pos
Definition: replication.h:150
const char * log_file
Definition: replication.h:149
unsigned long long * original_commit_timestamp
pointer to the status var original_commit_timestamp
Definition: replication.h:182
Binlog_cache_storage * stmt_cache_log
Definition: replication.h:161
ulong group_replication_consistency
contains the session value of group_replication_consistency
Definition: replication.h:188
Trans_gtid_info gtid_info
Definition: replication.h:155
Trans_context_info trans_ctx_info
Definition: replication.h:179
my_thread_id thread_id
Definition: replication.h:139
uint32_t * immediate_server_version
pointer to immediate_server_version
Definition: replication.h:197
uint number_of_tables
Definition: replication.h:174
Trans_table_info * tables_info
Definition: replication.h:173
bool is_atomic_ddl
Definition: replication.h:167
uint32_t * original_server_version
pointer to original_server_version
Definition: replication.h:194
ulong hold_timeout
value of session wait_timeout, timeout to hold transaction
Definition: replication.h:191
bool is_create_table_as_query_block
Definition: replication.h:214
uint32 flags
Definition: replication.h:140
This represents table metadata involved in a transaction.
Definition: replication.h:77
int db_type
The db_type of the storage engine used by the table.
Definition: replication.h:81
bool has_cascade_foreign_key
information to store if the table has foreign key with 'CASCADE' clause.
Definition: replication.h:83
const char * table_name
Definition: replication.h:78
uint number_of_primary_keys
Definition: replication.h:79
Tag representation so that:
Definition: tag_plain.h:48
TSID representation so that:
Definition: tsid_plain.h:41
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Struct to share server ssl variables.
Definition: replication.h:49
char * ssl_crl
Definition: replication.h:57
char * tls_ciphersuites
Definition: replication.h:53
char * ssl_cert
Definition: replication.h:54
char * ssl_key
Definition: replication.h:56
char * tls_version
Definition: replication.h:52
void init()
Definition: rpl_group_replication.cc:74
void deinit()
Definition: rpl_group_replication.cc:87
char * ssl_capath
Definition: replication.h:51
char * ssl_ca
Definition: replication.h:50
char * ssl_cipher
Definition: replication.h:55
unsigned int ssl_fips_mode
Definition: replication.h:59
char * ssl_crlpath
Definition: replication.h:58