summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authorlars@mysql.com <>2005-03-08 21:12:35 +0100
committerlars@mysql.com <>2005-03-08 21:12:35 +0100
commit26787260b73696a110c06679709c2871be5dedf1 (patch)
tree7dc43286c3d1cf707590b97eade867ab84c279cf /sql/repl_failsafe.cc
parentb6a2b5f734952ec2e6fc77679dcb437f6f38a16e (diff)
downloadmariadb-git-26787260b73696a110c06679709c2871be5dedf1.tar.gz
WL#2472: Refactoring of replication and binlog filtering.
Needed to be able to have multiple masters connected to same slave server with different filters.
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index de4ad83fdbb..0909d87d74b 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -20,9 +20,12 @@
#include "repl_failsafe.h"
#include "sql_repl.h"
#include "slave.h"
+#include "table_filter.h"
#include "log_event.h"
#include <mysql.h>
+extern Table_filter *rpl_filter;
+
#define SLAVE_LIST_CHUNK 128
#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
@@ -735,14 +738,14 @@ static int fetch_db_tables(THD *thd, MYSQL *mysql, const char *db,
TABLE_LIST table;
const char* table_name= row[0];
int error;
- if (table_rules_on)
+ if (rpl_filter->is_on())
{
bzero((char*) &table, sizeof(table)); //just for safe
table.db= (char*) db;
table.table_name= (char*) table_name;
table.updating= 1;
- if (!tables_ok(thd, &table))
+ if (!rpl_filter->tables_ok(thd->db, &table))
continue;
}
/* download master's table and overwrite slave's table */
@@ -860,8 +863,8 @@ bool load_master_data(THD* thd)
data from master
*/
- if (!db_ok(db, replicate_do_db, replicate_ignore_db) ||
- !db_ok_with_wild_table(db) ||
+ if (!rpl_filter->db_ok(db) ||
+ !rpl_filter->db_ok_with_wild_table(db) ||
!strcmp(db,"mysql"))
{
*cur_table_res = 0;