Bug #5545 mysqldump lost connection during dump
Submitted: 13 Sep 2004 16:10 Modified: 14 Sep 2004 14:33
Reporter: Sergey Plekhov Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:4.0.21 OS:Linux (Linux 2.4.26 - 2.4.27)
Assigned to: CPU Architecture:Any

[13 Sep 2004 16:10] Sergey Plekhov
$ /home/mysql/bin/mysqldump --opt --databases shop_new | gzip > `date +shop_new-%d-%m-%Y.sql.gz`
/home/mysql/bin/mysqldump: Can't get CREATE TABLE for table `action_values` (Lost connection to MySQL server during query)
$ /home/mysql/bin/mysqldump --databases shop_new | gzip > `date +shop_new-%d-%m-%Y.sql.gz`

At 4.0.20 this code works fine, but after 4.0.21 --opt option for mysqldump seems to be buggy as shown above.

How to repeat:
try to mysqldump --opt with any database...
[13 Sep 2004 16:28] Sergey Plekhov
Some additional information:
this bug appears only on Slackware 8.0 and Mandrake 7.1, nor on Slackware 9.1 or Slackware 10.0 (it's all linux systems, which available for me).

Maybe occurrence of --opt bug depends of some environment of this distributions...
[13 Sep 2004 18:05] Sergey Plekhov
test case:

create database optbug;
use optbug;
  xid int(11)
) TYPE=InnoDB;

root@prmt3:~# mysqldump --opt --databases optbug | bzip2 -c > `date +optbug-%d-%m-%Y.sql.bz2`
mysqldump: Can't get CREATE TABLE for table `x` (Lost connection to MySQL server during query)
Number of processes running now: 0
040913 22:01:47  mysqld restarted

last string has absolutely stunned me ;)
[13 Sep 2004 20:53] Marko Mäkelä
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

Additional info:

I was able to repeat the crash. Based on the symptoms (see the mysqld error log), this looks like a duplicate of Bug #5538. The fix to Bug #5538 seems to fix this bug as well.
[14 Sep 2004 14:33] Heikki Tuuri

Yes, since --opt involves --lock-tables, this is the same as Bug #5538.

Unfortunately, many people use --opt in their mysqldump scripts :(. This bug is serious for them.

Workaround for them: use --quick and --single-transaction. (--quick is needed so that mysqld does not run out of memory in mysqldump.)

The bug is fixed in 4.0.22. The bug does not concern 4.1.4.