summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl000009.test
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-10-08 12:01:58 +0300
committerunknown <monty@narttu.mysql.fi>2003-10-08 12:01:58 +0300
commit1ead85e6783e303c2d024aebe4c5a04e0aa6560f (patch)
tree5f3cf2f56cc441edc81b2cf5fc056128ab764b41 /mysql-test/t/rpl000009.test
parent118d532134a1700bdb7ba29ce41712994f023692 (diff)
downloadmariadb-git-1ead85e6783e303c2d024aebe4c5a04e0aa6560f.tar.gz
Fixes after merge
mysql-test/std_data/trunc_binlog.000001: Rename: mysql-test/std_data/trunc_binlog.001 -> mysql-test/std_data/trunc_binlog.000001 client/mysqltest.c: Fixed merge problem mysql-test/mysql-test-run.sh: Fixed merge problem mysql-test/r/distinct.result: Fix after merge mysql-test/r/drop_temp_table.result: Fix after merge mysql-test/r/join_outer.result: Fix after merge mysql-test/r/mysqldump.result: Fix after merge mysql-test/r/null_key.result: Fix after merge mysql-test/r/order_by.result: Fix after merge mysql-test/r/rpl_alter.result: Fix after merge mysql-test/r/rpl_loaddata.result: Fix after merge mysql-test/r/rpl_loaddata_rule_m.result: Fix after merge mysql-test/r/rpl_trunc_binlog.result: Fix after merge mysql-test/r/select_safe.result: Fix after merge mysql-test/t/insert.test: Fix after merge mysql-test/t/mysqlbinlog.test: Fix after merge mysql-test/t/rpl000009.test: Fix after merge mysql-test/t/rpl_alter.test: Fix after merge mysql-test/t/rpl_loaddata_rule_m.test: Fix after merge mysql-test/t/rpl_trunc_binlog.test: Fix after merge sql-common/client.c: Fix after merge sql/item_subselect.cc: Fix after merge sql/repl_failsafe.cc: Fix after merge sql/slave.cc: Fix after merge sql/sql_insert.cc: Fix after merge
Diffstat (limited to 'mysql-test/t/rpl000009.test')
-rw-r--r--mysql-test/t/rpl000009.test80
1 files changed, 48 insertions, 32 deletions
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 4db62540e7b..cd318efa2b6 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -3,9 +3,15 @@
source include/master-slave.inc;
--disable_warnings
+drop database if exists mysqltest;
drop database if exists mysqltest2;
-create database mysqltest2;
+drop database if exists mysqltest3;
+connection slave;
drop database if exists mysqltest;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+connection master;
+create database mysqltest2;
create database mysqltest;
--enable_warnings
@@ -60,38 +66,42 @@ sync_with_master;
# This should show that the slave is empty at this point
show databases;
-# Create foo and foo2 on slave; we expect that LOAD DATA FROM MASTER will
-# neither touch database foo nor foo2.
-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 bar, and bar.t1, to check that it gets replaced,
-# and bar.t3 to check that it is not touched (there is no bar.t3 on master)
-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');
+# Create mysqltest2 and mysqltest3 on slave; we expect that LOAD DATA FROM
+# MASTER will neither touch database mysqltest nor mysqltest3
+create database mysqltest2;
+create table mysqltest2.t1(n int, s char(20));
+insert into mysqltest2.t1 values (1, 'original foo.t1');
+create table mysqltest2.t3(n int, s char(20));
+insert into mysqltest2.t3 values (1, 'original foo.t3');
+create database mysqltest3;
+create table mysqltest3.t1(n int, s char(20));
+insert into mysqltest3.t1 values (1, 'original foo2.t1');
+
+# Create mysqltest, and mysqltest.t1, to check that it gets replaced,
+# and mysqltest.t3 to check that it is not touched (there is no
+# mysqltest.t3 on master)
+create database mysqltest;
+create table mysqltest.t1(n int, s char(20));
+insert into mysqltest.t1 values (1, 'original bar.t1');
+create table mysqltest.t3(n int, s char(20));
+insert into mysqltest.t3 values (1, 'original bar.t3');
load data from master;
# Now let's check if we have the right tables and the right data in them
show databases;
use mysqltest2;
-# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which databases
-# have to be copied. So it thinks "foo" has to be copied. Before 4.0.16 it would
-# first drop "foo", then create "foo". This "drop" is a bug; in that case t3
-# would disappear.
-# So here the effect of this bug (BUG#1248) would be to leave an empty "foo" on
-# the slave.
+
+# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which
+# databases have to be copied. So it thinks "mysqltest" has to be
+# copied. Before 4.0.16 it would first drop "mysqltest", then create
+# "mysqltest". This "drop" is a bug; in that case t3 would disappear. So
+# here the effect of this bug (BUG#1248) would be to leave an empty
+# "mysqltest" on the slave.
+
show tables; # should be t1 & t3
select * from t1; # should be slave's original
-use foo2;
+use mysqltest3;
show tables; # should be t1
select * from t1; # should be slave's original
use mysqltest;
@@ -111,19 +121,24 @@ select * from mysqltest.t1;
# Check that LOAD DATA FROM MASTER reports the error if it can't drop a
# table to be overwritten.
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
-# insert into bar.t1 values(10, 'should be there');
+# insert into mysqltest.t1 values(10, 'should be there');
# flush tables;
-# system chmod 500 var/slave-data/bar/;
+# system chmod 500 var/slave-data/mysqltest/;
# --error 6
# load data from master; # should fail (errno 13)
-# system chmod 700 var/slave-data/bar/;
-# select * from bar.t1; # should contain the row (10, ...)
+# system chmod 700 var/slave-data/mysqltest/;
+# select * from mysqltest.t1; # should contain the row (10, ...)
# Check that LOAD TABLE FROM MASTER fails if the table exists on slave
--error 1050
-load table bar.t1 from master;
-drop table bar.t1;
+load table mysqltest.t1 from master;
+drop table mysqltest.t1;
+load table mysqltest.t1 from master;
+
+# Check what happens when requestion not existing table
+#
+--error 1188
load table bar.t1 from master;
# as LOAD DATA FROM MASTER failed it did not restart slave threads
@@ -137,5 +152,6 @@ drop database mysqltest2;
save_master_pos;
connection slave;
sync_with_master;
-drop database mysqltest;
+# These has to be droped on slave as they are not replicated
drop database mysqltest2;
+drop database mysqltest3;