Bug #58919 Replication replicate-rewrite-db not working!
Submitted: 14 Dec 2010 12:53 Modified: 14 Dec 2010 21:39
Reporter: Igor Gorobets Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:mysql Ver 14.14 Distrib 5.1.49 OS:Linux (debian-linux-gnu (x86_64))
Assigned to: CPU Architecture:Any
Tags: replicate-rewrite-db

[14 Dec 2010 12:53] Igor Gorobets
Description:
Hello.
I change data on the table db1.t1 on the master server, but on the slave server db.t1 nothing change.

How to repeat:
slave-server: cat /etc/mysql/my.cnf

<======================>
replicate-rewrite-db=db1->db
replicate-do-table=db.t1
replicate-do-table=db.t2
replicate-do-table=db.t3
replicate-do-table=db.t4
<======================>
[14 Dec 2010 20:33] Sveta Smirnova
Thank you for the report.

Please provide example of query which was not prolongated on slave.
[14 Dec 2010 21:04] Igor Gorobets
Any UPDATE on the db1.t1 .

For example:
UPDATE db1.t1 SET col1 = 1;
[14 Dec 2010 21:39] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read at http://dev.mysql.com/doc/refman/5.1/en/replication-options-slave.html#option_mysqld_replic...:

--replicate-rewrite-db=from_name->to_name

Tells the slave to translate the default database (that is, the one selected by USE) to to_name if it was from_name on the master. Only statements involving tables are affected (not statements such as CREATE DATABASE, DROP DATABASE, and ALTER DATABASE), and only if from_name is the default database on the master. This does not work for cross-database updates.