Bug #48147 binlog-ignore-db unexpected behaviour
Submitted: 19 Oct 2009 10:29 Modified: 15 Nov 2009 11:12
Reporter: albert lozano Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0.45 OS:Linux
Assigned to: CPU Architecture:Any
Tags: binlog-ignore-db, create database, replication

[19 Oct 2009 10:29] albert lozano
Description:
When activating the binlog-ignore-db it is expected to replicate CREATE DATABASE, ALTER DATABASE, and DROP DATABASE statements. However, If the database assigned to be ignored does not exist at that moment of the activation the statements expecte to be replicated will not be. Therefore, the new database will not be created at the slave

How to repeat:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
server-id = 1
log-bin=/var/lib/mysql/mysql-bin
binlog-ignore-db=api_nr              
binlog-ignore-db=future_db
expire_logs_days= 1

on master:
mysql> create database future_db_not_currently_existing;
mysql> show databases;
+-----------------------+
| Database              |
+-----------------------+
| information_schema    | 
| api                   | 
| api_nr                | 
| mysql                 | 
| test                  | 
| future_db             |
+-----------------------+

on slave:
mysql> show databases;
+-----------------------+
| Database              |
+-----------------------+
| information_schema    | 
| api                   | 
| api_nr                | 
| mysql                 | 
| test                  | 
+-----------------------+

so, future_db is missing although Seconds_Behind_Master is 0.

Suggested fix:
Replicated the database creation or add this 'feature' to the documentation.
[20 Oct 2009 10:50] Valeriy Kravchuk
Thank you for the problem report. Please, try to repeat with a newer version, 5.0.86, and inform about the results.
[15 Nov 2009 11:12] Zhenxing He
Hi,

I think this behavior has already been documented, please check:
 http://dev.mysql.com/doc/refman/5.0/en/replication-rules-db-options.html