mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Makeing rpl_filter for each Master_info.
Users can set different repplication filter rules for each replication connection, in my.cnf or command line. But the rules set online will not record in master.info, it means if users restart MySQL, these rules will lose. So if users wantn't their replication filter rules lose, they should write the rules in my.cnf. Users can set rules by 2 ways: 1. Online SET command, "SET connection_name.replication_filter_settings = rules;". 2. In my.cnf, "connection_name.replication_filter_settings = rules". If no connection_name in my.cnf, this rule will apply for ALL replication connection. If no connetion_name in SET statement, this rull will apply for default_connection_name.
This commit is contained in:
@ -170,8 +170,8 @@ const char *xa_state_names[]={
|
||||
*/
|
||||
inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
return rpl_filter->is_on() && tables && !thd->spcont &&
|
||||
!rpl_filter->tables_ok(thd->db, tables);
|
||||
return thd->rpl_filter->is_on() && tables && !thd->spcont &&
|
||||
!thd->rpl_filter->tables_ok(thd->db, tables);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1954,6 +1954,8 @@ mysql_execute_command(THD *thd)
|
||||
#ifdef HAVE_REPLICATION
|
||||
/* have table map for update for multi-update statement (BUG#37051) */
|
||||
bool have_table_map_for_update= FALSE;
|
||||
/* */
|
||||
Rpl_filter *rpl_filter= thd->rpl_filter;
|
||||
#endif
|
||||
DBUG_ENTER("mysql_execute_command");
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
@ -2438,6 +2440,11 @@ case SQLCOM_PREPARE:
|
||||
else
|
||||
delete mi;
|
||||
}
|
||||
else
|
||||
{
|
||||
mi->rpl_filter= get_or_create_rpl_filter(lex_mi->connection_name.str,
|
||||
lex_mi->connection_name.length);
|
||||
}
|
||||
|
||||
mysql_mutex_unlock(&LOCK_active_mi);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user