List:Commits« Previous MessageNext Message »
From:marko.makela Date:June 1 2010 12:08pm
Subject:bzr push into mysql-5.1-innodb branch (marko.makela:3488 to 3490)
View as plain text  
 3490 Marko Mäkelä	2010-06-01
      Minor cleanup.
      
      lock_rec_unlock(): Cache first_lock and rewrite while() loops as for().
      
      btr_cur_optimistic_update(): Use common error handling return.
      
      row_create_prebuilt(): Add Valgrind instrumentation.

    modified:
      storage/innodb_plugin/btr/btr0cur.c
      storage/innodb_plugin/lock/lock0lock.c
      storage/innodb_plugin/row/row0mysql.c
 3489 Marko Mäkelä	2010-06-01
      Document the Bug #53812 fix.

    modified:
      storage/innodb_plugin/ChangeLog
 3488 Marko Mäkelä	2010-06-01
      Bug#53812: assert row/row0umod.c line 660 in txn rollback after crash recovery
      
      row_undo_mod_upd_exist_sec(): Tolerate a failure to build the index entry
      for a DYNAMIC or COMPRESSED table during crash recovery.

    modified:
      storage/innodb_plugin/row/row0umod.c
=== modified file 'storage/innodb_plugin/ChangeLog'
--- a/storage/innodb_plugin/ChangeLog	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/ChangeLog	revid:marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
@@ -1,3 +1,9 @@
+2010-06-01	The InnoDB Team
+
+	* row/row0umod.c:
+	Fix Bug#53812 assert row/row0umod.c line 660 in txn rollback
+	after crash recovery
+
 2010-05-25	The InnoDB Team
 
 	* handler/ha_innodb.cc, include/row0mysql.h, row/row0mysql.c:

=== modified file 'storage/innodb_plugin/btr/btr0cur.c'
--- a/storage/innodb_plugin/btr/btr0cur.c	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/btr/btr0cur.c	revid:marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
@@ -1959,9 +1959,8 @@ any_extern:
 	err = btr_cur_upd_lock_and_undo(flags, cursor, update, cmpl_info,
 					thr, mtr, &roll_ptr);
 	if (err != DB_SUCCESS) {
-err_exit:
-		mem_heap_free(heap);
-		return(err);
+
+		goto err_exit;
 	}
 
 	/* Ok, we may do the replacement. Store on the page infimum the
@@ -2007,9 +2006,10 @@ err_exit:
 
 	page_cur_move_to_next(page_cursor);
 
+	err = DB_SUCCESS;
+err_exit:
 	mem_heap_free(heap);
-
-	return(DB_SUCCESS);
+	return(err);
 }
 
 /*************************************************************//**

=== modified file 'storage/innodb_plugin/lock/lock0lock.c'
--- a/storage/innodb_plugin/lock/lock0lock.c	revid:marko.makela@strippedmeh9dr
+++ b/storage/innodb_plugin/lock/lock0lock.c	revid:marko.makela@stripped
@@ -3935,8 +3935,8 @@ lock_rec_unlock(
 	const rec_t*		rec,	/*!< in: record */
 	enum lock_mode		lock_mode)/*!< in: LOCK_S or LOCK_X */
 {
+	lock_t*	first_lock;
 	lock_t*	lock;
-	lock_t*	release_lock	= NULL;
 	ulint	heap_no;
 
 	ut_ad(trx && rec);
@@ -3946,48 +3946,40 @@ lock_rec_unlock(
 
 	mutex_enter(&kernel_mutex);
 
-	lock = lock_rec_get_first(block, heap_no);
+	first_lock = lock_rec_get_first(block, heap_no);
 
 	/* Find the last lock with the same lock_mode and transaction
 	from the record. */
 
-	while (lock != NULL) {
+	for (lock = first_lock; lock != NULL;
+	     lock = lock_rec_get_next(heap_no, lock)) {
 		if (lock->trx == trx && lock_get_mode(lock) == lock_mode) {
-			release_lock = lock;
 			ut_a(!lock_get_wait(lock));
+			lock_rec_reset_nth_bit(lock, heap_no);
+			goto released;
 		}
-
-		lock = lock_rec_get_next(heap_no, lock);
 	}
 
-	/* If a record lock is found, release the record lock */
-
-	if (UNIV_LIKELY(release_lock != NULL)) {
-		lock_rec_reset_nth_bit(release_lock, heap_no);
-	} else {
-		mutex_exit(&kernel_mutex);
-		ut_print_timestamp(stderr);
-		fprintf(stderr,
-			"  InnoDB: Error: unlock row could not"
-			" find a %lu mode lock on the record\n",
-			(ulong) lock_mode);
+	mutex_exit(&kernel_mutex);
+	ut_print_timestamp(stderr);
+	fprintf(stderr,
+		"  InnoDB: Error: unlock row could not"
+		" find a %lu mode lock on the record\n",
+		(ulong) lock_mode);
 
-		return;
-	}
+	return;
 
+released:
 	/* Check if we can now grant waiting lock requests */
 
-	lock = lock_rec_get_first(block, heap_no);
-
-	while (lock != NULL) {
+	for (lock = first_lock; lock != NULL;
+	     lock = lock_rec_get_next(heap_no, lock)) {
 		if (lock_get_wait(lock)
 		    && !lock_rec_has_to_wait_in_queue(lock)) {
 
 			/* Grant the lock */
 			lock_grant(lock);
 		}
-
-		lock = lock_rec_get_next(heap_no, lock);
 	}
 
 	mutex_exit(&kernel_mutex);

=== modified file 'storage/innodb_plugin/row/row0mysql.c'
--- a/storage/innodb_plugin/row/row0mysql.c	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/row/row0mysql.c	revid:marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
@@ -625,6 +625,8 @@ row_create_prebuilt(
 
 	prebuilt->select_lock_type = LOCK_NONE;
 	prebuilt->stored_select_lock_type = 99999999;
+	UNIV_MEM_INVALID(&prebuilt->stored_select_lock_type,
+			 sizeof prebuilt->stored_select_lock_type);
 
 	prebuilt->search_tuple = dtuple_create(
 		heap, 2 * dict_table_get_n_cols(table));

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr.bundle
Thread
bzr push into mysql-5.1-innodb branch (marko.makela:3488 to 3490) marko.makela1 Jun