From: Date: July 14 2008 7:28am Subject: commit into mysql-6.0-falcon branch (cpowers:2741) Bug#38043 List-Archive: http://lists.mysql.com/commits/49643 X-Bug: 38043 Message-Id: <20080714052802.8B6661DB0718@xeno.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #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