List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:July 14 2008 7:28am
Subject:commit into mysql-6.0-falcon branch (cpowers:2741) Bug#38043
View as plain text  
#At file:///home/cpowers/work/dev/dev-02/mysql/

 2741 Christopher Powers	2008-07-14
      Bug#38043: Deadlock between server and falcon
      
      Temporarily disable online alter until StorageTableShare::getIndex() is fixed.
modified:
  storage/falcon/StorageTableShare.cpp
  storage/falcon/ha_falcon.cpp

per-file comments:
  storage/falcon/StorageTableShare.cpp
    Temporarily disable online alter until StorageTableShare::getIndex() is fixed.
  storage/falcon/ha_falcon.cpp
    Temporarily disable online alter until StorageTableShare::getIndex() is fixed.
=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2008-07-09 10:23:27 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2008-07-14 05:27:57 +0000
@@ -38,7 +38,7 @@
 static const char *DB_ROOT				= ".fts";
 
 #ifndef ONLINE_ALTER
-#define ONLINE_ALTER
+//#define ONLINE_ALTER
 #endif
 
 #if defined(_WIN32) && MYSQL_VERSION_ID < 0x50100
@@ -283,16 +283,26 @@
 
 StorageIndexDesc* StorageTableShare::getIndex(int indexCount, int indexId,
StorageIndexDesc* indexDesc)
 {
-	// Rebuild array if indexes have been added or dropped. Assume
StorageTableShare::lock(exclusive).
+	// Rebuild array if indexes have been added or dropped
 	
 #ifdef ONLINE_ALTER
+
+	// TODO: This does not work. It should be done at the time of index creation
+
 	if (indexes && (numberIndexes != indexCount))
 		{
+		Sync sync(syncObject, "StorageTableShare::getIndex");
+		sync.lock(Exclusive);
+		StorageIndexDesc **oldIndexes = indexes;
+		StorageIndexDesc **newIndexes = new StorageIndexDesc*[indexCount];
+		memset(newIndexes, 0, indexCount * sizeof(StorageIndexDesc*));
+		
 		for (int n = 0; n < numberIndexes; ++n)
-			delete indexes[n];
-			
-		delete [] indexes;
-		indexes = NULL;
+			newIndexes[n] = indexes[n];
+		
+		indexes = newIndexes;
+		numberIndexes = indexCount;
+		delete [] oldIndexes;
 		}
 #endif
 	

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-07-09 10:23:27 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-07-14 05:27:57 +0000
@@ -54,7 +54,7 @@
 #endif
 
 #ifndef ONLINE_ALTER
-#define ONLINE_ALTER
+//#define ONLINE_ALTER
 #endif
 
 #ifdef DEBUG_BACKLOG

Thread
commit into mysql-6.0-falcon branch (cpowers:2741) Bug#38043Christopher Powers14 Jul