From: Date: September 10 2008 6:38am Subject: bzr push into mysql-6.0-falcon branch (cpowers:2815 to 2816) Bug#39350 List-Archive: http://lists.mysql.com/commits/53656 X-Bug: 39350 Message-Id: <20080910043815.B7D641DB0726@xeno.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2816 Christopher Powers 2008-09-09 Bug#39350 Falcon: Releasing deferred indexes causes crash Minor changes per code review modified: storage/falcon/Transaction.cpp 2815 Christopher Powers 2008-09-09 Bug#39350 Falcon: Releasing deferred indexes causes crash - Transactions now bump the reference count for deferred indexes - Transaction::releaseDeferredIndexes(Table *) now gets exclusive lock on syncDeferredIndexes modified: storage/falcon/DeferredIndex.cpp storage/falcon/DeferredIndexWalker.cpp storage/falcon/StorageTableShare.cpp storage/falcon/StorageTableShare.h storage/falcon/Transaction.cpp storage/falcon/Transaction.h === modified file 'storage/falcon/Transaction.cpp' --- a/storage/falcon/Transaction.cpp 2008-09-10 04:02:07 +0000 +++ b/storage/falcon/Transaction.cpp 2008-09-10 04:37:47 +0000 @@ -1501,14 +1501,8 @@ void Transaction::releaseDeferredIndexes for (DeferredIndex *deferredIndex; (deferredIndex = deferredIndexes);) { + ASSERT(deferredIndex->transaction == this); deferredIndexes = deferredIndex->nextInTransaction; - - if (deferredIndex->transaction) - { - ASSERT(deferredIndex->transaction == this); - deferredIndex->detachTransaction(); - } - deferredIndex->releaseRef(); deferredIndexCount--; } @@ -1524,8 +1518,7 @@ void Transaction::releaseDeferredIndexes if (deferredIndex->index && (deferredIndex->index->table == table)) { *ptr = deferredIndex->nextInTransaction; - if (deferredIndex->transaction) - deferredIndex->detachTransaction(); + deferredIndex->detachTransaction(); deferredIndex->releaseRef(); --deferredIndexCount; }