List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:September 10 2008 8:08pm
Subject:bzr push into mysql-6.0-falcon branch (cpowers:2820 to 2821) Bug#39350
View as plain text  
 2821 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
          
      Restored DeferredIndex addRef/releaseRef to Transaction.
modified:
  storage/falcon/DeferredIndex.cpp
  storage/falcon/DeferredIndexWalker.cpp
  storage/falcon/Transaction.cpp

 2820 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
        
      Fixed regression to last commit that prevented deferred indexes from being released.
modified:
  storage/falcon/Transaction.cpp

=== modified file 'storage/falcon/DeferredIndex.cpp'
--- a/storage/falcon/DeferredIndex.cpp	2008-09-10 06:42:49 +0000
+++ b/storage/falcon/DeferredIndex.cpp	2008-09-10 19:51:03 +0000
@@ -840,7 +840,7 @@ void DeferredIndex::detachTransaction(vo
 	else
 		sync.unlock();
 
-	releaseRef();
+	//releaseRef();
 }
 
 void DeferredIndex::chill(Dbb *dbb)
@@ -891,3 +891,4 @@ void DeferredIndex::releaseRef()
 	if (useCount == 0)
 		delete this;
 }
+

=== modified file 'storage/falcon/DeferredIndexWalker.cpp'
--- a/storage/falcon/DeferredIndexWalker.cpp	2008-09-10 06:42:49 +0000
+++ b/storage/falcon/DeferredIndexWalker.cpp	2008-09-10 19:51:03 +0000
@@ -31,6 +31,7 @@ DeferredIndexWalker::DeferredIndexWalker
 void DeferredIndexWalker::initialize(DeferredIndex *deferredIdx, IndexKey *indexKey, int searchFlags)
 {
 	deferredIndex = deferredIdx;
+	deferredIndex->addRef();
 	currentNode = NULL;
 	DIBucket *bucket = (DIBucket*) deferredIndex->root;
 	nodePending = true;
@@ -94,6 +95,8 @@ void DeferredIndexWalker::initialize(Def
 
 DeferredIndexWalker::~DeferredIndexWalker(void)
 {
+	if (deferredIndex)
+		deferredIndex->releaseRef();
 }
 
 DINode* DeferredIndexWalker::next(void)

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-09-10 17:32:43 +0000
+++ b/storage/falcon/Transaction.cpp	2008-09-10 19:51:03 +0000
@@ -1317,6 +1317,7 @@ void Transaction::add(DeferredIndex* def
 	Sync sync(&syncDeferredIndexes, "Transaction::add");
 	sync.lock(Exclusive);
 
+	deferredIndex->addRef();
 	deferredIndex->nextInTransaction = deferredIndexes;
 	deferredIndexes = deferredIndex;
 	deferredIndexCount++;
@@ -1503,6 +1504,7 @@ void Transaction::releaseDeferredIndexes
 		ASSERT(deferredIndex->transaction == this);
 		deferredIndexes = deferredIndex->nextInTransaction;
 		deferredIndex->detachTransaction();
+		deferredIndex->releaseRef();
 		deferredIndexCount--;
 		}
 }
@@ -1518,6 +1520,7 @@ void Transaction::releaseDeferredIndexes
 			{
 			*ptr = deferredIndex->nextInTransaction;
 			deferredIndex->detachTransaction();
+			deferredIndex->releaseRef();
 			--deferredIndexCount;
 			}
 		else

Thread
bzr push into mysql-6.0-falcon branch (cpowers:2820 to 2821) Bug#39350Christopher Powers10 Sep