Bug #60902 mysqldump does not dump the replication *_info tables
Submitted: 18 Apr 2011 6:05 Modified: 17 Oct 2011 18:50
Reporter: Giuseppe Maxia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:5.6.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: dump, replication, table

[18 Apr 2011 6:05] Giuseppe Maxia
Description:
if you perform a mysqldump of the 'mysql' database, or when asking for --all-databases, the tables slave_master_info and slave_relay_log_info are not in the dump.
If you ask specifically for such tables, and a dd the --master-info option, then they are dumped

mysqldump mysql slave_master_info
mysqldump: Got error: 1721: You can't use locks with rpl info tables. when doing LOCK TABLES

mysqldump --master-data mysql slave_master_info  slave_relay_log_info
# OK

mysqldump mysql 
# slave_master_info and slave_relay_log_info are missing

mysqldump --master-data mysql 
# slave_master_info and slave_relay_log_info are missing

How to repeat:
# in mysql 5.6, dump the 'mysql' database

/path/to/mysql_5_6/bin/mysqldump mysql

Suggested fix:
current workaround is to dump the missing tables individually, although they can't be dumped in a way that is consistent with the rest of the replicated tables.
[18 Apr 2011 11:33] Valeriy Kravchuk
Thank you for the bug report. Verified just as described on Windows XP.
[17 Oct 2011 18:50] Jon Stephens
Documented bugfix in the 5.6.4 changelog as follows:
       
       mysqldump --all-databases
      
(http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html#option_mysqldump_all-databases) did not dump the
       replication log tables. (They could be dumped only by
       naming them explicitly when invoking mysqldump, and using
       the --master-data
      
(http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html#option_mysqldump_master-data) option.)
      
       As a result of the fix for this problem, it is now
       possible to execute statements requiring read locks on
       the replication log tables at any time, while any
       statements requiring a write lock on either or both of
       these tables are disallowed whenever replication is in
       progress. For more information, see Replication Relay and
       Status Logs
       (http://dev.mysql.com/doc/refman/5.6/en/slave-logs.html).
       (Bug #12402875, Bug #60902)

Also updated the descriptions of the slave log tables and the mysqldump
--all-databases and --master-data options in the 5.6 Manual.

Closed.