mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
WL#2472: Refactoring of replication and binlog filtering.
Needed to be able to have multiple masters connected to same slave server with different filters. sql/Makefile.am: Add table_filter.cc sql/log.cc: Use Table_filter sql/log_event.cc: Use Table_filter sql/mysql_priv.h: Use Table_filter sql/mysqld.cc: Use Table_filter sql/repl_failsafe.cc: Use Table_filter sql/slave.cc: Use Table_filter sql/slave.h: Use Table_filter sql/sql_acl.cc: Use Table_filter sql/sql_class.h: Use const since they should not be changed sql/sql_parse.cc: Use Table_filter sql/sql_repl.cc: Use Table_filter sql/sql_repl.h: Use Table_filter
This commit is contained in:
@@ -16,11 +16,14 @@
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include "sql_repl.h"
|
||||
#include "table_filter.h"
|
||||
#include "repl_failsafe.h"
|
||||
#include <m_ctype.h>
|
||||
#include <myisam.h>
|
||||
#include <my_dir.h>
|
||||
|
||||
extern Table_filter *rpl_filter;
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
#include "ha_innodb.h"
|
||||
#endif
|
||||
@@ -137,10 +140,12 @@ static bool end_active_trans(THD *thd)
|
||||
#ifdef HAVE_REPLICATION
|
||||
inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
return (table_rules_on && tables && !tables_ok(thd,tables) &&
|
||||
return (rpl_filter->is_on() && tables &&
|
||||
!rpl_filter->tables_ok(thd->db, tables) &&
|
||||
((thd->lex->sql_command != SQLCOM_DELETE_MULTI) ||
|
||||
!tables_ok(thd,
|
||||
(TABLE_LIST *)thd->lex->auxilliary_table_list.first)));
|
||||
!rpl_filter->tables_ok(thd->db,
|
||||
(TABLE_LIST *)
|
||||
thd->lex->auxilliary_table_list.first)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3283,9 +3288,9 @@ unsent_create_error:
|
||||
above was not called. So we have to check rules again here.
|
||||
*/
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (thd->slave_thread &&
|
||||
(!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
|
||||
!db_ok_with_wild_table(lex->name)))
|
||||
if (thd->slave_thread &&
|
||||
(!rpl_filter->db_ok(lex->name) ||
|
||||
!rpl_filter->db_ok_with_wild_table(lex->name)))
|
||||
{
|
||||
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
||||
break;
|
||||
@@ -3314,8 +3319,8 @@ unsent_create_error:
|
||||
*/
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (thd->slave_thread &&
|
||||
(!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
|
||||
!db_ok_with_wild_table(lex->name)))
|
||||
(!rpl_filter->db_ok(lex->name) ||
|
||||
!rpl_filter->db_ok_with_wild_table(lex->name)))
|
||||
{
|
||||
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
||||
break;
|
||||
@@ -3355,8 +3360,8 @@ unsent_create_error:
|
||||
*/
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (thd->slave_thread &&
|
||||
(!db_ok(db, replicate_do_db, replicate_ignore_db) ||
|
||||
!db_ok_with_wild_table(db)))
|
||||
(!rpl_filter->db_ok(lex->name) ||
|
||||
!rpl_filter->db_ok_with_wild_table(lex->name)))
|
||||
{
|
||||
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user