List:Commits« Previous MessageNext Message »
From:marko.makela Date:August 19 2010 10:23am
Subject:bzr commit into mysql-5.5-innodb branch (marko.makela:3168) Bug#56114
View as plain text  
#At file:///home/marko/innobase/dev/mysql2a/5.5-innodb/ based on revid:jimmy.yang@strippedtukdtb23jv

 3168 Marko Mäkelä	2010-08-19
      Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()
      Only allow trx->dict_operation_lock_mode to be 0 or RW_S_LATCH in
      srv_suspend_mysql_thread(). Transactions that modify InnoDB
      data dictionary tables must be free of lock waits, because they
      must be holding the data dictionary latch in exclusive mode.
      The transactions must not be accessing any other tables other than
      the data dictionary tables.
      This code was accidentally added in the InnoDB Plugin, as a wrong fix
      of an assertion failure. (Fast index creation was accessing both
      data dictionary tables and user tables in the same transaction.)

=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c	revid:marko.makela@stripped0819102332-vfmgh7uzdfpndq1h
@@ -1583,13 +1583,20 @@ srv_suspend_mysql_thread(
 	had_dict_lock = trx->dict_operation_lock_mode;
 	switch (had_dict_lock) {
+	case 0:
+		break;
 	case RW_S_LATCH:
 		/* Release foreign key check latch */
-	case RW_X_LATCH:
-		/* Release fast index creation latch */
-		row_mysql_unlock_data_dictionary(trx);
+	default:
+		/* There should never be a lock wait when the
+		dictionary latch is reserved in X mode.  Dictionary
+		transactions should only acquire locks on dictionary
+		tables, not other tables. All access to dictionary
+		tables should be covered by dictionary
+		transactions. */
+		ut_error;
@@ -1602,13 +1609,8 @@ srv_suspend_mysql_thread(
 	/* After resuming, reacquire the data dictionary latch if
 	necessary. */
-	switch (had_dict_lock) {
-	case RW_S_LATCH:
+	if (had_dict_lock) {
-		break;
-	case RW_X_LATCH:
-		row_mysql_lock_data_dictionary(trx);
-		break;
 	if (was_declared_inside_innodb) {

Attachment: [text/bzr-bundle] bzr/
bzr commit into mysql-5.5-innodb branch (marko.makela:3168) Bug#56114marko.makela19 Aug