List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:August 26 2009 3:45am
Subject:bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2771)
Bug#46670
View as plain text  
#At file:///home/cpowers/work/dev/dev-07/mysql/

 2771 Christopher Powers	2009-08-25
      Bug#46670 "ALTER TABLE crashes in StorageTableShare::haveIndexes()"
      
      Rewrote StorageTableShare::haveIndexes() to more effectively check for
      the need to remap Falcon indexes
      modified:
        storage/falcon/StorageTableShare.cpp
        storage/falcon/StorageTableShare.h
        storage/falcon/ha_falcon.cpp

per-file messages:
  storage/falcon/StorageTableShare.cpp
    Renamed haveIndexes() to remapNeeded()
    Improved remap-checking logic
  storage/falcon/StorageTableShare.h
    Renamed haveIndexes() to remapNeeded()
  storage/falcon/ha_falcon.cpp
    Renamed haveIndexes to remapNeeded()
=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2009-08-26 02:50:47 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2009-08-26 03:45:23 +0000
@@ -462,6 +462,8 @@ void StorageTableShare::deleteIndexes()
 		indexes = indexDesc->next;
 		delete indexDesc;
 		}
+	
+	indexCount = 0;
 }
 
 int StorageTableShare::numberIndexes()
@@ -572,11 +574,25 @@ int StorageTableShare::getIndexId(const 
 	return -1;
 }
 
-int StorageTableShare::haveIndexes(int numIndexes)
+int StorageTableShare::remapNeeded(int numIndexes)
 {
-	if (!indexes || numIndexes != indexCount)
+	// Server and Falcon mismatch
+
+	if (numIndexes != indexCount)
+		return true;
+
+	// Neither server nor Falcon have indexes
+	
+	if (!indexes && numIndexes == 0)
 		return false;
 	
+	// Both server and Falcon have indexes
+	
+	if (indexes && numIndexes > 0)
+		return false;
+	
+	// Index count is inconsistent with index state
+	
 	return true;
 }
 

=== modified file 'storage/falcon/StorageTableShare.h'
--- a/storage/falcon/StorageTableShare.h	2009-08-26 02:50:47 +0000
+++ b/storage/falcon/StorageTableShare.h	2009-08-26 03:45:23 +0000
@@ -146,7 +146,7 @@ public:
 	virtual int			renameTable(StorageConnection *storageConnection, const char* newName);
 	virtual uint64		getSequenceValue(int delta);
 	virtual int			setSequenceValue(uint64 value);
-	virtual int			haveIndexes(int numIndexes);
+	virtual int			remapNeeded(int numIndexes);
 	virtual const char*	cleanupFieldName(const char* name, char* buffer, int bufferLength, bool doubleQuotes);
 	virtual void		setTablePath(const char* path, bool tempTable);
 	virtual void		registerCollation(const char* collationName, void* arg);

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2009-08-26 02:50:47 +0000
+++ b/storage/falcon/ha_falcon.cpp	2009-08-26 03:45:23 +0000
@@ -2739,7 +2739,7 @@ int StorageInterface::setIndexes(TABLE *
 {
 	int ret = 0;
 	
-	if (!srvTable || !storageShare->haveIndexes(srvTable->s->keys))
+	if (!srvTable || !storageShare->remapNeeded(srvTable->s->keys))
 		return ret;
 
 	storageShare->lockIndexes(true);

Thread
bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2771)Bug#46670Christopher Powers26 Aug