List:Commits« Previous MessageNext Message »
From:Kevin Lewis Date:June 24 2009 10:18pm
Subject:bzr push into mysql-6.0-falcon-team branch (kevin.lewis:2743 to 2745)
Bug#43650
View as plain text  
 2745 Kevin Lewis	2009-06-24
      Bug#43650 - The server calls StorageInterface::rnd_pos() when it has a list of records previously read and sorted and it wants to read them a final time.  If the isolation mode is read-committed, the call to fetchVersion will return NULL if the currently committed version is deleted.  This means it was deleted during the transaction.  Since the transaction was able to find a visible version of the record before, that visible version MUST still be around.  So the only reason that fetchVersion would return NULL is if the current visible version is deleted.  In repeatable-read, fetchVersion would return that previous visible record.
      
      So if fetchVersion or fetchForUpdate returns NULL to StorageDatabase::fetch(), instead of returning 
         StorageErrorRecordNotFound - HA_KEY_NOT_FOUND - "can't find record",
      it should return 
         StorageErrorRecordDeleted - HA_ERR_RECORD_DELETED
      so that the server will ignore this record and go  on to the nexxt record.

    modified:
      storage/falcon/StorageDatabase.cpp
      storage/falcon/StorageTableShare.h
      storage/falcon/ha_falcon.cpp
 2744 Kevin Lewis	2009-06-24
      Code Cleanup
     @ storage/falcon/ha_falcon.cpp
        Use Unix EOL.  Use (c).
     @ storage/falcon/ha_falcon.h
        cleanup

    modified:
      storage/falcon/ha_falcon.cpp
      storage/falcon/ha_falcon.h
 2743 Olav.Sandstaa@stripped	2009-06-24 [merge]
      Merging

    modified:
      storage/falcon/Record.cpp
      storage/falcon/Record.h
      storage/falcon/RecordVersion.cpp
      storage/falcon/RecordVersion.h
      storage/falcon/SRLUpdateRecords.cpp
      storage/falcon/Table.cpp
      storage/falcon/Transaction.cpp
      storage/falcon/TransactionState.h
      storage/falcon/ha_falcon.cpp
      storage/falcon/ha_falcon.h
=== modified file 'storage/falcon/StorageDatabase.cpp'
--- a/storage/falcon/StorageDatabase.cpp	2009-06-03 01:36:57 +0000
+++ b/storage/falcon/StorageDatabase.cpp	2009-06-24 22:17:25 +0000
@@ -375,7 +375,7 @@ int StorageDatabase::fetch(StorageConnec
 			if (!lockForUpdate)
 				candidate->release(REC_HISTORY);
 			
-			return StorageErrorRecordNotFound;
+			return StorageErrorRecordDeleted;
 			}
 		
 		if (!lockForUpdate && record != candidate)

=== modified file 'storage/falcon/StorageTableShare.h'
--- a/storage/falcon/StorageTableShare.h	2009-04-27 16:43:53 +0000
+++ b/storage/falcon/StorageTableShare.h	2009-06-24 22:17:25 +0000
@@ -120,7 +120,8 @@ enum StorageError {
 	StorageErrorDeviceFull			= -110,
 	StorageErrorTableSpaceDataFileExist	= -111,
 	StorageErrorIOErrorSerialLog	= -112,
-	StorageErrorInternalError		= -113
+	StorageErrorInternalError		= -113,
+	StorageErrorRecordDeleted		= -114		// Record requested has been deleted
 	};
 	
 static const int StoreErrorIndexShift	= 10;

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2009-06-24 18:25:44 +0000
+++ b/storage/falcon/ha_falcon.cpp	2009-06-24 22:17:25 +0000
@@ -1,4 +1,4 @@
-/* Copyright ∩┐, Inc.
+/* Copyright (c) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2213,6 +2213,10 @@ int StorageInterface::getMySqlError(int 
 			DBUG_PRINT("info", ("StorageErrorIOErrorSerialLog"));
 			return (HA_ERR_LOGGING_IMPOSSIBLE);
 
+		case StorageErrorRecordDeleted:
+			DBUG_PRINT("info", ("StorageErrorRecordDeleted"));
+			return (HA_ERR_RECORD_DELETED);
+
 		default:
 			DBUG_PRINT("info", ("Unknown Falcon Error"));
 			return (200 - storageError);
@@ -3006,10 +3010,10 @@ void StorageInterface::encodeRecord(ucha
 
 		if (updateFlag && !bitmap_is_set(table->write_set, field->field_index))
 			{
-			// Online ALTER ADD COLUMN may have extended the default record format
-			// of the table beyond that of the existing rows. If the current field
-			// is not defined for this record, set the field to NULL.
-			
+			// Online ALTER ADD COLUMN may have extended the default record format
+			// of the table beyond that of the existing rows. If the current field
+			// is not defined for this record, set the field to NULL.
+			
 			if (id >= recordMaxId)
 				dataStream.encodeNull();
 			else
@@ -3221,10 +3225,10 @@ void StorageInterface::decodeRecord(ucha
 
 		Field *field = NULL;
 		
-		// Get the field definition id from the format associated with the current record.
-		// If the field is undefined for this record, then get the field id from the
-		// default table format and set the field to NULL.
-		
+		// Get the field definition id from the format associated with the current record.
+		// If the field is undefined for this record, then get the field id from the
+		// default table format and set the field to NULL.
+		
 		if (id < maxId)
 			field = fieldMap[recordFormat->fieldId];
 		else

=== modified file 'storage/falcon/ha_falcon.h'
--- a/storage/falcon/ha_falcon.h	2009-06-24 00:34:01 +0000
+++ b/storage/falcon/ha_falcon.h	2009-06-24 21:28:30 +0000
@@ -162,10 +162,10 @@ public:
 	void			decodeRecord(uchar *buf);
 	void			unlockTable(void);
 	void			checkBinLog(void);
-	int				scanRange(const key_range *startKey,
+	int			scanRange(const key_range *startKey,
 					  const key_range *endKey,
 					  bool eqRange);
-	int				fillMrrBitmap();
+	int			fillMrrBitmap();
 	void			mapFields(TABLE *table);
 	void			unmapFields(void);
 

Attachment: [text/bzr-bundle] bzr/kevin.lewis@sun.com-20090624221725-tfcuxzwns2ikjkb5.bundle
Thread
bzr push into mysql-6.0-falcon-team branch (kevin.lewis:2743 to 2745)Bug#43650Kevin Lewis25 Jun