Bug #8791 binlog-ignore-db does not log DDL statements without current database
Submitted: 24 Feb 2005 19:37 Modified: 29 Mar 2005 15:30
Reporter: Dean Ellis Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.11 OS:
Assigned to: Mats Kindahl CPU Architecture:Any

[24 Feb 2005 19:37] Dean Ellis
When binlog_ignore_db rules are in effect, DDL statements issued without a current database are not logged, breaking replication and requiring replicate-ignore-db equivalents on the slave as a workaround.

4.0 logs DDL statements which were issued without a current database.

How to repeat:
Add to my.cnf:


mysql test -e "CREATE TABLE test.t1 ( a int )"
mysql -e "CREATE TABLE test.t2 ( a int )"

Examine binary log.  First statement (with current database) is logged, second statement (without current database) is not.

Suggested fix:
Restore 4.0's behavior.
[25 Feb 2005 10:21] Marcus Don
This problem also exists when using binlog-do-db on the master. If the database connection that updates the replicated database doesn't have this database selected as the default, changes don't get logged, so they don't get replicated!
[29 Mar 2005 14:18] Mats Kindahl
The way binlog-do-db and binlog-ignore-db (and its counterparts replicate-*-db) works in 4.0 and 4.1 is unfortunately not the best way to solve the problem. The behavior described in the bug report is according to what is given as the behavior in the reference documentation (see http://dev.mysql.com/doc/mysql/en/binary-log.html) and a change will just add to the confusion about how it behaves. 

If you are using any of these options, you should always use a current database to get replication working properly.
[29 Mar 2005 15:30] Dean Ellis
So, is this a "Won'tFix bug in 4.0", or is it "Functionality Regression in 4.1"?

As I noted, these were logged in 4.0, so we've lost functionality without documenting it anywhere that I've been able to find (ie: in the upgrade notes, for instance).  ie: this was opened only because 4.0 _does_ log such statements.
[17 May 2005 2:26] puru panch