From 917e8b4da32b612b29e76938362eef70b6420cd0 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Wed, 22 Dec 2004 11:01:25 +0200 Subject: [PATCH] ha_innodb.cc: If AUTOCOMMIT=1, do not acquire an InnoDB table lock in LOCK TABLES; this makes porting of old MyISAM applications to InnoDB easier, since in that mode InnoDB table locks caused deadlocks very easily --- sql/ha_innodb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index c36075207ed..69d9d885b8e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4702,7 +4702,8 @@ ha_innobase::external_lock( if (prebuilt->select_lock_type != LOCK_NONE) { if (thd->in_lock_tables && - thd->variables.innodb_table_locks) { + thd->variables.innodb_table_locks && + (thd->options & OPTION_NOT_AUTOCOMMIT)) { ulint error; error = row_lock_table_for_mysql(prebuilt);