List:Commits« Previous MessageNext Message »
From:klewis Date:January 31 2008 3:35pm
Subject:bk commit into 6.0 tree (klewis:1.2785)
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-01-31 09:34:27-06:00, klewis@klewis-mysql. +2 -0
  Latest changes from falcon team tree

  storage/falcon/Section.cpp@stripped, 2008-01-31 09:34:05-06:00, klewis@klewis-mysql. +28 -3
    Latest changes from falcon team tree

  storage/falcon/Table.cpp@stripped, 2008-01-31 09:34:09-06:00, klewis@klewis-mysql. +7 -1
    Latest changes from falcon team tree

diff -Nrup a/storage/falcon/Section.cpp b/storage/falcon/Section.cpp
--- a/storage/falcon/Section.cpp	2008-01-30 01:35:24 -06:00
+++ b/storage/falcon/Section.cpp	2008-01-31 09:34:05 -06:00
@@ -40,6 +40,7 @@
 #include "SRLOverflowPages.h"
 #include "Transaction.h"
 #include "PageInventoryPage.h"
+#include "SQLError.h"
 
 //#define STOP_PAGE	114
 //#define STOP_SECTION	40
@@ -1245,18 +1246,42 @@ void Section::redoSectionPage(Dbb *dbb, 
 
 int32 Section::getSectionRoot()
 {
-	Bdb *bdb = getSectionPage (dbb, SECTION_ROOT, sectionId / dbb->pagesPerSection, Shared, NO_TRANSACTION);
+	Bdb *bdb = getSectionPage(dbb, SECTION_ROOT, sectionId / dbb->pagesPerSection, Shared, NO_TRANSACTION);
 	BDB_HISTORY(bdb);
 	SectionPage *sectionPage = (SectionPage*) bdb->buffer;
-	root = sectionPage->pages [sectionId % dbb->pagesPerSection];
+	root = sectionPage->pages[sectionId % dbb->pagesPerSection];
 	bdb->release(REL_HISTORY);
 
+	if (root == 0)
+		{
+		if (!dbb->serialLog->recovering)
+			throw SQLError(DATABASE_DAMAGED, "Missing section root for section %d/%d\n", sectionId, dbb->tableSpaceId);
+
+		// Missing root page -- make a new one
+		
+		Bdb *sectionBdb = dbb->allocPage(PAGE_sections, NO_TRANSACTION);
+		BDB_HISTORY(sectionBdb);
+		root = sectionBdb->pageNumber;
+		SectionPage *page = (SectionPage*) sectionBdb->buffer;
+		page->section = sectionId;
+		sectionBdb->release(REL_HISTORY);
+		
+		// Register new root page
+			
+		bdb = getSectionPage(dbb, SECTION_ROOT, sectionId / dbb->pagesPerSection, Exclusive, NO_TRANSACTION);
+		BDB_HISTORY(bdb);
+		sectionPage = (SectionPage*) bdb->buffer;
+		sectionPage->pages[sectionId % dbb->pagesPerSection] = root;
+		bdb->release(REL_HISTORY);
+		}
+
+		
 	return root;
 }
 
 void Section::redoRecordLocatorPage(int sequence, int32 pageNumber, bool isPostFlush)
 {
-	Bdb *bdb = getSectionPage (sequence / dbb->pagesPerSection, Exclusive, NO_TRANSACTION);
+	Bdb *bdb = getSectionPage(sequence / dbb->pagesPerSection, Exclusive, NO_TRANSACTION);
 	BDB_HISTORY(bdb);
 	SectionPage *sectionPage = (SectionPage*) bdb->buffer;
 	int slot = sequence % dbb->pagesPerSection;
diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-01-30 01:36:16 -06:00
+++ b/storage/falcon/Table.cpp	2008-01-31 09:34:09 -06:00
@@ -1189,6 +1189,9 @@ void Table::update(Transaction * transac
 		
 		if (record)
 			{
+			if (record->priorVersion)
+				record->priorVersion->setSuperceded(false);
+								
 			if (record->state == recLock)
 				record->deleteData();
 
@@ -3034,6 +3037,9 @@ void Table::update(Transaction * transac
 	
 		if (record)
 			{
+			if (record->priorVersion)
+				record->priorVersion->setSuperceded(false);
+								
 			if (record->state == recLock)
 				record->deleteData();
 
@@ -3526,7 +3532,7 @@ bool Table::validateUpdate(int32 recordN
 		
 		Transaction *transaction = record->getTransaction();
 		
-		if (transaction && transaction->state == Committed)
+		if (!transaction || transaction->state == Committed)
 			{
 			record->release();
 			
Thread
bk commit into 6.0 tree (klewis:1.2785)klewis31 Jan