24#ifndef RPL_SYS_TABLE_ACCESS_INCLUDED
25#define RPL_SYS_TABLE_ACCESS_INCLUDED
84 bool close(
bool error,
bool ignore_global_read_lock =
false);
181 bool &err_val, std::string &err_msg,
182 uint table_index = 0,
186 bool &err_val, std::string &err_msg,
187 uint table_index = 0,
190 template <
class F,
class... Ts, std::size_t... Is>
192 std::index_sequence<Is...>) {
193 using tuple_list =
int[255];
194 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
197 template <
class F,
class... Ts>
202 template <
class F,
class... Ts, std::size_t... Is>
204 std::index_sequence<Is...>) {
205 using tuple_list =
int[255];
206 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
209 template <
class F,
class... Ts>
294 "replication_group_configuration_version"};
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1161
The class are wrappers for handler index and random scan functions to simplify their usage.
Definition: rpl_sys_table_access.h:43
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:203
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:191
bool delete_all_rows()
Delete all rows on m_schema_name.m_table_name.
Definition: rpl_sys_table_access.cc:264
~Rpl_sys_table_access()
Destruction.
Definition: rpl_sys_table_access.cc:49
std::string get_table_name()
Get table name of table accessed.
Definition: rpl_sys_table_access.h:272
std::string m_schema_name
Definition: rpl_sys_table_access.h:288
const uint m_table_data_index
Definition: rpl_sys_table_access.h:295
bool get_error()
Verify if error is set.
Definition: rpl_sys_table_access.h:104
Rpl_sys_table_access(const std::string &schema_name, const std::string &table_name, uint max_num_field)
Construction.
Definition: rpl_sys_table_access.cc:41
const uint m_table_list_size
Definition: rpl_sys_table_access.h:297
std::string m_table_name
Definition: rpl_sys_table_access.h:289
std::string get_db_name()
Get database name of table accessed.
Definition: rpl_sys_table_access.h:265
uint m_max_num_field
Definition: rpl_sys_table_access.h:290
bool open(enum thr_lock_type lock_type)
Creates new thread/session context (THD) and open's table on class object creation.
Definition: rpl_sys_table_access.cc:103
THD * m_current_thd
Definition: rpl_sys_table_access.h:279
static void handler_write_row_func(Rpl_sys_table_access &table_op, bool &err_val, std::string &err_msg, uint table_index=0, key_part_map keypart_map=HA_WHOLE_KEY)
Definition: rpl_sys_table_access.cc:211
bool delete_version()
Delete the version stored on m_schema_version_name.m_table_version_name for the m_schema_name....
Definition: rpl_sys_table_access.cc:379
bool store_field(Field *field, std::string fld, CHARSET_INFO *cs=&my_charset_bin)
Stores provided string to table's field.
Definition: rpl_sys_table_access.cc:51
std::string get_field_error_msg(std::string field_name) const
Definition: rpl_sys_table_access.cc:256
static void handler_delete_row_func(Rpl_sys_table_access &table_op, bool &err_val, std::string &err_msg, uint table_index=0, key_part_map keypart_map=HA_WHOLE_KEY)
Definition: rpl_sys_table_access.cc:224
const uint m_table_version_index
Definition: rpl_sys_table_access.h:296
bool close(bool error, bool ignore_global_read_lock=false)
All opened tables with the open_tables are closed and removes THD created in close().
Definition: rpl_sys_table_access.cc:173
enum thr_lock_type m_lock_type
Definition: rpl_sys_table_access.h:286
ulonglong get_version()
Return the version stored on m_schema_version_name.m_table_version_name for the m_schema_name....
Definition: rpl_sys_table_access.cc:357
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:210
bool get_field(Field *field, std::string &fld, CHARSET_INFO *cs=&my_charset_bin)
Retrieves string field from provided table's field.
Definition: rpl_sys_table_access.cc:76
const std::string m_table_version_name
Definition: rpl_sys_table_access.h:293
THD * m_thd
Definition: rpl_sys_table_access.h:276
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:198
bool m_error
Definition: rpl_sys_table_access.h:282
bool update_version(ulonglong version)
Update the version stored on m_schema_version_name.m_table_version_name for the m_schema_name....
Definition: rpl_sys_table_access.cc:324
TABLE * get_table()
Get TABLE object created for the table access purposes.
Definition: rpl_sys_table_access.cc:203
bool increment_version()
Increment the version stored on m_schema_version_name.m_table_version_name for the m_schema_name....
Definition: rpl_sys_table_access.cc:287
void set_error()
Set error.
Definition: rpl_sys_table_access.h:96
const std::string m_schema_version_name
Definition: rpl_sys_table_access.h:292
Table_ref * m_table_list
Definition: rpl_sys_table_access.h:285
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:511
#define HA_WHOLE_KEY
Definition: my_base.h:1008
ulong key_part_map
Definition: my_base.h:1007
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: commit_order_queue.h:34
const char * table_name
Definition: rules_table_service.cc:56
required uint64 version
Definition: replication_group_member_actions.proto:41
Definition: m_ctype.h:385
thr_lock_type
Definition: thr_lock.h:51
unsigned int uint
Definition: uca9-dump.cc:75