-
unknown authored
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).
69b8b3ff