List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:October 1 2008 2:57am
Subject:bzr push into mysql-6.0-falcon-team branch (cpowers:2842 to 2843)
View as plain text  
 2843 Christopher Powers	2008-09-30
      Fixed atomic decrement of reference counts in Transaction and DeferredIndex
      Enabled online add index for indexes having non-nullable columns
modified:
  storage/falcon/DeferredIndex.cpp
  storage/falcon/DeferredIndex.h
  storage/falcon/DeferredIndexWalker.cpp
  storage/falcon/Transaction.cpp
  storage/falcon/Transaction.h
  storage/falcon/WalkDeferred.cpp
  storage/falcon/ha_falcon.cpp

 2842 Vladislav Vaintroub	2008-09-29
      Bug#37226 -  Explicit call of my_thread_init() on Windows for every 
      new thread.
      Bug#33031 - app linked to libmysql.lib crash if run as service in 
      vista under localsystem.
      
      This patch completely removes DllMain() from the libmysql.dll in 6.0
      eliminating explicit my_thread_init()/WSAStartup() during dll load
      or thread attach. 
      
      This patch is slightly different from what is done in 5.0/5.1.
      The difference is that there is no way that to reactivate DllMain() 
      code (in 5.x it is possible  with LIBMYSQL_DLLINIT environment variable)
removed:
  libmysql/dll.c
modified:
  libmysql/CMakeLists.txt
  libmysql/Makefile.am

=== modified file 'storage/falcon/DeferredIndex.cpp'
--- a/storage/falcon/DeferredIndex.cpp	2008-09-10 19:51:03 +0000
+++ b/storage/falcon/DeferredIndex.cpp	2008-10-01 02:56:30 +0000
@@ -840,7 +840,7 @@ void DeferredIndex::detachTransaction(vo
 	else
 		sync.unlock();
 
-	//releaseRef();
+	//release();
 }
 
 void DeferredIndex::chill(Dbb *dbb)
@@ -882,13 +882,9 @@ void DeferredIndex::addRef()
 	INTERLOCKED_INCREMENT (useCount);
 }
 
-void DeferredIndex::releaseRef()
+void DeferredIndex::release()
 {
-	ASSERT(useCount > 0);
-	
-	INTERLOCKED_DECREMENT(useCount);
-
-	if (useCount == 0)
+	if (INTERLOCKED_DECREMENT(useCount) == 0)
 		delete this;
 }
 

=== modified file 'storage/falcon/DeferredIndex.h'
--- a/storage/falcon/DeferredIndex.h	2008-07-25 18:07:24 +0000
+++ b/storage/falcon/DeferredIndex.h	2008-10-01 02:56:30 +0000
@@ -125,7 +125,7 @@ public:
 	uint64			virtualOffsetAtEnd;
 	SerialLogWindow	*window;
 	void			addRef();
-	void			releaseRef();
+	void			release();
 };
 
 #endif

=== modified file 'storage/falcon/DeferredIndexWalker.cpp'
--- a/storage/falcon/DeferredIndexWalker.cpp	2008-09-10 19:51:03 +0000
+++ b/storage/falcon/DeferredIndexWalker.cpp	2008-10-01 02:56:30 +0000
@@ -96,7 +96,7 @@ void DeferredIndexWalker::initialize(Def
 DeferredIndexWalker::~DeferredIndexWalker(void)
 {
 	if (deferredIndex)
-		deferredIndex->releaseRef();
+		deferredIndex->release();
 }
 
 DINode* DeferredIndexWalker::next(void)

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-09-10 19:51:03 +0000
+++ b/storage/falcon/Transaction.cpp	2008-10-01 02:56:30 +0000
@@ -1076,14 +1076,10 @@ void Transaction::addRef()
 	INTERLOCKED_INCREMENT(useCount);
 }
 
-int Transaction::release()
+void Transaction::release()
 {
-	int count = INTERLOCKED_DECREMENT(useCount);
-
-	if (count == 0)
+	if (INTERLOCKED_DECREMENT(useCount) == 0)
 		delete this;
-
-	return count;
 }
 
 int Transaction::createSavepoint()
