List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:February 8 2008 5:47pm
Subject:bk commit into 6.0 tree (jas:1.2808)
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-08 12:46:47-05:00, jas@rowvwade. +2 -0
  Create a separate method (Table::treeFetch) to fetch
  a record from the record tree only, i.e. don't go to
  the disk if the record isn't in the record tree.

  storage/falcon/Table.cpp@stripped, 2008-02-08 12:46:37-05:00, jas@rowvwade. +27 -1
    Create a separate method (Table::treeFetch) to fetch
    a record from the record tree only, i.e. don't go to
    the disk if the record isn't in the record tree.

  storage/falcon/Table.h@stripped, 2008-02-08 12:46:38-05:00, jas@rowvwade. +2 -0
    Create a separate method (Table::treeFetch) to fetch
    a record from the record tree only, i.e. don't go to
    the disk if the record isn't in the record tree.

diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-02-08 11:54:13 -05:00
+++ b/storage/falcon/Table.cpp	2008-02-08 12:46:37 -05:00
@@ -887,6 +887,32 @@ Record* Table::fetch(int32 recordNumber)
 		}
 }
 
+Record* Table::treeFetch(int32 recordNumber)
+{
+	Sync sync (&syncObject, "Table::treeFetch");
+	sync.lock (Shared);
+
+	if (!records)
+		return NULL;
+		
+	RecordSection *section = records;
+	int id = recordNumber;
+	
+	while (section->base)
+		{
+		int slot = id / section->base;
+		id = id % section->base;
+
+		if (slot >= RECORD_SLOTS)
+			return NULL;
+
+		if ( !(section = ((RecordGroup*) section)->records[slot]) )
+			return NULL;
+		}
+	
+	return section->fetch(id);
+}
+
 Record* Table::rollbackRecord(RecordVersion * recordToRollback)
 {
 #ifdef CHECK_RECORD_ACTIVITY
@@ -3548,7 +3574,7 @@ bool Table::validateUpdate(int32 recordN
 	if (deleting)
 		return false;
 
-	Record *record = fetch(recordNumber);
+	Record *record = treeFetch(recordNumber);
 	Record *initial = record;
 	
 	while (record)
diff -Nrup a/storage/falcon/Table.h b/storage/falcon/Table.h
--- a/storage/falcon/Table.h	2008-02-05 16:50:30 -05:00
+++ b/storage/falcon/Table.h	2008-02-08 12:46:38 -05:00
@@ -258,6 +258,8 @@ public:
 
 protected:
 	const char		*type;
+public:
+	Record* treeFetch(int32 recordNumber);
 };
 
 #endif // !defined(AFX_TABLE_H__02AD6A42_A433_11D2_AB5B_0000C01D2301__INCLUDED_)
Thread
bk commit into 6.0 tree (jas:1.2808)U-ROWVWADEjas8 Feb