Bug #23916 replication skips queries which reference databases not currently selected
Submitted: 3 Nov 2006 5:16 Modified: 3 Nov 2006 7:29
Reporter: Aaron Welch Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1 OS:Linux (linux (suse 10))
Assigned to: CPU Architecture:Any
Tags: replication

[3 Nov 2006 5:16] Aaron Welch
Description:
On a replicated setup, using binlog-do-db on a single database, if you run a query against a database other than the currently active one, that query will not get logged to the bin-log, so also fails to replicate to the slaves.

How to repeat:
- Setup master/slave configuration
- set binlog-do-db to use a test database
- login to a mysql cli
- select the test database and run a write query, eg: INSERT INTO test_table (fun) VALUES ('this is fun');
- confirm the entry shows up on the slave
- \U mysql (or any db other than the test database set with binlog-do-db)
- run the same query against the test db using a period to reference the table, eg: INSERT INTO test.test_table (fun) VALUES ('this is no fun');
- confirm this entry does *not* appear on the slave

Suggested fix:
No idea, sorry.
[3 Nov 2006 7:29] 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

Read carefully at http://dev.mysql.com/doc/refman/4.1/en/binary-log.html how binlog-do-db works
[22 Jun 2007 10:18] Rodrigo GATICA ROCCO
We don't use binlog-do-db option, however, we encounter a similar problem using the following command "DELETE * FROM db_name.table_name WHERE ..."
This entry doesn't appear in the binlog of the master and thus fails to replicate to the slaves.