List:Internals« Previous MessageNext Message »
From:Heikki Tuuri Date:December 22 2004 9:11am
Subject:bk commit into 4.1 tree (heikki:1.2132)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of heikki. When heikki does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2132 04/12/22 11:11:16 heikki@stripped +1 -0
  ha_innodb.cc:
    Add a comment that no InnoDB table lock is now acquired in LOCK TABLES if AUTOCOMMIT=1. This helps to avoid deadlocks when porting old MyISAM applications to InnoDB.

  sql/ha_innodb.cc
    1.178 04/12/22 11:10:51 heikki@stripped +8 -0
    Add a comment that no InnoDB table lock is now acquired in LOCK TABLES if AUTOCOMMIT=1. This helps to avoid deadlocks when porting old MyISAM applications to InnoDB.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	heikki
# Host:	hundin.mysql.fi
# Root:	/home/heikki/mysql-4.1

--- 1.177/sql/ha_innodb.cc	Wed Dec 22 11:05:45 2004
+++ 1.178/sql/ha_innodb.cc	Wed Dec 22 11:10:51 2004
@@ -5049,10 +5049,18 @@
 			prebuilt->select_lock_type = LOCK_S;
 		}
 
+		/* Starting from 4.1.9, no InnoDB table lock is taken in LOCK
+		TABLES if AUTOCOMMIT=1. It does not make much sense to acquire
+		an InnoDB table lock if it is released immediately at the end
+		of LOCK TABLES, and InnoDB's table locks in that case cause
+		VERY easily deadlocks. */
+
 		if (prebuilt->select_lock_type != LOCK_NONE) {
+
 			if (thd->in_lock_tables &&
 			    thd->variables.innodb_table_locks &&
 			    (thd->options & OPTION_NOT_AUTOCOMMIT)) {
+
 				ulint	error;
 				error = row_lock_table_for_mysql(prebuilt,
 							NULL, LOCK_TABLE_EXP);
Thread
bk commit into 4.1 tree (heikki:1.2132)Heikki Tuuri22 Dec