summaryrefslogtreecommitdiff
path: root/sql/slave.h
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-09-11 23:17:28 +0200
committerunknown <guilhem@mysql.com>2003-09-11 23:17:28 +0200
commit69b8b3ff7c37dd72a5f5f265e92e801783e7b9bd (patch)
tree17368ba287e00c5ee8a4b28a65a34bbf5fb4e4f5 /sql/slave.h
parent8272be9412ecf6566192260df7217a1bec7ffc99 (diff)
downloadmariadb-git-69b8b3ff7c37dd72a5f5f265e92e801783e7b9bd.tar.gz
* Fix for BUG#1248: "LOAD DATA FROM MASTER drops the slave's db unexpectedly".
Now LOAD DATA FROM MASTER does not drop the database, instead it only tries to create it, and drops/creates table-by-table. * replicate_wild_ignore_table='db1.%' is now considered as "ignore the 'db1' database as a whole", as it already works for CREATE DATABASE and DROP DATABASE. mysql-test/r/rpl000009.result: result update mysql-test/t/rpl000009.test: test that LOAD DATA FROM MASTER does not drop databases, but rather table by table, thus preserving non-replicated tables. Test that LOAD DATA FROM MASTER reports the error when a table could not be dropped (system's "permission denied" for example). Test that LOAD TABLE FROM MASTER reports the error when the table already exists. sql/repl_failsafe.cc: * replicate_wild_ignore_table='db1.%' is now considered as "ignore the 'db1' database as a whole", as it already works for CREATE DATABASE and DROP DATABASE. * If a db matches replicate_*_db rules, we don't drop/recreate it because this could drop some tables in this db which could be slave-specific. Instead, we do a CREATE DATABASE IF EXISTS, and we will drop each table which has an equivalent on the master, table-by-table. sql/slave.cc: New argument to drop the table in create_table_from_dump() (LOAD TABLE/DATA FROM MASTER are the only places where this function is used). This is needed because LOAD DATA FROM MASTER does not drop the database anymore. The behaviour when the table exists is unchanged: LOAD DATA silently replaces the table, LOAD TABLE gives error. sql/slave.h: new argument to drop the table in fetch_master_table sql/sql_parse.cc: do not drop the table in LOAD TABLE FROM MASTER (this behaviour is already true; but changes in LOAD DATA FROM MASTER made the argument needed).
Diffstat (limited to 'sql/slave.h')
-rw-r--r--sql/slave.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/slave.h b/sql/slave.h
index 67bf009763b..f61891acc91 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -384,9 +384,9 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
int mysql_table_dump(THD* thd, const char* db,
const char* tbl_name, int fd = -1);
-/* retrieve non-exitent table from master */
+/* retrieve table from master and copy to slave*/
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
- MASTER_INFO* mi, MYSQL* mysql);
+ MASTER_INFO* mi, MYSQL* mysql, bool overwrite);
int show_master_info(THD* thd, MASTER_INFO* mi);
int show_binlog_info(THD* thd);