MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:February 3 2008 7:56pm
Subject:bk commit into 6.0 tree (jas:1.2795)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 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, 2008-02-03 14:55:44-05:00, jas@rowvwade. +3 -0
  Fix memory leak when rolling back a failed delete.  Also added
  conditional support for table check and repar.

  storage/falcon/Table.cpp@stripped, 2008-02-03 14:55:29-05:00, jas@rowvwade. +11 -3
    Fix memory leak when rolling back a failed delete.

  storage/falcon/ha_falcon.cpp@stripped, 2008-02-03 14:55:29-05:00, jas@rowvwade. +30 -0
    Make the server commands "check table" and "repair table"
    conditional until they are formally integrated.

  storage/falcon/ha_falcon.h@stripped, 2008-02-03 14:55:29-05:00, jas@rowvwade. +4 -0
    Define functions for table check and repair.

diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-01-30 17:44:10 -05:00
+++ b/storage/falcon/Table.cpp	2008-02-03 14:55:29 -05:00
@@ -1321,7 +1321,6 @@ void Table::deleteRecord(Transaction * t
 {
 	database->preUpdate();
 	Sync scavenge(&syncScavenge, "Table::deleteRecord");
-	//scavenge.lock(Shared);
 	Record *candidate = fetch(oldRecord->recordNumber);
 	checkAncestor(candidate, oldRecord);
 	RecordVersion *record;
@@ -1345,7 +1344,6 @@ void Table::deleteRecord(Transaction * t
 		}
 
 	record->state = recDeleted;
-	//record->setAgeGroup();
 	fireTriggers(transaction, PreDelete, oldRecord, NULL);
 
 	// Do any necessary cascading
@@ -1371,7 +1369,17 @@ void Table::deleteRecord(Transaction * t
 		record->state = recDeleted;
 	else
 		{
-		validateAndInsert(transaction, record);
+		try
+			{
+			validateAndInsert(transaction, record);
+			}
+		catch (...)
+			{
+			record->release();
+			
+			throw;
+			}
+			
 		transaction->addRecord(record);
 		}
 		
diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp	2008-01-30 01:58:03 -05:00
+++ b/storage/falcon/ha_falcon.cpp	2008-02-03 14:55:29 -05:00
@@ -44,6 +44,7 @@
 #include "BigInt.h"
 
 //#define NO_OPTIMIZE
+#define VALIDATE
 
 #ifndef MIN
 #define MIN(a,b)			((a <= b) ? (a) : (b))
@@ -498,6 +499,35 @@ int StorageInterface::close(void)
 	FALCON_CLOSE();
 
 	DBUG_RETURN(0);
+}
+
+
+int StorageInterface::check(THD* thd, HA_CHECK_OPT* check_opt)
+{
+#ifdef VALIDATE
+	DBUG_ENTER("StorageInterface::check");
+
+	if (storageConnection)
+		storageConnection->validate(0);
+		
+	DBUG_RETURN(0);
+#else
+	return HA_ADMIN_NOT_IMPLEMENTED;
+#endif
+}
+
+int StorageInterface::repair(THD* thd, HA_CHECK_OPT* check_opt)
+{
+#ifdef VALIDATE
+	DBUG_ENTER("StorageInterface::repair");
+	
+	if (storageConnection)
+		storageConnection->validate(VALIDATE_REPAIR);
+
+	DBUG_RETURN(0);
+#else
+	return HA_ADMIN_NOT_IMPLEMENTED;
+#endif
 }
 
 int StorageInterface::rnd_next(uchar *buf)
diff -Nrup a/storage/falcon/ha_falcon.h b/storage/falcon/ha_falcon.h
--- a/storage/falcon/ha_falcon.h	2008-01-21 15:27:15 -05:00
+++ b/storage/falcon/ha_falcon.h	2008-02-03 14:55:29 -05:00
@@ -95,9 +95,13 @@ public:
 	virtual void	update_create_info(HA_CREATE_INFO* create_info);
 	virtual const COND* cond_push(const COND* cond);
 	virtual int		optimize(THD* thd, HA_CHECK_OPT* check_opt);
+	virtual int		check(THD* thd, HA_CHECK_OPT* check_opt);
+	virtual int		repair(THD* thd, HA_CHECK_OPT* check_opt);
+	
 #ifdef TRUNCATE_ENABLED
 	virtual int		delete_all_rows(void);
 #endif
+
 	void			getDemographics(void);
 	int				createIndex(const char *schemaName, const char *tableName,
 					            KEY *key, int indexNumber);
Thread
bk commit into 6.0 tree (jas:1.2795)U-ROWVWADEjas3 Feb