List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:April 20 2011 11:38pm
Subject:bzr push into mysql-trunk-innodb branch (Sunny.Bains:3596 to 3597)
View as plain text  
 3597 Sunny Bains	2011-04-21
      Fix a debug assertion triggered in Michael's testing. This should not have any
      impact on production code. The assertion itself was wrong. A table has locks
      from several transactions and transactions have locks on several tables. The
      check was not taking this into consideration. The fix is to count table locks
      that are on the table that is being validated and use that in the assertion.

    modified:
      storage/innobase/lock/lock0lock.c
 3596 Marko Mäkelä	2011-04-20
      Non-functional changes.
      
      btr_cur_ins_lock_and_undo(): Remove one level of indentation from the tail.
      
      btr_cur_update_in_place(): Split a line a little better.
      
      row_undo_ins_remove_clust_rec(): Use common func_exit.
      
      row_upd_clust_step(): Return row_upd_clust_rec() directly.

    modified:
      storage/innobase/btr/btr0cur.c
      storage/innobase/row/row0uins.c
      storage/innobase/row/row0upd.c
=== modified file 'storage/innobase/lock/lock0lock.c'
--- a/storage/innobase/lock/lock0lock.c	revid:marko.makela@strippede1udr
+++ b/storage/innobase/lock/lock0lock.c	revid:sunny.bains@stripped
@@ -5094,6 +5094,9 @@ lock_table_queue_validate(
 	     lock != NULL;
 	     lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock)) {
 
+		ulint		i;
+		ib_vector_t*	table_locks;
+
 		/* lock->trx->state cannot change from or to NOT_STARTED
 		while we are holding the trx_sys->lock. It may change
 		from ACTIVE to PREPARED, but it may not change to
@@ -5111,7 +5114,22 @@ lock_table_queue_validate(
 		}
 
 		ut_a(lock_trx_table_locks_find(lock->trx, lock));
-		count += ib_vector_size(lock->trx->lock.table_locks);
+
+		/* Skip the NULL entries and only count the locks that
+		transactions have on this table. */
+		table_locks = lock->trx->lock.table_locks;
+
+		for (i = 0; i < ib_vector_size(table_locks); ++i) {
+			const lock_t*	trx_lock;
+
+			trx_lock = ib_vector_get(table_locks, i);
+
+			if (trx_lock != NULL
+			    && trx_lock->un_member.tab_lock.table == table) {
+
+				++count;
+			}
+		}
 	}
 
 	ut_a(count == UT_LIST_GET_LEN(table->locks));

Attachment: [text/bzr-bundle] bzr/sunny.bains@oracle.com-20110420233524-s6v0p1zs8x50h66i.bundle
Thread
bzr push into mysql-trunk-innodb branch (Sunny.Bains:3596 to 3597) Sunny Bains21 Apr