Bug #10200 Using mysqldump to InnoDB tables causes error
Submitted: 27 Apr 2005 9:54 Modified: 18 May 2005 16:14
Reporter: Jan Lindström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:4.1.12, 5.0.6 OS:Linux (Linux)
Assigned to: Bugs System CPU Architecture:Any

[27 Apr 2005 9:54] Jan Lindström
Description:
Using mysqldump -a test to a database with InnoDB tables causes following
error to mysqld:

InnoDB: Error: stored_select_lock_type is 0 inside ::start_stmt()! 

How to repeat:
DROP TABLE IF EXISTS `t0`;
CREATE TABLE `t0` (
  `a` int(11) NOT NULL auto_increment,
  `b` int(11) default NULL,
  PRIMARY KEY  (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `t0` VALUES (1,1),(2,2),(3,3),(4,4);
COMMIT;
EXIT;

Now run ./mysqldump -a test

Suggested fix:
If thd->lex->sql_command == SQLCOM_LOCK_TABLES and lock_mode != TL_IGNORE
store a lock_mode in ha_innobase::lock_mode(). Consistent read can't be used in
this case.
[27 Apr 2005 10:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24355
[29 Apr 2005 6:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24472
[18 May 2005 16:14] Michael Widenius
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