List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:August 18 2008 5:54am
Subject:bzr commit into mysql-6.0-falcon branch (cpowers:2790) Bug#38044
View as plain text  
#At file:///home/cpowers/work/dev/dev-04a/mysql/

 2790 Christopher Powers	2008-08-17
      Bug#38044 Falcon crash in StorageTable::compareKey
      - Removed debug code
      - Fixed compiler warnings
      - Fixed bug in StorageTableShare::getIndex() that caused optimization to fail
modified:
  storage/falcon/Index.cpp
  storage/falcon/Index.h
  storage/falcon/StorageDatabase.cpp
  storage/falcon/StorageTableShare.cpp
  storage/falcon/Transaction.cpp
  storage/falcon/ha_falcon.cpp

per-file messages:
  storage/falcon/Index.cpp
    Disabled debug ASSERTs
  storage/falcon/Index.h
    Disabled debug code
  storage/falcon/StorageDatabase.cpp
    Fixed compiler warnings
  storage/falcon/StorageTableShare.cpp
    Fixed bug in StorageTableShare::getIndex() that caused optimization failures
  storage/falcon/Transaction.cpp
    Reversed locking order of syncActiveTransactions and syncCommitted in
Transaction::commit()
  storage/falcon/ha_falcon.cpp
    Use getString() for JString objects in the StorageInterface.
=== modified file 'storage/falcon/Index.cpp'
--- a/storage/falcon/Index.cpp	2008-08-16 22:04:29 +0000
+++ b/storage/falcon/Index.cpp	2008-08-18 03:54:05 +0000
@@ -45,7 +45,7 @@
 #include "RSet.h"
 #include "WalkIndex.h"
 #include "WalkDeferred.h"
-#include "Interlock.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)
@@ -85,7 +85,6 @@ Index::Index(Table * tbl, const char * i
 
 void Index::init(Table *tbl, const char *indexName, int indexType, int count)
 {
-	// useCount = 1; // debug
 	table = tbl;
 	database = table->database;
 	dbb = table->dbb;
@@ -109,16 +108,20 @@ void Index::init(Table *tbl, const char 
 	DIHashTable = NULL;
 	DIHashTableCounts =  0;
 	DIHashTableSlotsUsed =  0;
-	syncObject.setName("Index::syncObject");
 	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");

=== modified file 'storage/falcon/Index.h'
--- a/storage/falcon/Index.h	2008-08-16 22:04:29 +0000
+++ b/storage/falcon/Index.h	2008-08-18 03:54:05 +0000
@@ -26,7 +26,7 @@
 
 #include "Types.h"
 #include "Queue.h"
-#include "SyncObject.h"
+//#include "SyncObject.h" // debug
 
 static const int INDEX_VERSION_0		= 0;
 static const int INDEX_VERSION_1		= 1;
@@ -134,6 +134,7 @@ public:
 	virtual void	unlock(void);
 	void			release();
 	void			addRef();
+	SyncObject	syncObject; // debug
 	volatile INTERLOCK_TYPE useCount;
 	***/
 
@@ -161,7 +162,6 @@ public:
 	DIUniqueNode **DIHashTable;
 	int			DIHashTableCounts;
 	int			DIHashTableSlotsUsed;
-	SyncObject	syncObject;
 	SyncObject	syncDIHash;
 	SyncObject	syncUnique;
 	IndexWalker* positionIndex(IndexKey* lowKey, IndexKey* highKey, int searchFlags,
Transaction* transaction);

=== modified file 'storage/falcon/StorageDatabase.cpp'
--- a/storage/falcon/StorageDatabase.cpp	2008-08-16 18:06:36 +0000
+++ b/storage/falcon/StorageDatabase.cpp	2008-08-18 03:54:05 +0000
@@ -746,8 +746,6 @@ int StorageDatabase::renameTable(Storage
 		{
 		Database *database = connection->database;
 		Sequence *sequence = connection->findSequence(schemaName, table->name);
-		int numberIndexes = 0;
-		int firstIndex = 0;
 
 		Sync syncDDL(&database->syncSysDDL, "StorageDatabase::renameTable(1)");
 		syncDDL.lock(Exclusive);

=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2008-08-16 22:04:29 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2008-08-18 03:54:05 +0000
@@ -414,9 +414,11 @@ StorageIndexDesc* StorageTableShare::get
 
 StorageIndexDesc* StorageTableShare::getIndex(int indexId, StorageIndexDesc *indexDesc)
 {
-	StorageIndexDesc *index = NULL;
+	StorageIndexDesc *index;
 	
-	if (indexes.length && indexId >= numberIndexes)
+	if (!indexes.length || indexId >= numberIndexes)
+		index = NULL;
+	else
 		{
 		Sync sync(syncObject, "StorageTableShare::getIndex");
 		sync.lock(Shared);
@@ -482,8 +484,8 @@ int StorageTableShare::getIndexId(const 
 			if (strcmp(index->getIndexName(), indexName) == 0 &&
 				strcmp(index->getSchemaName(), schemaName) == 0)
 				{
-				if (n != indexes.get(n)->id) //cwp debug
-					return n;
+//				if (n != indexes.get(n)->id) //debug
+//					return n;
 				return n;
 			}
 			}

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-08-14 11:18:42 +0000
+++ b/storage/falcon/Transaction.cpp	2008-08-18 03:54:05 +0000
@@ -300,17 +300,19 @@ void Transaction::commit()
 	database->flushInversion(this);
 
 	// Transfer transaction from active list to committed list, set committed state
+
 	Sync syncCommitted(&transactionManager->committedTransactions.syncObject,
"Transaction::commit(2)");
 	Sync syncActiveTransactions(&transactionManager->activeTransactions.syncObject,
"Transaction::commit(3)");
-	syncCommitted.lock(Exclusive);
+
 	syncActiveTransactions.lock(Exclusive);
+	syncCommitted.lock(Exclusive);
 
 	transactionManager->activeTransactions.remove(this);
 	transactionManager->committedTransactions.append(this);
 	state = Committed;
 
-	syncActiveTransactions.unlock();
 	syncCommitted.unlock();
+	syncActiveTransactions.unlock();
 
 	database->commit(this);
 

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-08-16 22:04:29 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-08-18 03:54:05 +0000
@@ -890,7 +890,7 @@ int StorageInterface::dropIndex(const ch
 	getKeyDesc(table, indexId, &indexDesc);
 	
 	char indexName[indexNameSize];
-	storageShare->createIndexName(indexDesc.name, indexName);
+	storageShare->createIndexName(indexDesc.name.getString(), indexName);
 
 	CmdGen gen;
 	gen.gen("drop index %s.\"%s\"", schemaName, indexName);

Thread
bzr commit into mysql-6.0-falcon branch (cpowers:2790) Bug#38044Christopher Powers18 Aug