Bug #84575 Needs "LOCAL" for FLUSH TABLES (mysqldump --single-transaction --flush-logs)
Submitted: 20 Jan 2017 2:08 Modified: 7 Feb 2017 22:42
Reporter: SeWoong Jeon Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[20 Jan 2017 2:08] SeWoong Jeon
Description:
when --single-transaction, --flush-logs and --master-data are used together, "FLUSH LOCAL TABLES" query is performed.
however, when only --single-transaction and --flush-logs are used, a "FLUSH TABLES" query is performed,
it seems enough to use "FLUSH LOCAL TABLES".

How to repeat:
Execute "mysqldump --single-transaction --flush-logs" without --master-data

Suggested fix:
client/mysqldump.c 

  return
    ( mysql_query_with_error_report(mysql_con, 0, 
-                                    ((opt_master_data != 0) ? 
+                                    ((opt_master_data != 0 || (opt_single_transaction && flush_logs)) ?  
                                        "FLUSH /*!40101 LOCAL */ TABLES" : 
                                        "FLUSH TABLES")) ||
      mysql_query_with_error_report(mysql_con, 0,
                                    "FLUSH TABLES WITH READ LOCK") );
[7 Feb 2017 22:42] MySQL Verification Team
Hi,

That's not a bug, it's intentional. We can argue if the intention/design is good or bad but it is intentional. And since there is a simple way to have the LOCAL flush I don't see a problem there. We anyhow suggest you move away from mysqldump and use mysqlbackup.

all best
Bogdan