List:Commits« Previous MessageNext Message »
From:marko.makela Date:September 26 2011 7:30am
Subject:bzr push into mysql-5.1 branch (marko.makela:3613 to 3614) Bug#12963823
View as plain text  
 3614 Marko Mäkelä	2011-09-22
      Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
      
      Replace part of the patch that Kevin apparently forgot to push.
      Fix the bug also in the built-in InnoDB of MySQL 5.1.
      
      I cannot explain why the test case was not failing without the
      full patch.
      
      This was rb:762, approved by me.

    modified:
      storage/innobase/row/row0purge.c
      storage/innodb_plugin/ChangeLog
      storage/innodb_plugin/row/row0purge.c
 3613 kevin.lewis@stripped	2011-09-20
      Bug 12963823 - Crash in Purge thread under unusual circumstances.
      The problem occurred when indexes are added between the time that an
      UNDO record is created and the time that the purge thread comes around
      and deletes the old secondary index entries.  The purge thread would
      hit an assert when trying to build a secondary index entry for
      searching.  The problem was that the old value of those fields were not
      in the UNDO record since they were not part of an index when the UPDATE
      occured. 
      A test case was added to innodb-index.test.

    modified:
      mysql-test/suite/innodb_plugin/r/innodb-index.result
      mysql-test/suite/innodb_plugin/t/innodb-index.test
      storage/innodb_plugin/row/row0purge.c
=== modified file 'storage/innobase/row/row0purge.c'
--- a/storage/innobase/row/row0purge.c	revid:kevin.lewis@stripped
+++ b/storage/innobase/row/row0purge.c	revid:marko.makela@strippedm-20110922103502-n911a79nxii6yd36
@@ -379,7 +379,8 @@ row_purge_upd_exist_or_extern(
 
 	ut_ad(node);
 
-	if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
+	if (node->rec_type == TRX_UNDO_UPD_DEL_REC
+	    || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
 
 		goto skip_secondaries;
 	}
@@ -488,14 +489,14 @@ row_purge_parse_undo_rec(
 	dulint		roll_ptr;
 	ulint		info_bits;
 	ulint		type;
-	ulint		cmpl_info;
 
 	ut_ad(node && thr);
 
 	trx = thr_get_trx(thr);
 
-	ptr = trx_undo_rec_get_pars(node->undo_rec, &type, &cmpl_info,
-				    updated_extern, &undo_no, &table_id);
+	ptr = trx_undo_rec_get_pars(
+		node->undo_rec, &type, &node->cmpl_info,
+		updated_extern, &undo_no, &table_id);
 	node->rec_type = type;
 
 	if (type == TRX_UNDO_UPD_DEL_REC && !(*updated_extern)) {
@@ -508,7 +509,8 @@ row_purge_parse_undo_rec(
 	node->table = NULL;
 
 	if (type == TRX_UNDO_UPD_EXIST_REC
-	    && cmpl_info & UPD_NODE_NO_ORD_CHANGE && !(*updated_extern)) {
+	    && node->cmpl_info & UPD_NODE_NO_ORD_CHANGE
+	    && !(*updated_extern)) {
 
 		/* Purge requires no changes to indexes: we may return */
 
@@ -563,7 +565,7 @@ row_purge_parse_undo_rec(
 
 	/* Read to the partial row the fields that occur in indexes */
 
-	if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+	if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
 		ptr = trx_undo_rec_get_partial_row(ptr, clust_index,
 						   &(node->row), node->heap);
 	}

=== modified file 'storage/innodb_plugin/ChangeLog'
--- a/storage/innodb_plugin/ChangeLog	revid:kevin.lewis@stripped01236-lj5txjj5wnzcvdz9
+++ b/storage/innodb_plugin/ChangeLog	revid:marko.makela@strippedxii6yd36
@@ -1,3 +1,8 @@
+2011-09-20	The InnoDB Team
+
+	* row/row0purge.c:
+	Fix Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
+
 2011-09-12	The InnoDB Team
 
 	* row/row0sel.c:

=== modified file 'storage/innodb_plugin/row/row0purge.c'
--- a/storage/innodb_plugin/row/row0purge.c	revid:kevin.lewis@stripped-lj5txjj5wnzcvdz9
+++ b/storage/innodb_plugin/row/row0purge.c	revid:marko.makela@strippednxii6yd36
@@ -406,7 +406,8 @@ row_purge_upd_exist_or_extern_func(
 
 	ut_ad(node);
 
-	if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
+	if (node->rec_type == TRX_UNDO_UPD_DEL_REC
+	    || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
 
 		goto skip_secondaries;
 	}

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (marko.makela:3613 to 3614) Bug#12963823marko.makela26 Sep