@@ -1317,7 +1313,7 @@ void Transaction::add(DeferredIndex* def
 	Sync sync(&syncDeferredIndexes, "Transaction::add");
 	sync.lock(Exclusive);
 
-	deferredIndex->addRef();
+//	deferredIndex->addRef(); // KELLY fix for Deferred Index memory leak
 	deferredIndex->nextInTransaction = deferredIndexes;
 	deferredIndexes = deferredIndex;
 	deferredIndexCount++;
@@ -1504,7 +1500,7 @@ void Transaction::releaseDeferredIndexes
 		ASSERT(deferredIndex->transaction == this);
 		deferredIndexes = deferredIndex->nextInTransaction;
 		deferredIndex->detachTransaction();
-		deferredIndex->releaseRef();
+		deferredIndex->release();
 		deferredIndexCount--;
 		}
 }
@@ -1520,7 +1516,7 @@ void Transaction::releaseDeferredIndexes
 			{
 			*ptr = deferredIndex->nextInTransaction;
 			deferredIndex->detachTransaction();
-			deferredIndex->releaseRef();
+			deferredIndex->release();
 			--deferredIndexCount;
 			}
 		else

=== modified file 'storage/falcon/Transaction.h'
--- a/storage/falcon/Transaction.h	2008-09-10 04:02:07 +0000
+++ b/storage/falcon/Transaction.h	2008-10-01 02:56:30 +0000
@@ -99,7 +99,7 @@ public:
 	void		prepare(int xidLength, const UCHAR *xid);
 	void		rollback();
 	void		commit();
-	int			release();
+	void		release();
 	void		addRef();
 	void		waitForTransaction();
 	bool		waitForTransaction (TransId transId);

=== modified file 'storage/falcon/WalkDeferred.cpp'
--- a/storage/falcon/WalkDeferred.cpp	2008-07-25 18:07:24 +0000
+++ b/storage/falcon/WalkDeferred.cpp	2008-10-01 02:56:30 +0000
@@ -26,7 +26,7 @@ WalkDeferred::WalkDeferred(DeferredIndex
 
 WalkDeferred::~WalkDeferred(void)
 {
-	deferredIndex->releaseRef();
+	deferredIndex->release();
 }
 
 Record* WalkDeferred::getNext(bool lockForUpdate)

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-09-16 17:58:49 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-10-01 02:56:30 +0000
@@ -2141,10 +2141,10 @@ int StorageInterface::check_if_supported
 	DBUG_ENTER("StorageInterface::check_if_supported_alter");
 	tempTable = (create_info->options & HA_LEX_CREATE_TMP_TABLE) ? true : false;
 	HA_ALTER_FLAGS supported;
-	supported = supported | HA_ADD_INDEX | HA_DROP_INDEX | HA_ADD_UNIQUE_INDEX | HA_DROP_UNIQUE_INDEX;
-						/**
-						| HA_ADD_COLUMN | HA_COLUMN_STORAGE | HA_COLUMN_FORMAT;
-						**/
+	supported = supported | HA_ADD_INDEX | HA_DROP_INDEX | HA_ADD_UNIQUE_INDEX | HA_DROP_UNIQUE_INDEX | HA_ADD_COLUMN;
+							/**
+								| HA_COLUMN_STORAGE | HA_COLUMN_FORMAT;
+							 **/
 	HA_ALTER_FLAGS notSupported = ~(supported);
 	
 #ifndef ONLINE_ALTER
@@ -2186,6 +2186,7 @@ int StorageInterface::check_if_supported
 	
 	if (alter_flags->is_set(HA_ADD_INDEX) || alter_flags->is_set(HA_ADD_UNIQUE_INDEX))
 		{
+#if 0
 		for (unsigned int n = 0; n < altered_table->s->keys; n++)
 			{
 			if (n != altered_table->s->primary_key)
@@ -2214,6 +2215,7 @@ int StorageInterface::check_if_supported
 						}
 				}
 			}
+#endif
 		}
 		
 	if (alter_flags->is_set(HA_DROP_INDEX) || alter_flags->is_set(HA_DROP_UNIQUE_INDEX))

Thread
bzr push into mysql-6.0-falcon-team branch (cpowers:2842 to 2843) Christopher Powers1 Oct