List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:July 23 2008 3:43am
Subject:bzr commit into mysql-6.0-backup branch (chad:2680) Bug#38303
View as plain text  
#At file:///home/cmiller/work/mysqlbzr/mysql-6.0--bug38303/

 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
      FLUSH TABLES.
modified:
  .bzrignore
  client/mysqldump.c

=== modified file '.bzrignore'
--- a/.bzrignore	2008-07-09 07:12:43 +0000
+++ b/.bzrignore	2008-07-23 03:43:20 +0000
@@ -1886,3 +1886,5 @@ ylwrap
 zlib/*.ds?
 zlib/*.vcproj
 libmysqld/ddl_blocker.cc
+extra/libevent/event-config.h
+libmysqld/mdl.cc

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2008-05-29 15:44:11 +0000
+++ b/client/mysqldump.c	2008-07-23 03:43:20 +0000
@@ -4518,12 +4518,19 @@ static int do_flush_tables_read_lock(MYS
     FLUSH TABLES is to lower the probability of a stage where both mysqldump
     and most client connections are stalled. Of course, if a second long
     update starts between the two FLUSHes, we have that bad stall.
+    
+    If either master-data or dump-slave is set, then we should not flush the 
+    remote tables.  Use the "LOCAL" qualifier to prevent it.
   */
+  const char *statement;
+
+  if ((opt_master_data != 0) || (opt_slave_data != 0))
+    statement= "FLUSH /*!40101 LOCAL */ TABLES";
+  else
+    statement= "FLUSH TABLES";
+  
   return
-    ( 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, statement) ||
       mysql_query_with_error_report(mysql_con, 0,
                                     "FLUSH TABLES WITH READ LOCK") );
 }

Thread
bzr commit into mysql-6.0-backup branch (chad:2680) Bug#38303Chad MILLER23 Jul