24#ifndef RPL_SYS_TABLE_ACCESS_INCLUDED
25#define RPL_SYS_TABLE_ACCESS_INCLUDED
54 const std::string &
table_name, uint max_num_field);
86 bool close(
bool error,
bool ignore_global_read_lock =
false);
183 bool &err_val, std::string &err_msg,
184 uint table_index = 0,
188 bool &err_val, std::string &err_msg,
189 uint table_index = 0,
192 template <
class F,
class... Ts, std::size_t... Is>
194 std::index_sequence<Is...>) {
195 using tuple_list =
int[255];
196 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
199 template <
class F,
class... Ts>
204 template <
class F,
class... Ts, std::size_t... Is>
206 std::index_sequence<Is...>) {
207 using tuple_list =
int[255];
208 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
211 template <
class F,
class... Ts>
296 "replication_group_configuration_version"};
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1153
The class are wrappers for handler index and random scan functions to simplify their usage.
Definition: rpl_sys_table_access.h:45
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:205
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:193
bool delete_all_rows()
Delete all rows on m_schema_name.m_table_name.
Definition: rpl_sys_table_access.cc:266
~Rpl_sys_table_access()
Destruction.
Definition: rpl_sys_table_access.cc:51
std::string get_table_name()
Get table name of table accessed.
Definition: rpl_sys_table_access.h:274
std::string m_schema_name
Definition: rpl_sys_table_access.h:290
const uint m_table_data_index
Definition: rpl_sys_table_access.h:297
bool get_error()
Verify if error is set.
Definition: rpl_sys_table_access.h:106
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:43
const uint m_table_list_size
Definition: rpl_sys_table_access.h:299
std::string m_table_name
Definition: rpl_sys_table_access.h:291
std::string get_db_name()
Get database name of table accessed.
Definition: rpl_sys_table_access.h:267
uint m_max_num_field
Definition: rpl_sys_table_access.h:292
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:105
THD * m_current_thd
Definition: rpl_sys_table_access.h:281
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:213
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:381
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:53
std::string get_field_error_msg(std::string field_name) const
Definition: rpl_sys_table_access.cc:258
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:226
const uint m_table_version_index
Definition: rpl_sys_table_access.h:298
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:175
enum thr_lock_type m_lock_type
Definition: rpl_sys_table_access.h:288
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:359
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:212
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:78
const std::string m_table_version_name
Definition: rpl_sys_table_access.h:295
THD * m_thd
Definition: rpl_sys_table_access.h:278
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:200
bool m_error
Definition: rpl_sys_table_access.h:284
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:326
TABLE * get_table()
Get TABLE object created for the table access purposes.
Definition: rpl_sys_table_access.cc:205
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:289
void set_error()
Set error.
Definition: rpl_sys_table_access.h:98
const std::string m_schema_version_name
Definition: rpl_sys_table_access.h:294
Table_ref * m_table_list
Definition: rpl_sys_table_access.h:287
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:509
#define HA_WHOLE_KEY
Definition: my_base.h:1009
ulong key_part_map
Definition: my_base.h:1008
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:423
thr_lock_type
Definition: thr_lock.h:51