Bug #7358 mysqldump: Simltanious use of --master-data & --single-transaction doesn't work
Submitted: 16 Dec 2004 19:38 Modified: 18 Dec 2004 17:39
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:4.1.8 OS:Linux (SuSE Linux 9.0)
Assigned to: Guilhem Bichot

[16 Dec 2004 19:38] Shuichi Tamagawa
Description:
Simultanious use of --master-data & --single-transaction option doesn't work with --all-database option when you make a backup using mysqldump. It works if only one deatabase is specified.

How to repeat:
#./mysqldump -u root -p --all-database --flush-logs --master-data=2 --single-transaction > all_databases.sql
Enter password:
./mysqldump: ./mysqldump: Couldn't execute 'SHOW CREATE DATABASE IF NOT EXISTS `mysql`': Can't execute the given command because you have active locked tables or an active transaction (1192)
./mysqldump: ./mysqldump: Couldn't execute 'SHOW CREATE DATABASE IF NOT EXISTS `test`': Can't execute the given command because you have active locked tables or an active transaction (1192)
[18 Dec 2004 17:39] Guilhem Bichot
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

This is not a fatal error, just a warning, mysqldump still prints the CREATE DATABASE and continues dumping. What's new in 4.1.8 is that this warning is shown.
Good thing, as it made us notice that since 4.1.7 there is a problem with SHOW CREATE DATABASE in mysqldump --single-transaction (no --master-data) --all-databases: if there are two databases, and first db has a non-empty InnoDB table, the SHOW CREATE DATABASE will fail on second db, so CREATE DATABASE will be printed but without the CHARACTER SET clause.
I fix the failure of SHOW CREATE DATABASE (not due to my recent patches to mysqldump) and remove the warning display (due to my recent patches to mysqldump), in 4.1 in:
ChangeSet@1.2086.165.1, 2004-12-17 23:37:43+01:00, guilhem@mysql.com