List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:July 20 2007 4:01pm
Subject:bk commit into 6.0-falcon tree (jas:1.2648)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-falcon repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-07-20 12:01:22-04:00, jas@rowvwade. +2 -0
  Fix record reference problem during record deadlock processes.

  storage/falcon/Record.h@stripped, 2007-07-20 12:01:14-04:00, jas@rowvwade. +2 -2
    Minor edit for style.

  storage/falcon/StorageDatabase.cpp@stripped, 2007-07-20 12:01:14-04:00, jas@rowvwade. +11 -14
    Fix record reference problem during record deadlock processes.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.28/storage/falcon/Record.h	2007-07-20 12:01:49 -04:00
+++ 1.29/storage/falcon/Record.h	2007-07-20 12:01:49 -04:00
@@ -95,6 +95,8 @@
 	int				getEncodedSize();
 	void			setAgeGroup();
 	void			deleteData(void);
+	void			printRecord(const char* header);
+	void			validateData(void);
 
 	Record (Table *table, Format *recordFormat);
 	Record(Table *table, int32 recordNumber, Stream *stream);
@@ -126,8 +128,6 @@
 #ifdef CHECK_RECORD_ACTIVITY
 	UCHAR		active;					// this is for debugging only
 #endif
-	void printRecord(const char* header);
-	void validateData(void);
 };
 
 #endif // !defined(AFX_RECORD_H__02AD6A50_A433_11D2_AB5B_0000C01D2301__INCLUDED_)

--- 1.78/storage/falcon/StorageDatabase.cpp	2007-07-20 12:01:49 -04:00
+++ 1.79/storage/falcon/StorageDatabase.cpp	2007-07-20 12:01:49 -04:00
@@ -245,7 +245,7 @@
 			if (!candidate)
 				return StorageErrorRecordNotFound;
 
-			Record *record = (lockForUpdate)
+			record = (lockForUpdate)
 			               ? table->fetchForUpdate(transaction, candidate)
 			               : candidate->fetchVersion(transaction);
 			
@@ -274,6 +274,9 @@
 		if (candidate)
 			candidate->release();
 
+		if (record && record != candidate)
+			record->release();
+			
 		storageConnection->setErrorText(&exception);
 		
 		if (exception.getSqlcode() == UPDATE_CONFLICT)
@@ -293,12 +296,11 @@
 	try
 		{
 		candidate = NULL;
-		Record *candidate = table->fetch(recordNumber);
+		candidate = table->fetch(recordNumber);
 		
 		if (!candidate)
 			return StorageErrorRecordNotFound;
 
-		//Record *record = candidate->fetchVersion(connection->getTransaction());
 		Record *record = (lockForUpdate)
 		               ? table->fetchForUpdate(transaction, candidate)
 		               : candidate->fetchVersion(transaction);
@@ -345,7 +347,8 @@
 	Connection *connection = storageConnection->connection;
 	Table *table = storageTable->share->table;
 	Transaction *transaction = connection->getTransaction();
-
+	Record *candidate;
+	
 	try
 		{
 		Bitmap *bitmap = (Bitmap*) recordBitmap;
@@ -357,12 +360,11 @@
 			if (recordNumber < 0)
 				return StorageErrorRecordNotFound;
 				
-			Record *candidate = table->fetch(recordNumber);
+			candidate = table->fetch(recordNumber);
 			++recordNumber;
 			
 			if (candidate)
 				{
-				//Record *record = candidate->fetchVersion(connection->getTransaction());
 				Record *record = (lockForUpdate) 
 				               ? table->fetchForUpdate(transaction, candidate)
 				               : candidate->fetchVersion(transaction);
@@ -377,14 +379,6 @@
 						candidate->release();
 						}
 					
-					/***	
-					if (lockForUpdate)
-						{
-						if (!lockRecord(storageConnection, table, record))
-							return StorageErrorUpdateConflict;
-						}
-					***/
-					
 					storageTable->setRecord(record, lockForUpdate);
 					
 					return recordNumber;
@@ -397,6 +391,9 @@
 		}
 	catch (SQLException& exception)
 		{
+		if (candidate)
+			candidate->release();
+			
 		storageConnection->setErrorText(&exception);
 		
 		if (exception.getSqlcode() == UPDATE_CONFLICT)
Thread
bk commit into 6.0-falcon tree (jas:1.2648)U-ROWVWADEjas20 Jul