[MDEV-4434] DDL statements do not replicate when replicate-rewrite-db is set Created: 2013-04-24  Updated: 2013-05-01  Resolved: 2013-05-01

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Mike Ashton (Inactive) Assignee: Elena Stepanova
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

Create a replication from server A db1 to Server B db2 using replicate-rewrite-db=db1->db2

Create a table in db1 on server A called tbl1, the table is not created on server B in db2.



 Comments   
Comment by Elena Stepanova [ 2013-04-25 ]

Works all right for me. Here is the test case, you can use it literally in MTR or interpret as "steps to reproduce":

--source include/master-slave.inc
--enable_connect_log

--connection slave
CREATE DATABASE db2;

--connection master
CREATE DATABASE db1;
USE db1;
CREATE TABLE tbl1 (i INT);

--sync_slave_with_master

SHOW DATABASES;
SHOW TABLES IN db2;

  1. End of test case

Output:

[connection master]
connection slave;
CREATE DATABASE db2;
connection master;
CREATE DATABASE db1;
USE db1;
CREATE TABLE tbl1 (i INT);
connection slave;
SHOW DATABASES;
Database
db1
db2
information_schema
mtr
mysql
performance_schema
test
SHOW TABLES IN db2;
Tables_in_db2
tbl1

  1. End of output

Are you sure you are setting the default database to db1 before trying to replicate, i.e. you do "USE db1"? That's the mandatory condition for this option, if you instead do something like
CREATE DATABASE db1;
CREATE TABLE db1.tbl1(i INT);

it's not supposed to work, by the definition of the option.

Comment by Elena Stepanova [ 2013-05-01 ]

If the notes above do not explain the problem you were experiencing, please comment and we will re-open the report if necessary.

Generated at Thu Feb 08 06:56:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.