24#ifndef RPL_GTID_PERSIST_H_
25#define RPL_GTID_PERSIST_H_
35#include "mysqld_error.h"
295 const char *tag,
rpl_gno gno_start,
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Represents a set of GTIDs.
Definition: rpl_gtid.h:1556
Definition: rpl_gtid_persist.h:46
void before_open(THD *thd) override
Prepares before opening table.
Definition: rpl_gtid_persist.cc:125
bool deinit(THD *thd, TABLE *table, bool error, bool need_commit)
De-initialize the gtid_executed table access context as following:
Definition: rpl_gtid_persist.cc:173
Gtid_table_access_context & operator=(const Gtid_table_access_context &info)
bool m_is_write
Definition: rpl_gtid_persist.h:104
static const LEX_CSTRING DB_NAME
Definition: rpl_gtid_persist.h:48
THD * m_drop_thd_object
Definition: rpl_gtid_persist.h:102
static const LEX_CSTRING TABLE_NAME
Definition: rpl_gtid_persist.h:49
Gtid_table_access_context()
Definition: rpl_gtid_persist.h:51
ulonglong m_tmp_disable_binlog__save_options
Definition: rpl_gtid_persist.h:108
~Gtid_table_access_context() override=default
bool init(THD **thd, TABLE **table, bool is_write)
Initialize the gtid_executed table access context as following:
Definition: rpl_gtid_persist.cc:136
void drop_thd(THD *thd)
Definition: rpl_gtid_persist.cc:120
THD * create_thd()
Creates a new thread in the bootstrap process or in the mysqld startup, a thread is created in order ...
Definition: rpl_gtid_persist.cc:107
Gtid_table_access_context(const Gtid_table_access_context &info)
Open_tables_backup m_backup
Definition: rpl_gtid_persist.h:106
bool m_skip_readonly_set
Definition: rpl_gtid_persist.h:111
Definition: rpl_gtid_persist.h:119
std::atomic< int64 > m_atomic_count
Definition: rpl_gtid_persist.h:240
int save(THD *thd, const Gtid *gtid)
Insert the gtid into table.
Definition: rpl_gtid_persist.cc:360
void get_gtid_interval(TABLE *table, std::string &sid, std::string &tag, rpl_gno &gno_start, rpl_gno &gno_end)
Get gtid interval from the the current row of the table.
Definition: rpl_gtid_persist.cc:674
int warn_or_err_on_explicit_modification(THD *thd, Table_ref *table)
Push a warning to client if user is modifying the gtid_executed table explicitly by a non-XA transact...
Definition: rpl_gtid_persist.h:209
Gtid_table_persistor & operator=(const Gtid_table_persistor &info)
static const uint number_fields
the number of fields in mysql.gtid_executed
Definition: rpl_gtid_persist.h:121
int compress(THD *thd)
Compress the gtid_executed table completely by employing one or more transactions.
Definition: rpl_gtid_persist.cc:501
std::string encode_gtid_text(TABLE *table)
Encode the current row fetched from the table into gtid text.
Definition: rpl_gtid_persist.cc:652
int reset(THD *thd)
Delete all rows from the table.
Definition: rpl_gtid_persist.cc:628
int delete_all(TABLE *table)
Delete all rows in the gtid_executed table.
Definition: rpl_gtid_persist.cc:739
Gtid_table_persistor(const Gtid_table_persistor &info)
int write_row(TABLE *table, const char *sid, const char *tag, rpl_gno gno_start, rpl_gno gno_end)
Write a gtid interval into the gtid_executed table.
Definition: rpl_gtid_persist.cc:248
Gtid_table_persistor()=default
int compress_in_single_transaction(THD *thd, bool &is_complete)
Compress the gtid_executed table, read each row by the PK(sid, tag, gno_start) in increasing order,...
Definition: rpl_gtid_persist.cc:520
virtual ~Gtid_table_persistor()=default
int compress_first_consecutive_range(TABLE *table, bool &is_complete)
Read each row by the PK(sid, tag, gno_start) in increasing order, compress the first consecutive rang...
Definition: rpl_gtid_persist.cc:552
int fill_fields(Field **fields, const char *sid, const char *tag, rpl_gno gno_start, rpl_gno gno_end)
Fill a gtid interval into fields of the gtid_executed table.
Definition: rpl_gtid_persist.cc:209
int fetch_gtids(Gtid_set *gtid_set)
Fetch gtids from gtid_executed table and store them into gtid_executed set.
Definition: rpl_gtid_persist.cc:693
int update_row(TABLE *table, const char *sid, const char *tag, rpl_gno gno_start, rpl_gno new_gno_end)
Update a gtid interval in the gtid_executed table.
Definition: rpl_gtid_persist.cc:281
Storage for backup of Open_tables_state.
Definition: sql_class.h:693
A base class for accessing a system table.
Definition: rpl_table_access.h:40
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
void raise_error_printf(uint code,...)
Raise an exception condition, with a formatted message.
Definition: sql_class.cc:944
bool is_operating_gtid_table_implicitly
Definition: sql_class.h:2361
void raise_warning_printf(uint code,...)
Raise a completion condition (warning), with a formatted message.
Definition: sql_class.cc:961
Transaction_ctx * get_transaction()
Definition: sql_class.h:2135
XID_STATE * xid_state()
Definition: transaction_info.h:282
@ XA_ACTIVE
Definition: xa.h:299
bool has_state(xa_states state) const
Definition: xa.h:347
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47
mysql::gtid::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of mysql::gtid::gno_t.
Definition: rpl_gtid.h:112
void create_compress_gtid_table_thread()
Create the compression thread to compress gtid_executed table.
Definition: rpl_gtid_persist.cc:837
void terminate_compress_gtid_table_thread()
Terminate the compression thread.
Definition: rpl_gtid_persist.cc:877
Gtid_table_persistor * gtid_table_persistor
Definition: mysqld.cc:1827
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1100
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
@ TL_WRITE_ALLOW_WRITE
Definition: thr_lock.h:73