Bug #5538 | InnoDB: Assertion failure using mysqldump -l | ||
---|---|---|---|
Submitted: | 13 Sep 2004 8:20 | Modified: | 30 Oct 2004 8:59 |
Reporter: | Ronny Pettersen | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
Version: | 4.0.21 | OS: | Linux (Linux 2.4.26(FC1)) |
Assigned to: | Heikki Tuuri | CPU Architecture: | Any |
[13 Sep 2004 8:20]
Ronny Pettersen
[13 Sep 2004 8:35]
Marko Mäkelä
Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://www.mysql.com/doc/en/Making_trace_files.html Once you have generated a backtrace, please submit it to this bug report and change the status back to 'Open'. Thank you for helping us make our products better. Additional info: Could you please send a complete test case, including the CREATE TABLE and INSERT statements for populating the database? Was there a line "InnoDB: Error: select_lock_type is %lu inside ::start_stmt()!" immediately before the reported assertion failure? If yes, what number was displayed in place of %lu?
[13 Sep 2004 9:23]
Ronny Pettersen
I'm not running the 'debug' version of mysql. I'd have to find some other server to install that one if necessary. I'm using these Linux x86 RPMS from MySQL: MySQL-server-4.0.21-0 MySQL-devel-4.0.21-0 MySQL-shared-compat-4.0.20-0 MySQL-client-4.0.21-0 There were one preceding line left out of the log: InnoDB: Error: select_lock_type is 99999999 inside ::start_stmt()! Complete steps to reproduce: # mysql USE test; DROP TABLE IF EXISTS `IBTABLE`; CREATE TABLE `IBTABLE` ( a int ) TYPE=InnoDB; exit # mysqldump -uroot -l test -- MySQL dump 9.11 -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 4.0.21-standard mysqldump: Can't get CREATE TABLE for table `IBTABLE` (Lost connection to MySQL server during query)
[13 Sep 2004 9:58]
Marko Mäkelä
Thanks for the details. I was able to repeat the crash on my system.
[13 Sep 2004 16:57]
Heikki Tuuri
Hi! I have now fixed this bug. The fix will appear in 4.0.22. This bug did not affect 4.1.4. The reason for the bug was that mysqldump -l uses LOCK TABLES ... READ LOCAL to lock the tables. That READ LOCAL was internally TL_READ, which is normally used in ordinary SELECTs. InnoDB was not prepared that inside LOCK TABLES , TL_READ could be used. Workaround: do not use mysqldump with the -l option. Use the --single-transaction option. Actually, contrary to what is said in the manual, the -l option does NOT guarantee a consistent snapshot of all InnoDB tables is one database. You must use the --single-transaction option to get a consistent snapshot. Thank you, Heikki
[14 Sep 2004 7:27]
Ronny Pettersen
Thanks! I did see "--single-transaction" mentioned while I was searching. But I did not find this option in the manpage (in Linux RPMs). (It's described in 'mysqldump -?' though) Maybe someone could update the manpage as well?
[4 Oct 2004 16:47]
[ name withheld ]
The same bug appears on Windows 2000. Work around the same: add to the mysqldump command line --single-transaction and --lock-tables=false
[4 Oct 2004 19:16]
Christian Hammers
Hello (answering to this report as #5834 was marked duplicate and has been closed) The fix for this bug seems to be the following cvs commit: http://lists.mysql.com/internals/16865 Is it save to apply this on the Debian package of MySQL which I maintain? Doing so would be easier than telling people not do dump innodb databases without --single-transaction as it's policy not to simply insert something into user edited config files like /etc/mysql/my.cnf. A new minor versions won't come in the next 1-2 weeks, I guess? bye, -christian- <ch@debian.org>
[5 Oct 2004 12:23]
Heikki Tuuri
Christian, I think it is safe. Regards, Heikki
[30 Oct 2004 8:59]
Heikki Tuuri
Fixed in 4.0.22.