Bug #51459 replication-rule that can be misinterpreted
Submitted: 24 Feb 2010 14:33 Modified: 26 Feb 2010 15:43
Reporter: Johan Andersson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:* OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: replicate_do_db, replicate_rewrite_db, replication rules

[24 Feb 2010 14:33] Johan Andersson
Description:
http://dev.mysql.com/doc/refman/5.1/en/replication-rules.html

"Evaluation of --replicate-* options is affected by whether row-based or statement-based logging is in use, but regardless of the logging format, database-level options (--replicate-do-db, --replicate-ignore-db) are checked first; see Section 16.4.3.1, “Evaluation of Database-Level Replication and Binary Logging Options”, for a description of this process. If no matching database-level options are found, option checking proceeds to any table-level options that may be in use, as discussed in "

The sentence: "but regardless of the logging format, database-level options (--replicate-do-db, --replicate-ignore-db) are checked first"

is not true if replicate_rewrite_db is used, as it is then evaluated first!

How to repeat:
re-read the manual http://dev.mysql.com/doc/refman/5.1/en/replication-rules.html :)

Suggested fix:
but regardless of the logging format, database-level options (--replicate-do-db, --replicate-ignore-db) are checked first, unless --replicate-rewrite-db has been specified (which is then checked first).
[26 Feb 2010 15:43] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Strictly speaking, --replication-rewrite-db isn't a *filtering* rule. But I'll add this note:

If any --replicate-rewrite-db options were specified, they are
applied before the --replicate-* filtering rules are tested.