Bug #16194 No replication when wrong database selected
Submitted: 4 Jan 2006 16:27 Modified: 4 Feb 2006 16:39
Reporter: [ name withheld ] Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:MySQL 4.1.15 OS:Linux (Debian Sarge)
Assigned to: CPU Architecture:Any

[4 Jan 2006 16:27] [ name withheld ]
Description:
Hi,

When I try to INSERT a record into a database replicated from a database which is not, the record is not inserted in the replicated table.
In our previous version of MySQL (I don't remember which one) it was just stopping the replication on the slave.
Now, (of course we have fixed the queries in cause), but if we have another problem like this, we won't know...

JdC

How to repeat:
Configuration:
    Server A (master):
        - database DB1
        - database DB2:
            - table tmp_table(id int)
    Server B (slave):
        - database DB2:
            - table tmp_table(id int)

Conect to Server A:
use DB1;
INSERT INTO DB2.tmp_table (id) VALUES (1);
[4 Jan 2006 16:39] Valeriy Kravchuk
Looks like not a bug, but documented restriction. Please, read http://dev.mysql.com/doc/refman/4.1/en/replication-options.html:

"--replicate-ignore-db=db_name

Tells the slave to not replicate any statement where the default database (that is, the one selected by USE) is db_name. To specify more than one database to ignore, use this option multiple times, once for each database. You should not use this option if you are using cross-database updates and you do not want these updates to be replicated. Please read the notes that follow this option list.

An example of what does not work as you might expect: If the slave is started with --replicate-ignore-db=sales and you issue the following statements on the master, the UPDATE statement is not replicated:

USE prices;
UPDATE sales.january SET amount=amount+1000;

If you need cross-database updates to work, use --replicate-wild-ignore-table=db_name.% instead."

Is this your case?
[5 Feb 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".