summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2008-04-14 17:43:08 -0400
committerunknown <cmiller@zippy.cornsilk.net>2008-04-14 17:43:08 -0400
commit77c7d6972dc6a36e26f8d24bc595b3d2277459e1 (patch)
tree4be01e21769678d8047834bd25d849f94a9f39ef /client
parent269ebe54211cf96c4e64fa7268a1414588ca1de8 (diff)
downloadmariadb-git-77c7d6972dc6a36e26f8d24bc595b3d2277459e1.tar.gz
Bug#35157: mysqldump should use FLUSH TABLES NO_WRITE_TO_BINLOG \
when --master-data is used When using the --master-data option with mysqldump, mysqldump uses a FLUSH TABLES command. However, this statement got replicated to the slave(s), which caused the slave(s) to block unnecessarily while the FLUSH tables command completed. Now, if the master-data option is set to one of the two "on" modes, then use the "LOCAL" qualifier to ensure that it's not replicated. client/mysqldump.c: If master_data is set to one of the two modes, then insert "LOCAL" to the command to FLUSH TABLES so that the slaves aren't told to flush also. mysql-test/r/mysqldump.result: Output of mysqldump changed.
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 49f3d3ad71b..0cc8916fac4 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -4326,7 +4326,10 @@ static int do_flush_tables_read_lock(MYSQL *mysql_con)
update starts between the two FLUSHes, we have that bad stall.
*/
return
- ( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") ||
+ ( 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") );
}