List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:August 19 2008 4:33am
Subject:bzr push into mysql-6.0-falcon branch (cpowers:2789)
View as plain text  
 2789 Christopher Powers	2008-08-18 [merge]
      merge

=== modified file 'storage/falcon/Index.cpp'
--- a/storage/falcon/Index.cpp	2008-08-18 05:45:29 +0000
+++ b/storage/falcon/Index.cpp	2008-08-19 03:33:01 +0000
@@ -45,7 +45,6 @@
 #include "RSet.h"
 #include "WalkIndex.h"
 #include "WalkDeferred.h"
-// #include "Interlock.h" // debug
 
 #define SEGMENT_BYTE(segment,count)		((indexVersion >= INDEX_VERSION_1) ? count - segment : segment)
 #define PAD_BYTE(field)					((indexVersion >= INDEX_VERSION_1) ? field->indexPadByte : 0)
@@ -111,17 +110,10 @@ void Index::init(Table *tbl, const char 
 	syncDIHash.setName("Index::syncDIHash");
 	syncUnique.setName("Index::syncUnique");
 	deferredIndexes.syncObject.setName("Index::deferredIndexes.syncObject");
-
-	/*** debug
-	useCount = 1;
-	syncObject.setName("Index::syncObject");
-	***/
 }
 
 Index::~Index()
 {
-	// ASSERT(useCount <= 2); // debug
-	
 	if (deferredIndexes.first)
 		{
 		Sync sync(&deferredIndexes.syncObject, "Index::~Index");
@@ -1146,35 +1138,3 @@ void Index::scanDIHash(IndexKey* scanKey
 			}
 		}
 }
-
-#if 0 //debug
-void Index::lock(bool exclusiveLock)
-{
-	syncObject.lock(NULL, (exclusiveLock) ? Exclusive : Shared);
-}
-
-void Index::unlock(void)
-{
-	syncObject.unlock();
-}
-
-void Index::addRef()
-{
-	INTERLOCKED_INCREMENT(useCount);
-}
-
-void Index::release()
-{
-	ASSERT (useCount > 0);
-
-	if (INTERLOCKED_DECREMENT(useCount) == 0)
-		{
-		/*** debugging only
-		int cnt = useCount;
-		Table *t = table;
-		const char *tableName = table->name;
-		***/
-		//delete this; // disabled for debug
-		}
-}
-#endif

=== modified file 'storage/falcon/Index.h'
--- a/storage/falcon/Index.h	2008-08-18 05:45:29 +0000
+++ b/storage/falcon/Index.h	2008-08-19 03:33:01 +0000
@@ -26,7 +26,6 @@
 
 #include "Types.h"
 #include "Queue.h"
-//#include "SyncObject.h" // debug
 
 static const int INDEX_VERSION_0		= 0;
 static const int INDEX_VERSION_1		= 1;
@@ -129,15 +128,6 @@ public:
 	Index(Table *tbl, const char *indexName, int indexType, int id, int numberFields);
 	virtual ~Index();
 
-	/*** debug
-	virtual void	lock(bool exclusiveLock);
-	virtual void	unlock(void);
-	void			release();
-	void			addRef();
-	SyncObject	syncObject; // debug
-	volatile INTERLOCK_TYPE useCount;
-	***/
-
 	Table		*table;
 	Database	*database;
 	Dbb			*dbb;

=== modified file 'storage/falcon/StorageTable.cpp'
--- a/storage/falcon/StorageTable.cpp	2008-08-18 05:45:29 +0000
+++ b/storage/falcon/StorageTable.cpp	2008-08-19 03:33:01 +0000
@@ -198,13 +198,6 @@ int StorageTable::setCurrentIndex(int in
 		return StorageErrorNoIndex;
 		}
 		
-	/*** debug
-	if (currentIndex->index)
-		currentIndex->index->addRef();
-	else
-		currentIndex->index = NULL;
-	***/
-
 	upperBound = lowerBound = NULL;
 	searchFlags = 0;
 	return 0;
@@ -212,14 +205,6 @@ int StorageTable::setCurrentIndex(int in
 	
 int StorageTable::clearCurrentIndex()
 {
-	/*** debug
-	if (currentIndex)
-		if (currentIndex->index)
-			currentIndex->index->release();
-		else
-			currentIndex->index = NULL;
-	***/
-	
 	if (indexesLocked)
 		{
 		share->unlockIndexes();

=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2008-08-18 05:45:29 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2008-08-19 03:33:01 +0000
@@ -398,13 +398,13 @@ bool StorageTableShare::validateIndexes(
 	return true;
 }
 
+// Assumes syncIndexes is locked
+
 StorageIndexDesc* StorageTableShare::getIndex(int indexId)
 {
 	if (!indexes.length || indexId >= numberIndexes)
 		return NULL;
 	
-	ASSERT(validateIndexes());
-	
 	return indexes.get(indexId);
 }
 
@@ -416,11 +416,9 @@ StorageIndexDesc* StorageTableShare::get
 		index = NULL;
 	else
 		{
-		Sync sync(syncObject, "StorageTableShare::getIndex");
+		Sync sync(syncIndexes, "StorageTableShare::getIndex");
 		sync.lock(Shared);
 	
-		ASSERT(validateIndexes());
-
 		index = indexes.get(indexId);
 	
 		if (index)
@@ -432,7 +430,7 @@ StorageIndexDesc* StorageTableShare::get
 
 StorageIndexDesc* StorageTableShare::getIndex(const char *name)
 {
-	Sync sync(syncObject, "StorageTableShare::getIndex(name)");
+	Sync sync(syncIndexes, "StorageTableShare::getIndex(name)");
 	sync.lock(Shared);
 	
 	for (int i = 0; i < numberIndexes; i++)
@@ -479,12 +477,8 @@ int StorageTableShare::getIndexId(const 
 			
 			if (strcmp(index->getIndexName(), indexName) == 0 &&
 				strcmp(index->getSchemaName(), schemaName) == 0)
-				{
-//				if (n != indexes.get(n)->id) //debug
-//					return n;
 				return n;
 			}
-			}
 		
 	return -1;
 }
@@ -500,6 +494,7 @@ int StorageTableShare::haveIndexes(int i
 	for (int n = 0; n < numberIndexes; ++n)
 		{
 		StorageIndexDesc* index = indexes.get(n);
+		
 		if (!index)
 			return false;
 			

Thread
bzr push into mysql-6.0-falcon branch (cpowers:2789) Christopher Powers19 Aug