diff options
author | unknown <guilhem@mysql.com> | 2003-09-11 23:17:28 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-09-11 23:17:28 +0200 |
commit | 69b8b3ff7c37dd72a5f5f265e92e801783e7b9bd (patch) | |
tree | 17368ba287e00c5ee8a4b28a65a34bbf5fb4e4f5 /mysql-test/r/rpl000009.result | |
parent | 8272be9412ecf6566192260df7217a1bec7ffc99 (diff) | |
download | mariadb-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 'mysql-test/r/rpl000009.result')
-rw-r--r-- | mysql-test/r/rpl000009.result | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result index 002f6843953..4a8057467f2 100644 --- a/mysql-test/r/rpl000009.result +++ b/mysql-test/r/rpl000009.result @@ -49,21 +49,48 @@ show databases; Database mysql test +create database foo; +create table foo.t1(n int, s char(20)); +insert into foo.t1 values (1, 'original foo.t1'); +create table foo.t3(n int, s char(20)); +insert into foo.t3 values (1, 'original foo.t3'); +create database foo2; +create table foo2.t1(n int, s char(20)); +insert into foo2.t1 values (1, 'original foo2.t1'); +create database bar; +create table bar.t1(n int, s char(20)); +insert into bar.t1 values (1, 'original bar.t1'); +create table bar.t3(n int, s char(20)); +insert into bar.t3 values (1, 'original bar.t3'); load data from master; show databases; Database bar foo +foo2 mysql test use foo; show tables; Tables_in_foo +t1 +t3 +select * from t1; +n s +1 original foo.t1 +use foo2; +show tables; +Tables_in_foo2 +t1 +select * from t1; +n s +1 original foo2.t1 use bar; show tables; Tables_in_bar t1 t2 +t3 select * from bar.t1; n s 1 one bar @@ -74,6 +101,9 @@ n s 11 eleven bar 12 twelve bar 13 thirteen bar +select * from bar.t3; +n s +1 original bar.t3 insert into bar.t1 values (4, 'four bar'); select * from bar.t1; n s @@ -81,5 +111,23 @@ n s 2 two bar 3 three bar 4 four bar +insert into bar.t1 values(10, 'should be there'); +flush tables; +load data from master; +Error on delete of './bar/t1.MYI' (Errcode: 13) +select * from bar.t1; +n s +1 one bar +2 two bar +3 three bar +4 four bar +10 should be there +load table bar.t1 from master; +Table 't1' already exists +drop table bar.t1; +load table bar.t1 from master; +start slave; drop database bar; drop database foo; +drop database foo; +drop database foo2; |