List:Commits« Previous MessageNext Message »
From:Olav Sandstaa Date:March 24 2009 9:13pm
Subject:bzr commit into mysql-6.0-falcon-team branch (olav:3073) Bug#41357
View as plain text  
#At file:///home/os136802/mysql/develop/repo/falcon-bug41357/ based on revid:jstarkey@stripped

 3073 Olav Sandstaa	2009-03-24
      Follow-up to patch for Bug#41357 falcon.falcon_bug_34351_C fails with assertion IS_CONSISTENT_READ
      In the initial fix there was a change to Transaction::needToLock(). This 
      change assumed that the record pointer always referred to a RecordVersion
      object. This assumption is wrong. It is possible that the object is a 
      Record object.
      This resulted in the ASSERT(transState != NULL) being hit when running
      falcon_backlog test. 
      This patch changes the code in Transaction::needToLock() so that it
      works correctly both when the record parameter referes a RecordVersion
      object and a Record object.
     @ storage/falcon/Transaction.cpp
        Fix Transaction::needToLock() so that it handles the record argument points to a Record object
        as well as RecordVersion objects.

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2009-03-24 19:38:00 +0000
+++ b/storage/falcon/Transaction.cpp	2009-03-24 21:13:10 +0000
@@ -743,7 +743,10 @@ bool Transaction::visible(Transaction * 
 bool Transaction::visible(const TransactionState* transState, int forWhat) const
-	ASSERT(transState != NULL);
+	// If the transaction state is NULL it has been committed long ago 
+	if (!transState)
+		return true;
 	// If we're the transaction in question, consider us committed
@@ -795,13 +798,12 @@ bool Transaction::needToLock(Record* rec
 	for (Record* candidate = record;  candidate != NULL; candidate = candidate->getPriorVersion())
 		TransactionState* transState = candidate->getTransactionState();
-		ASSERT(transState != NULL);
 		if (visible(transState, FOR_WRITING))
 			if (candidate->state == recDeleted)
-				if (transState->state == Committed)
+				if (!transState || transState->state == Committed)
 					return false; // Committed and deleted
 				return true; // Just in case this rolls back.

Attachment: [text/bzr-bundle] bzr/
bzr commit into mysql-6.0-falcon-team branch (olav:3073) Bug#41357Olav Sandstaa24 Mar