summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result19
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test19
3 files changed, 39 insertions, 1 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 6cbd107fdcf..0c80887d169 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -1,19 +1,36 @@
include/master-slave.inc
[connection master]
+set sql_log_bin=0;
+create database y;
+set sql_log_bin=1;
drop database if exists mysqltest1;
+drop database if exists x;
create database mysqltest1;
+set sql_log_bin=0;
+create database x;
+set sql_log_bin=1;
use mysqltest1;
create table t1 (a int);
insert into t1 values(9);
+use x;
+create table t1 (a int);
+insert into t1 values(9);
select * from mysqltest1.t1;
a
9
+select * from x.t1;
+a
+9
show databases like 'mysqltest1';
Database (mysqltest1)
mysqltest1
select * from test.t1;
a
9
+select * from y.t1;
+a
+9
+use mysqltest1;
drop table t1;
drop database mysqltest1;
drop database if exists rewrite;
@@ -209,10 +226,12 @@ SET sql_log_bin= 0;
DROP DATABASE database_master_temp_01;
DROP DATABASE database_master_temp_02;
DROP DATABASE database_master_temp_03;
+DROP DATABASE x;
SET sql_log_bin= 1;
SET sql_log_bin= 0;
DROP DATABASE database_slave_temp_01;
DROP DATABASE database_slave_temp_02;
DROP DATABASE database_slave_temp_03;
+DROP DATABASE y;
SET sql_log_bin= 1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
index 290b92e0a3e..84059110136 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
@@ -1 +1 @@
-"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test" "--replicate-rewrite-db=database_master_temp_01->database_slave_temp_01" "--replicate-rewrite-db=database_master_temp_02->database_slave_temp_02" "--replicate-rewrite-db=database_master_temp_03->database_slave_temp_03"
+"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1 -> test" "--replicate-rewrite-db=x -> y" "--replicate-rewrite-db=database_master_temp_01->database_slave_temp_01" "--replicate-rewrite-db=database_master_temp_02->database_slave_temp_02" "--replicate-rewrite-db=database_master_temp_03->database_slave_temp_03"
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 996ad0a10c7..bd0749bc2de 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -2,20 +2,37 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
+--connection slave
+set sql_log_bin=0;
+create database y;
+set sql_log_bin=1;
+
+--connection master
--disable_warnings
drop database if exists mysqltest1;
+drop database if exists x;
--enable_warnings
create database mysqltest1;
+set sql_log_bin=0;
+create database x;
+set sql_log_bin=1;
use mysqltest1;
create table t1 (a int);
insert into t1 values(9);
+use x;
+create table t1 (a int);
+insert into t1 values(9);
select * from mysqltest1.t1;
+select * from x.t1;
sync_slave_with_master;
+#TODO no it is no empty
show databases like 'mysqltest1'; # should be empty
select * from test.t1;
+select * from y.t1;
# cleanup
connection master;
+use mysqltest1;
drop table t1;
drop database mysqltest1;
sync_slave_with_master;
@@ -224,6 +241,7 @@ SET sql_log_bin= 0;
DROP DATABASE database_master_temp_01;
DROP DATABASE database_master_temp_02;
DROP DATABASE database_master_temp_03;
+DROP DATABASE x;
SET sql_log_bin= 1;
connection slave;
@@ -231,6 +249,7 @@ SET sql_log_bin= 0;
DROP DATABASE database_slave_temp_01;
DROP DATABASE database_slave_temp_02;
DROP DATABASE database_slave_temp_03;
+DROP DATABASE y;
SET sql_log_bin= 1;
connection master;