Bug #22724 Replicate_Do_DB with comma-delimited list breaks replication silently
Submitted: 27 Sep 2006 6:25 Modified: 7 Feb 2007 12:28
Reporter: James Day Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:4.0,4.1,5.0,5.1 OS:Linux (linux, windows)
Assigned to: MC Brown CPU Architecture:Any
Triage: D4 (Minor)

[27 Sep 2006 6:25] James Day
In my.cnf:

Replicate_Do_DB: database1,database2,database3

This generates no warnings or errors but means that the single database named `database1,database2,database3` is the one that will be replicated. Experience indicates that this is uncommon and it usually means that the user wants three databases named database1 and database2 and database3 to be replicated. Commas are permitted in quoted database names in at least 4.1 through 5.0.

How to repeat:
Use the list as given, observe that none of the three individual databases are replicated.

Suggested fix:
Commas are legal in database names, so possible fixes are:

1. warning on startup in error log saying that one database named 'name1,name2' will be replicated, not n named 'name1', 'name2' etc.

2. placing commas around the database names in SHOW SLAVE STATUS to help to highlight the name containing a comma.
[7 Feb 2007 12:28] MC Brown
The documentation has been updated with a warning to indicate that using a comma separated list will not work as expected.
[27 Aug 2009 10:33] Norbert Tretkowski
It would be great to have a WARNING in the log on startup as well.
[8 Sep 2009 11:06] James Day
Norbert, it would be good but in practice the MySQL support team has found that the improved documentation has greatly reduced the number of cases where people get this wrong.