171 const String &filter_rule,
224 bool db_ok(
const char *db,
bool need_increase_counter =
true);
328#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
337 const char *channel_name);
495 bool array_inited,
bool *hash_inited);
537#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:309
void rdlock()
Acquire the read lock.
Definition: rpl_gtid.h:460
void wrlock()
Acquire the write lock.
Definition: rpl_gtid.h:469
void assert_some_rdlock() const
Assert that some thread holds the read lock.
Definition: rpl_gtid.h:548
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_gtid.h:480
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_gtid.h:550
Definition: sql_list.h:811
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
The class Rpl_filter_statistics encapsulates the following three statistics of replication filter: Th...
Definition: rpl_filter.h:106
Rpl_filter_statistics(Rpl_filter_statistics const &)
enum_configured_by get_configured_by()
Definition: rpl_filter.h:119
void increase_counter()
Definition: rpl_filter.h:122
enum_configured_by m_configured_by
Definition: rpl_filter.h:133
void reset()
Definition: rpl_filter.cc:96
void set_all(enum_configured_by configured_by)
Definition: rpl_filter.cc:102
ulonglong m_active_since
Definition: rpl_filter.h:136
ulonglong get_active_since()
Definition: rpl_filter.h:120
Rpl_filter_statistics & operator=(Rpl_filter_statistics const &)
ulonglong get_counter()
Definition: rpl_filter.h:121
Rpl_filter_statistics()
Definition: rpl_filter.cc:92
std::atomic< uint64 > m_atomic_counter
Definition: rpl_filter.h:143
Rpl_filter.
Definition: rpl_filter.h:214
int build_ignore_table_hash()
Definition: rpl_filter.cc:642
bool is_attached()
Check if the relation between the per-channel filter and the channel's Relay_log_info is established.
Definition: rpl_filter.h:372
int add_string_list(I_List< i_string > *list, const char *spec)
Definition: rpl_filter.cc:907
collation_unordered_map< std::string, unique_ptr_my_free< TABLE_RULE_ENT > > Table_rule_hash
Definition: rpl_filter.h:450
int add_string_pair_list(I_List< i_string_pair > *list, const char *key, const char *val)
Definition: rpl_filter.cc:926
void free_string_pair_list(I_List< i_string_pair > *l)
Definition: rpl_filter.cc:1013
void get_wild_do_table(String *str)
Definition: rpl_filter.cc:1146
bool is_empty()
Check if the replication filter is empty or not.
Definition: rpl_filter.cc:179
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_filter.h:353
int(Rpl_filter::* Add_filter)(char const *)
Definition: rpl_filter.h:273
Rpl_filter_statistics wild_ignore_table_statistics
Definition: rpl_filter.h:385
void set_attached()
Set attached to true when the relation between the per-channel filter and the channel's Relay_log_inf...
Definition: rpl_filter.h:378
void free_string_list(I_List< i_string > *l)
Definition: rpl_filter.cc:1000
Rpl_filter_statistics * get_rewrite_db_statistics()
Definition: rpl_filter.h:321
int build_table_hash_from_array(Table_rule_array *table_array, Table_rule_hash **table_hash, bool array_inited, bool *hash_inited)
Table rules are initially added to DYNAMIC_LIST, and then, when the charset to use for tables has bee...
Definition: rpl_filter.cc:673
int set_db_rewrite(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:884
I_List< i_string > * get_do_db()
Definition: rpl_filter.cc:1193
void init_table_rule_hash(Table_rule_hash **h, bool *h_inited)
Definition: rpl_filter.cc:965
virtual ~Rpl_filter()
Definition: rpl_filter.cc:145
Table_rule_hash * do_table_hash
Definition: rpl_filter.h:502
int set_ignore_table(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:818
Rpl_filter_statistics ignore_table_statistics
Definition: rpl_filter.h:383
bool wild_ignore_table_inited
Definition: rpl_filter.h:516
Table_rule_array wild_ignore_table
Definition: rpl_filter.h:509
int build_do_table_hash()
Definition: rpl_filter.cc:618
Rpl_filter()
Definition: rpl_filter.cc:121
Rpl_filter(Rpl_filter const &)
int set_do_table(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:792
bool ignore_table_hash_inited
Definition: rpl_filter.h:512
bool is_on()
Definition: rpl_filter.cc:567
Rpl_filter_statistics do_table_statistics
Definition: rpl_filter.h:382
const char * get_rewrite_db(const char *db, size_t *new_len)
Definition: rpl_filter.cc:1174
I_List< i_string > ignore_db
Definition: rpl_filter.h:519
void assert_some_wrlock()
Assert that some thread holds the write lock.
Definition: rpl_filter.h:358
I_List< i_string_pair > rewrite_db
Definition: rpl_filter.h:521
int add_do_db(const char *db_spec)
Definition: rpl_filter.cc:953
I_List< i_string > * get_ignore_db()
Definition: rpl_filter.cc:1209
bool db_ok(const char *db, bool need_increase_counter=true)
Definition: rpl_filter.cc:456
void get_do_table(String *str)
Definition: rpl_filter.cc:1138
Rpl_filter_statistics wild_do_table_statistics
Definition: rpl_filter.h:384
bool do_table_array_inited
Definition: rpl_filter.h:513
bool ignore_table_array_inited
Definition: rpl_filter.h:514
int set_do_db(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:770
int parse_filter_list(mem_root_deque< Item * > *item_list, Add_filter func)
Definition: rpl_filter.cc:743
bool do_table_hash_inited
Definition: rpl_filter.h:511
Rpl_filter & operator=(Rpl_filter const &)
int add_ignore_table_array(const char *table_spec)
Definition: rpl_filter.cc:579
int table_rule_ent_hash_to_array(Table_rule_array *table_array, Table_rule_hash *h, bool inited)
Builds a Table_rule_array from a hash of TABLE_RULE_ENT.
Definition: rpl_filter.cc:1062
int set_wild_ignore_table(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:864
I_List< i_string > do_db
Definition: rpl_filter.h:518
Table_rule_array do_table_array
Definition: rpl_filter.h:505
bool wild_do_table_inited
Definition: rpl_filter.h:515
int add_do_table_array(const char *table_spec)
Definition: rpl_filter.cc:571
void wrlock()
Acquire the write lock.
Definition: rpl_filter.h:343
bool is_rewrite_empty()
Definition: rpl_filter.cc:569
void reset()
Definition: rpl_filter.cc:150
Rpl_filter_statistics do_db_statistics
Definition: rpl_filter.h:386
void put_filters_into_vector(std::vector< Rpl_pfs_filter > &rpl_pfs_filter_vec, const char *channel_name)
Put replication filters with attached channel name into a vector.
Definition: rpl_filter.cc:1227
int add_db_rewrite(const char *from_db, const char *to_db)
Definition: rpl_filter.cc:604
bool db_ok_with_wild_table(const char *db)
Definition: rpl_filter.cc:538
bool tables_ok(const char *db, Table_ref *tables)
Definition: rpl_filter.cc:395
bool attached
Definition: rpl_filter.h:396
int table_rule_ent_array_to_array(Table_rule_array *dest_array, Table_rule_array *source_array, bool inited)
Builds a destination Table_rule_array from a source Table_rule_array of TABLE_RULE_ENT.
Definition: rpl_filter.cc:1094
Rpl_filter_statistics ignore_db_statistics
Definition: rpl_filter.h:387
int set_ignore_db(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:781
Prealloced_array< TABLE_RULE_ENT *, 16 > Table_rule_array
Definition: rpl_filter.h:447
void get_wild_ignore_table(String *str)
Definition: rpl_filter.cc:1151
Table_rule_array ignore_table_array
Definition: rpl_filter.h:506
int add_wild_do_table(const char *table_spec)
Definition: rpl_filter.cc:587
Rpl_filter_statistics rewrite_db_statistics
Definition: rpl_filter.h:388
void init_table_rule_array(Table_rule_array *, bool *a_inited)
Definition: rpl_filter.cc:970
void get_ignore_table(String *str)
Definition: rpl_filter.cc:1142
Checkable_rwlock * m_rpl_filter_lock
Definition: rpl_filter.h:445
int add_table_rule_to_array(Table_rule_array *a, const char *table_spec)
Definition: rpl_filter.cc:723
Table_rule_hash * ignore_table_hash
Definition: rpl_filter.h:503
void rdlock()
Acquire the read lock.
Definition: rpl_filter.h:348
void assert_some_rdlock()
Assert that some thread holds the read lock.
Definition: rpl_filter.h:363
TABLE_RULE_ENT * find_wild(Table_rule_array *a, const char *key, size_t len)
Definition: rpl_filter.cc:975
int copy_global_replication_filters()
Copy global replication filters to its per-channel replication filters if there are no per-channel re...
Definition: rpl_filter.cc:190
void table_rule_ent_dynamic_array_to_str(String *s, Table_rule_array *a, bool inited)
Definition: rpl_filter.cc:1125
bool table_rules_on
Definition: rpl_filter.h:391
int set_wild_do_table(mem_root_deque< Item * > *list, enum_configured_by configured_by)
Definition: rpl_filter.cc:845
int add_wild_ignore_table(const char *table_spec)
Definition: rpl_filter.cc:595
int add_table_rule_to_hash(Table_rule_hash *h, const char *table_spec, uint len)
Added one table rule to hash.
Definition: rpl_filter.cc:701
void table_rule_ent_hash_to_str(String *s, Table_rule_hash *h, bool inited)
Definition: rpl_filter.cc:1036
Table_rule_array wild_do_table
Definition: rpl_filter.h:508
int add_ignore_db(const char *db_spec)
Definition: rpl_filter.cc:959
void free_string_array(Table_rule_array *a)
Definition: rpl_filter.cc:995
The class is a Rpl_filter representing global replication filters, with a vector that references all ...
Definition: rpl_filter.h:532
Rpl_pfs_filter * get_filter_at_pos(uint pos)
Used only by replication performance schema indices to get the global replication filter at the posit...
Definition: rpl_filter.cc:1294
~Rpl_global_filter() override=default
std::vector< Rpl_pfs_filter > rpl_pfs_filter_vec
Definition: rpl_filter.h:569
uint get_filter_count()
Used only by replication performance schema indices to get the count of global replication filters.
Definition: rpl_filter.cc:1304
Rpl_global_filter(const Rpl_global_filter &info)
void reset_pfs_view()
This member function is called every time the rules of the global replication filter are changed.
Definition: rpl_filter.cc:1284
Rpl_global_filter & operator=(const Rpl_global_filter &info)
Rpl_global_filter()=default
The class Rpl_pfs_filter is introduced to serve the performance_schema.replication_applier_filters ta...
Definition: rpl_filter.h:167
const char * m_filter_name
Definition: rpl_filter.h:188
Rpl_pfs_filter & operator=(Rpl_pfs_filter const &)
const char * get_filter_name()
Definition: rpl_filter.h:177
Rpl_filter_statistics * m_rpl_filter_statistics
Definition: rpl_filter.h:191
Rpl_filter_statistics * get_rpl_filter_statistics()
Definition: rpl_filter.h:179
const char * m_channel_name
Definition: rpl_filter.h:185
const String & get_filter_rule()
Definition: rpl_filter.h:178
const char * get_channel_name()
Definition: rpl_filter.h:176
String m_filter_rule
Definition: rpl_filter.h:194
Rpl_pfs_filter()
Definition: rpl_filter.cc:67
Sql_cmd_change_repl_filter represents the command CHANGE REPLICATION FILTER.
Definition: rpl_filter.h:579
mem_root_deque< Item * > * wild_do_table_list
Definition: rpl_filter.h:607
~Sql_cmd_change_repl_filter() override=default
mem_root_deque< Item * > * ignore_table_list
Definition: rpl_filter.h:606
mem_root_deque< Item * > * ignore_db_list
Definition: rpl_filter.h:604
Sql_cmd_change_repl_filter()
Constructor.
Definition: rpl_filter.h:582
void set_filter_value(mem_root_deque< Item * > *item_list, options_mysqld filter_type)
Definition: rpl_filter.cc:1319
mem_root_deque< Item * > * do_db_list
Definition: rpl_filter.h:603
mem_root_deque< Item * > * rewrite_db_pair_list
Definition: rpl_filter.h:609
mem_root_deque< Item * > * do_table_list
Definition: rpl_filter.h:605
bool execute(THD *thd) override
Execute this SQL statement.
Definition: rpl_filter.cc:1313
bool change_rpl_filter(THD *thd)
Execute a CHANGE REPLICATION FILTER statement to set filter rules.
Definition: rpl_filter.cc:1360
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: rpl_filter.h:593
mem_root_deque< Item * > * wild_ignore_table_list
Definition: rpl_filter.h:608
Representation of an SQL command.
Definition: sql_cmd.h:65
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
std::unordered_map, but with my_malloc and collation-aware comparison.
Definition: map_helpers.h:210
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:110
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
static bool inited
Definition: log_filter_dragnet.cc:122
std::unique_ptr< T, My_free_deleter > unique_ptr_my_free
std::unique_ptr, but with my_free as deleter.
Definition: map_helpers.h:97
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_CHANGE_REPLICATION_FILTER
Definition: my_sqlcommand.h:110
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
static mysql_service_status_t add(reference_caching_channel channel, const char *implementation_name) noexcept
Definition: component.cc:135
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2879
options_mysqld
only options that need special treatment in get_one_option() deserve to be listed below
Definition: options_mysqld.h:31
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Rpl_filter * binlog_filter
Definition: mysqld.cc:1534
enum_configured_by
Enum values for CONFIGURED_BY column.
Definition: rpl_filter.h:84
@ CONFIGURED_BY_CHANGE_REPLICATION_FILTER
Definition: rpl_filter.h:86
@ CONFIGURED_BY_STARTUP_OPTIONS
Definition: rpl_filter.h:85
@ CONFIGURED_BY_STARTUP_OPTIONS_FOR_CHANNEL
Definition: rpl_filter.h:87
@ CONFIGURED_BY_CHANGE_REPLICATION_FILTER_FOR_CHANNEL
Definition: rpl_filter.h:88
Representation of an SQL command.
Our own string classes, used pervasively throughout the executor.
Definition: rpl_filter.h:77
char * tbl_name
Definition: rpl_filter.h:79
uint key_len
Definition: rpl_filter.h:80
char * db
Definition: rpl_filter.h:78
unsigned int uint
Definition: uca9-dump.cc:75