From 2bd02714d2fb70cb75c78d6f1da43273d6572bf2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Apr 2005 12:28:25 +0300 Subject: [PATCH] Fixed a bug using mysqldump to InnoDB tables causes error (Bug #10200). sql/ha_innodb.cc: Fixed a bug using mysqldump to InnoDB tables causes error (Bug #10200). Lock type must be stored when sql_command = SQLCOM_LOCK_TABLES and lock_type = TL_READ or TL_READ_INSERT even when innobase_locks_unsafe_for_binlog is set. --- sql/ha_innodb.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 83c72594dfb..8f9671c5e67 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5340,15 +5340,14 @@ ha_innobase::store_lock( (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && thd->lex->sql_command != SQLCOM_SELECT && thd->lex->sql_command != SQLCOM_UPDATE_MULTI && - thd->lex->sql_command != SQLCOM_DELETE_MULTI ) { + thd->lex->sql_command != SQLCOM_DELETE_MULTI && + thd->lex->sql_command != SQLCOM_LOCK_TABLES) { /* In case we have innobase_locks_unsafe_for_binlog option set and isolation level of the transaction is not set to serializable and MySQL is doing INSERT INTO...SELECT without FOR UPDATE or IN - SHARE MODE we use consistent read for select. - Similarly, in case of DELETE...SELECT and - UPDATE...SELECT when these are not multi table.*/ + SHARE MODE we use consistent read for select. */ prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE;