23#ifndef RPL_SYS_TABLE_ACCESS_INCLUDED
24#define RPL_SYS_TABLE_ACCESS_INCLUDED
53 const std::string &
table_name, uint max_num_field);
85 bool close(
bool error,
bool ignore_global_read_lock =
false);
182 bool &err_val, std::string &err_msg,
183 uint table_index = 0,
187 bool &err_val, std::string &err_msg,
188 uint table_index = 0,
191 template <
class F,
class... Ts, std::size_t... Is>
193 std::index_sequence<Is...>) {
194 using tuple_list =
int[255];
195 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
198 template <
class F,
class... Ts>
203 template <
class F,
class... Ts, std::size_t... Is>
205 std::index_sequence<Is...>) {
206 using tuple_list =
int[255];
207 (void)tuple_list{0, ((void)func(Is, std::get<Is>(tuple)), 0)...};
210 template <
class F,
class... Ts>
295 "replication_group_configuration_version"};
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1168
The class are wrappers for handler index and random scan functions to simplify their usage.
Definition: rpl_sys_table_access.h:44
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:204
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
Definition: rpl_sys_table_access.h:192
bool delete_all_rows()
Delete all rows on m_schema_name.m_table_name.
Definition: rpl_sys_table_access.cc:265
~Rpl_sys_table_access()
Destruction.
Definition: rpl_sys_table_access.cc:50
std::string get_table_name()
Get table name of table accessed.
Definition: rpl_sys_table_access.h:273
std::string m_schema_name
Definition: rpl_sys_table_access.h:289
const uint m_table_data_index
Definition: rpl_sys_table_access.h:296
bool get_error()
Verify if error is set.
Definition: rpl_sys_table_access.h:105
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:42
const uint m_table_list_size
Definition: rpl_sys_table_access.h:298
std::string m_table_name
Definition: rpl_sys_table_access.h:290
std::string get_db_name()
Get database name of table accessed.
Definition: rpl_sys_table_access.h:266
uint m_max_num_field
Definition: rpl_sys_table_access.h:291
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:104
THD * m_current_thd
Definition: rpl_sys_table_access.h:280
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:212
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:380
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:52
std::string get_field_error_msg(std::string field_name) const
Definition: rpl_sys_table_access.cc:257
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:225
const uint m_table_version_index
Definition: rpl_sys_table_access.h:297
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:174
enum thr_lock_type m_lock_type
Definition: rpl_sys_table_access.h:287
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:358
static void for_each_in_tuple(const std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:211
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:77
const std::string m_table_version_name
Definition: rpl_sys_table_access.h:294
THD * m_thd
Definition: rpl_sys_table_access.h:277
static void for_each_in_tuple(std::tuple< Ts... > &tuple, F func)
Definition: rpl_sys_table_access.h:199
bool m_error
Definition: rpl_sys_table_access.h:283
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:325
TABLE * get_table()
Get TABLE object created for the table access purposes.
Definition: rpl_sys_table_access.cc:204
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:288
void set_error()
Set error.
Definition: rpl_sys_table_access.h:97
const std::string m_schema_version_name
Definition: rpl_sys_table_access.h:293
Table_ref * m_table_list
Definition: rpl_sys_table_access.h:286
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:508
#define HA_WHOLE_KEY
Definition: my_base.h:1007
ulong key_part_map
Definition: my_base.h:1006
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Definition: commit_order_queue.h:33
const char * table_name
Definition: rules_table_service.cc:55
required uint64 version
Definition: replication_group_member_actions.proto:40
Definition: m_ctype.h:422
thr_lock_type
Definition: thr_lock.h:50