Bug #38303 mysqldump: Needs LOCAL for FLUSH TABLES when --dump-slave is enabled
Submitted: 23 Jul 2008 1:01 Modified: 23 Jul 2008 3:43
Reporter: Paul DuBois Email Updates:
Status: Patch pending Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[23 Jul 2008 1:01] Paul DuBois
This is a followup to Bug#35157, which adds LOCAL to FLUSH TABLES when --master-data is enabled.

The problem is that LOCAL should also be added when --dump-slave is enabled, and it is not.

How to repeat:
Execute mysqldump --dump-slave db_name and examine the server's query log. A FLUSH TABLES statement will be there, but it should be FLUSH /*!40101 LOCAL */ TABLES, the same as when --master-data is used.

Suggested fix:
The following bit of code needs to also test opt_slave_data, not just opt_master_data:

    ( mysql_query_with_error_report(mysql_con, 0,
                                    ((opt_master_data != 0) ?
                                        "FLUSH /*!40101 LOCAL */ TABLES" :
                                        "FLUSH TABLES")) ||
      mysql_query_with_error_report(mysql_con, 0,
                                    "FLUSH TABLES WITH READ LOCK") );
[23 Jul 2008 1:02] Paul DuBois
Fix synopsis, assign to Chad.
[23 Jul 2008 3:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:


2680 Chad MILLER	2008-07-22
      Bug#38303: mysqldump: Needs LOCAL for FLUSH TABLES when --dump-slave is enabled
      Add additional case of dump-slave (opt_slave_data) to "LOCAL" condition for