summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-10-07 15:42:26 +0300
committermonty@narttu.mysql.fi <>2003-10-07 15:42:26 +0300
commit6056cfadfcb07cda12f6dc01ec9c1ab07067ac69 (patch)
treed89c080ef636608e316f1166b1628cd1d902deec /sql/repl_failsafe.cc
parent0091fa2e3266da6a17b0615a4696c25a4d36d664 (diff)
parent446d40e880c0e6ab6ac56b0082d4883ef5c7d467 (diff)
downloadmariadb-git-6056cfadfcb07cda12f6dc01ec9c1ab07067ac69.tar.gz
Merge with 4.0.16
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 7c943d4ae53..2fe8946410f 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -734,7 +734,8 @@ static int fetch_db_tables(THD *thd, MYSQL *mysql, const char *db,
if (!tables_ok(thd, &table))
continue;
}
- if ((error= fetch_master_table(thd, db, table_name, mi, mysql)))
+ /* download master's table and overwrite slave's table */
+ if ((error= fetch_master_table(thd, db, table_name, mi, mysql, 1)))
return error;
}
return 0;
@@ -836,8 +837,11 @@ int load_master_data(THD* thd)
char* db = row[0];
/*
- Do not replicate databases excluded by rules
- also skip mysql database - in most cases the user will
+ Do not replicate databases excluded by rules. We also test
+ replicate_wild_*_table rules (replicate_wild_ignore_table='db1.%' will
+ be considered as "ignore the 'db1' database as a whole, as it already
+ works for CREATE DATABASE and DROP DATABASE).
+ Also skip 'mysql' database - in most cases the user will
mess up and not exclude mysql database with the rules when
he actually means to - in this case, he is up for a surprise if
his priv tables get dropped and downloaded from master
@@ -847,14 +851,14 @@ int load_master_data(THD* thd)
*/
if (!db_ok(db, replicate_do_db, replicate_ignore_db) ||
+ !db_ok_with_wild_table(db) ||
!strcmp(db,"mysql"))
{
*cur_table_res = 0;
continue;
}
- if (mysql_rm_db(thd, db, 1,1) ||
- mysql_create_db(thd, db, 0, 1))
+ if (mysql_create_db(thd, db, HA_LEX_CREATE_IF_NOT_EXISTS, 1))
{
send_error(thd, 0, 0);
cleanup_mysql_results(db_res, cur_table_res - 1, table_res);