MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:April 2 2009 10:36pm
Subject:bzr commit into mysql-6.0-falcon-team branch (vvaintroub:3096)
View as plain text  
#At file:///G:/bzr/mysql-6.0-falcon-team/ based on revid:kevin.lewis@stripped

 3096 Vladislav Vaintroub	2009-04-03
      Preparation to change multisegment format and increment index version:
      remove legacy INDEX_VERSION_0. It is not used in Falcon databases and
      removing references to it will make code more clear and changes simpler.
     @ storage/falcon/Database.cpp
        Simplify code. Remove conditions that check for unsupported versions.
        Falcon does not run with ODS < 2.3 (there is a already check in Dbb.cpp 
        for that), so we can safely assume serial log (2.1) is supported.
     @ storage/falcon/Dbb.cpp
        INDEX_VERSION_1->INDEX_CURRENT_VERSION
        Eliminate INDEX_VERSION_0
     @ storage/falcon/Dbb.h
        remove enableSerialLog - not used anymore
     @ storage/falcon/Index.cpp
        Remove index version  switch/case constructs.
        Desupport INDEX_VERSION_0
     @ storage/falcon/IndexPage.cpp
        Remove obsolete Index version parameter from SRLIndexPage::append
     @ storage/falcon/IndexPage.h
        Add Index* parameter to logIndexPage - just in case we will ever use index version 
        in recovery, it must be correctly set.
     @ storage/falcon/IndexRootPage.cpp
        Add Index* parameter to logIndexPage it helps correctly set index version 
        in serial log (just in case we'll ever use it)
     @ storage/falcon/RepositoryVolume.cpp
        use Index2RootPage functions directly for RepositoryVolume
     @ storage/falcon/SRLCreateIndex.cpp
        remove INDEX_VERSION_0
     @ storage/falcon/SRLDeleteIndex.cpp
        Remove INDEX_VERSION_0
     @ storage/falcon/SRLIndexPage.cpp
        Remove INDEX_VERSION_0
     @ storage/falcon/SRLUpdateIndex.cpp
        Remove INDEX_VERSION_0

    modified:
      storage/falcon/Database.cpp
      storage/falcon/Dbb.cpp
      storage/falcon/Dbb.h
      storage/falcon/Index.cpp
      storage/falcon/IndexPage.cpp
      storage/falcon/IndexPage.h
      storage/falcon/IndexRootPage.cpp
      storage/falcon/RepositoryVolume.cpp
      storage/falcon/SRLCreateIndex.cpp
      storage/falcon/SRLDeleteIndex.cpp
      storage/falcon/SRLIndexPage.cpp
      storage/falcon/SRLUpdateIndex.cpp
=== modified file 'storage/falcon/Database.cpp'
--- a/storage/falcon/Database.cpp	2009-04-02 06:26:04 +0000
+++ b/storage/falcon/Database.cpp	2009-04-02 22:36:19 +0000
@@ -748,31 +748,24 @@ void Database::openDatabase(const char *
 		
 	if (serialLog)
 		{
-		if (COMBINED_VERSION(dbb->odsVersion, dbb->odsMinorVersion) >= VERSION_SERIAL_LOG)
-			{
-			if (dbb->logLength)
-				serialLog->copyClone(dbb->logRoot, dbb->logOffset, dbb->logLength);
-				
-			serialLog->open(dbb->logRoot, false);
+		ASSERT (COMBINED_VERSION(dbb->odsVersion, dbb->odsMinorVersion) >= VERSION_SERIAL_LOG);
 
-			try 
-				{
-				serialLog->recover();
-				}
-			catch(SQLError &e)
-				{
-				throw SQLError(RECOVERY_ERROR, "Recovery failed: %s",e.getText());
-				}
+		if (dbb->logLength)
+			serialLog->copyClone(dbb->logRoot, dbb->logOffset, dbb->logLength);
 				
-			tableSpaceManager->postRecovery();
-			serialLog->start();
+		serialLog->open(dbb->logRoot, false);
+
+		try 
+			{
+			serialLog->recover();
 			}
-		else
+		catch(SQLError &e)
 			{
-			dbb->enableSerialLog();
-			serialLog->open(dbb->logRoot, true);
-			serialLog->start();
+			throw SQLError(RECOVERY_ERROR, "Recovery failed: %s",e.getText());
 			}
+				
+		tableSpaceManager->postRecovery();
+		serialLog->start();
 		}
 
 	sequence = dbb->sequence;

=== modified file 'storage/falcon/Dbb.cpp'
--- a/storage/falcon/Dbb.cpp	2009-04-02 06:26:04 +0000
+++ b/storage/falcon/Dbb.cpp	2009-04-02 22:36:19 +0000
@@ -29,7 +29,6 @@
 #include "Section.h"
 #include "Hdr.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "BDB.h"
 #include "DataPage.h"
 #include "DataOverflowPage.h"
@@ -82,7 +81,7 @@ Dbb::Dbb(Database *dbase) : sectionsMute
 	shadows = NULL;
 	highPage = 0;
 	//recovering = false;
-	defaultIndexVersion = INDEX_VERSION_1;
+	defaultIndexVersion = INDEX_CURRENT_VERSION;
 	tableSpaceSectionId = 0;
 	tableSpaceId = 0;
 	noLog = false;
@@ -406,23 +405,7 @@ int32 Dbb::findNextRecord(Section *secti
 
 int32 Dbb::createIndex(TransId transId, int indexVersion)
 {
-	int indexId;
-	
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			indexId = Index2RootPage::createIndex(this, transId);
-			break;
-		
-		case INDEX_VERSION_1:
-			indexId = IndexRootPage::createIndex(this, transId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
-
-	return indexId;
+	return  IndexRootPage::createIndex(this, transId);
 }
 
 bool Dbb::addIndexEntry(int32 indexId, int indexVersion, IndexKey *key, int32 recordNumber, TransId transId)
@@ -431,22 +414,9 @@ bool Dbb::addIndexEntry(int32 indexId, i
 	if (recordNumber == STOP_RECORD)
 		++debug;
 #endif
-	bool result;
-	
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			result = Index2RootPage::addIndexEntry (this, indexId, key, recordNumber, transId);
-			break;
-		
-		case INDEX_VERSION_1:
-			result = IndexRootPage::addIndexEntry (this, indexId, key, recordNumber, transId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
-		
+
+	bool result = IndexRootPage::addIndexEntry (this, indexId, key, recordNumber, transId);
+
 #ifdef STOP_RECORD
 	if (recordNumber == STOP_RECORD)
 		--debug;
@@ -498,7 +468,7 @@ Cache* Dbb::open(const char * fileName, 
 		throw SQLError (VERSION_ERROR, "Falcon on disk structure version %d.%d is not supported by version %d.%d server",
 						header.odsVersion, header.odsMinorVersion, ODS_VERSION, ODS_MINOR_VERSION);
 
-	if (header.odsVersion == ODS_VERSION2 && header.odsMinorVersion == ODS_MINOR_VERSION2)
+	if (header.odsVersion == ODS_VERSION2 && header.odsMinorVersion < ODS_MINOR_VERSION3)
 		throw SQLError (VERSION_ERROR, "Falcon on disk structure version %d.%d is not supported by version %d.%d server",
 						header.odsVersion, header.odsMinorVersion, ODS_VERSION, ODS_MINOR_VERSION);
 
@@ -525,19 +495,7 @@ Cache* Dbb::open(const char * fileName, 
 	logLength = headerPage->logLength;
 	tableSpaceSectionId = headerPage->tableSpaceSectionId;
 	database->serialLogBlockSize = headerPage->serialLogBlockSize;
-	
-	if (headerPage->haveIndexVersionNumber)
-		defaultIndexVersion = headerPage->defaultIndexVersionNumber;
-	else if (headerPage->odsVersion == ODS_VERSION2 && header.odsMinorVersion == ODS_MINOR_VERSION0)
-		{
-		defaultIndexVersion = INDEX_VERSION_0;
-		
-		if (!headerPage->sequenceSectionFixed && sequenceSectionId)
-			{
-			upgradeSequenceSection();
-			headerPage->sequenceSectionFixed = true;
-			}
-		}
+	defaultIndexVersion = headerPage->defaultIndexVersionNumber = INDEX_CURRENT_VERSION;
 
 	char root[256];
 	int len = headerPage->getHeaderVariable(this, hdrLogPrefix, sizeof(root), root);
@@ -561,6 +519,7 @@ void Dbb::setODSMinorVersion(int minor)
 	Hdr *headerPage = (Hdr*) bdb->buffer;
 	headerPage->odsMinorVersion = minor;
 	bdb->release(REL_HISTORY);
+	flush();
 }
 
 
@@ -568,20 +527,7 @@ void Dbb::deleteIndex(int32 indexId, int
 {
 	if (serialLog)
 		serialLog->logControl->deleteIndex.append(this, transId, indexId, indexVersion);
-	else
-		switch (indexVersion)
-			{
-			case INDEX_VERSION_0:
-				Index2RootPage::deleteIndex (this, indexId, transId);
-				break;
-			
-			case INDEX_VERSION_1:
-				IndexRootPage::deleteIndex (this, indexId, transId);
-				break;
-			
-			default:
-				ASSERT(false);
-			}
+	IndexRootPage::deleteIndex (this, indexId, transId);
 }
 
 void Dbb::setDebug()
@@ -708,22 +654,8 @@ void Dbb::validate(int optionMask)
 bool Dbb::deleteIndexEntry(int32 indexId, int indexVersion, IndexKey *key, int32 recordNumber, TransId transId)
 {
 	bool result;
-	
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			result = Index2RootPage::deleteIndexEntry (this, indexId, key, recordNumber, transId);
-			break;
-		
-		case INDEX_VERSION_1:
-			result = IndexRootPage::deleteIndexEntry (this, indexId, key, recordNumber, transId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
-
 
+	result = IndexRootPage::deleteIndexEntry (this, indexId, key, recordNumber, transId);
 	if (serialLog && !serialLog->recovering)
 		serialLog->logControl->indexDelete.append(this, indexId, indexVersion, key, recordNumber, transId);
 
@@ -1182,23 +1114,6 @@ void Dbb::reportStatistics()
 	priorFlushWrites = flushWrites;
 }
 
-void Dbb::enableSerialLog()
-{
-	Bdb *bdb = fetchPage(HEADER_PAGE, PAGE_header, Exclusive);
-	BDB_HISTORY(bdb);
-	bdb->mark(0);
-	Hdr *header = (Hdr*) bdb->buffer;
-	header->odsMinorVersion = ODS_MINOR_VERSION1;
-	
-	if (!header->haveIndexVersionNumber)
-		{
-		header->defaultIndexVersionNumber = INDEX_VERSION_0;
-		header->haveIndexVersionNumber = true;
-		}
-
-	bdb->release(REL_HISTORY);
-}
-
 void Dbb::dropDatabase()
 {
 	close();
@@ -1276,12 +1191,7 @@ void Dbb::analyseIndex(int32 indexId, in
 	IndexAnalysis indexAnalysis;
 	memset(&indexAnalysis, 0, sizeof(indexAnalysis));
 	
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_1:
-			IndexRootPage::analyzeIndex (this, indexId, &indexAnalysis);
-			break;
-		}
+	IndexRootPage::analyzeIndex (this, indexId, &indexAnalysis);
 	
 	stream->indent(indentation);
 	stream->format("Index %s (id %d, table space %d) %d levels\n", indexName, indexId, indexAnalysis.levels, tableSpaceId);

=== modified file 'storage/falcon/Dbb.h'
--- a/storage/falcon/Dbb.h	2009-04-02 06:26:04 +0000
+++ b/storage/falcon/Dbb.h	2009-04-02 22:36:19 +0000
@@ -115,7 +115,6 @@ public:
 
 	void	createSection(int32 sectionId, TransId transId);
 	void	dropDatabase();
-	void	enableSerialLog();
 	void	updateRecord(int32 sectionId, int32 recordId, Stream *stream, TransId transId, bool earlyWrite);
 	void	reportStatistics();
 	bool	hasDirtyPages();

=== modified file 'storage/falcon/Index.cpp'
--- a/storage/falcon/Index.cpp	2009-04-02 06:26:04 +0000
+++ b/storage/falcon/Index.cpp	2009-04-02 22:36:19 +0000
@@ -41,7 +41,6 @@
 #include "Bitmap.h"
 #include "Dbb.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "PStatement.h"
 #include "RSet.h"
 #include "WalkIndex.h"
@@ -512,20 +511,8 @@ Bitmap* Index::scanIndex(IndexKey* lowKe
 	if (rootPage == 0)
 		getRootPage();
 		
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			Index2RootPage::scanIndex (dbb, indexId, rootPage, lowKey, highKey, searchFlags, NO_TRANSACTION, bitmap);
-			break;
-		
-		case INDEX_VERSION_1:
-			IndexRootPage::scanIndex (dbb, indexId, rootPage, lowKey, highKey, searchFlags, NO_TRANSACTION, bitmap);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
-	
+	IndexRootPage::scanIndex (dbb, indexId, rootPage, lowKey, highKey, searchFlags, NO_TRANSACTION, bitmap);
+
 	if (transaction)
 		transaction->scanIndexCount++;
 		
@@ -546,16 +533,8 @@ IndexWalker* Index::positionIndex(IndexK
 	
 	if (rootPage == 0)
 		getRootPage();
-		
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_1:
-			IndexRootPage::positionIndex(dbb, indexId, rootPage, walkIndex);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
+	
+	IndexRootPage::positionIndex(dbb, indexId, rootPage, walkIndex);
 		
 	if (transaction && deferredIndexes.first)
 		{
@@ -701,14 +680,7 @@ void Index::garbageCollect(Record * leav
 				
 				if (!hit && !quiet)
 					{
-					/***
-					Log::log("Index deletion failed for record %d.%d of %s.%s.%s\n", 
-							 record->recordNumber, n, table->schemaName, table->name, (const char*) name);
-					***/
-					//int prevDebug = dbb->debug
-					//dbb->debug = DEBUG_PAGES | DEBUG_KEYS;
 					dbb->deleteIndexEntry(indexId, indexVersion, &key, record->recordNumber, TRANSACTION_ID(transaction));
-					//dbb->debug = prevDebug ;
 					}
 				}
 			}
@@ -795,14 +767,14 @@ void Index::rebuildIndex(Transaction *tr
 		damageCheck();
 
 	int oldId = indexId;
-	indexId = dbb->createIndex(TRANSACTION_ID(transaction), indexVersion);
+	indexId =dbb->createIndex(TRANSACTION_ID(transaction),INDEX_CURRENT_VERSION);
 
 	getRootPage();
 
 	PreparedStatement *statement = database->prepareStatement (
 		"update system.indexes set indexId=? where indexName=? and schema=? and tableName=?");
 	int n = 1;
-	statement->setInt (n++, INDEX_COMPOSITE (indexId, indexVersion));
+	statement->setInt (n++, INDEX_COMPOSITE (indexId, INDEX_CURRENT_VERSION));
 	statement->setString (n++, name);
 	statement->setString (n++, table->schemaName);
 	statement->setString (n++, table->name);

=== modified file 'storage/falcon/IndexPage.cpp'
--- a/storage/falcon/IndexPage.cpp	2009-03-13 19:57:32 +0000
+++ b/storage/falcon/IndexPage.cpp	2009-04-02 22:36:19 +0000
@@ -1191,7 +1191,7 @@ Btn* IndexPage::findInsertionPoint(Index
 	return findInsertionPoint(level, indexKey, recordNumber, expandedKey, nodes, bucketEnd);
 }
 
-void IndexPage::logIndexPage(Bdb *bdb, TransId transId)
+void IndexPage::logIndexPage(Bdb *bdb, TransId transId, Index *index)
 {
 	Dbb *dbb = bdb->dbb;
 
@@ -1202,10 +1202,15 @@ void IndexPage::logIndexPage(Bdb *bdb, T
 	ASSERT(bdb->lockType == Exclusive);
 	ASSERT(bdb->isDirty);
 	IndexPage *indexPage = (IndexPage*) bdb->buffer;
-	dbb->serialLog->logControl->indexPage.append(dbb, transId, INDEX_VERSION_1, bdb->pageNumber, indexPage->level, 
-												 indexPage->nextPage,  
-												 indexPage->length - OFFSET (IndexPage*, superNodes), 
-												 (const UCHAR*) indexPage->superNodes);
+	dbb->serialLog->logControl->indexPage.append(
+				dbb, 
+				transId,
+				index? index->indexVersion : INDEX_CURRENT_VERSION,
+				bdb->pageNumber,
+				indexPage->level,
+				indexPage->nextPage,
+				indexPage->length - OFFSET (IndexPage*, superNodes),
+				(const UCHAR*) indexPage->superNodes);
 }
  
 Btn* IndexPage::findInsertionPoint(int level, IndexKey* indexKey, int32 recordNumber, IndexKey* expandedKey, Btn* from, Btn* bucketEnd)

=== modified file 'storage/falcon/IndexPage.h'
--- a/storage/falcon/IndexPage.h	2009-03-02 18:36:32 +0000
+++ b/storage/falcon/IndexPage.h	2009-04-02 22:36:19 +0000
@@ -34,7 +34,7 @@ class Dbb;
 class Bdb;
 class Bitmap;
 class IndexKey;
-
+class Index;
 
 class IndexPage : public Page
 {
@@ -77,7 +77,7 @@ public:
 	static void		printNode(int i, IndexPage * page, int32 pageNumber, IndexNode & node, bool inversion = false);
 	static void		printNode(IndexPage *page, int32 pageNumber, Btn *node, bool inversion = false);
 	static int32	getRecordNumber(const UCHAR *ptr);
-	static void		logIndexPage (Bdb *bdb, TransId transId);
+	static void		logIndexPage (Bdb *bdb, TransId transId, Index* index);
 
 	int32	unused[2]; // used to be parent and prior pages
 	int32	nextPage;

=== modified file 'storage/falcon/IndexRootPage.cpp'
--- a/storage/falcon/IndexRootPage.cpp	2009-03-17 13:32:05 +0000
+++ b/storage/falcon/IndexRootPage.cpp	2009-04-02 22:36:19 +0000
@@ -541,9 +541,9 @@ bool IndexRootPage::splitIndexPage(Dbb *
 
 		// The order of adding these to the serial log is important.
 		// Recovery must write them in this order incase recovery itself crashes.
-		IndexPage::logIndexPage(splitBdb, transId);
-		IndexPage::logIndexPage(leftBdb, transId);
-		IndexPage::logIndexPage(bdb, transId);
+		IndexPage::logIndexPage(splitBdb, transId, indexKey->index);
+		IndexPage::logIndexPage(leftBdb, transId, indexKey->index);
+		IndexPage::logIndexPage(bdb, transId, indexKey->index);
 		
 		if (dbb->debug & DEBUG_PAGE_LEVEL)
 			{
@@ -566,10 +566,10 @@ bool IndexRootPage::splitIndexPage(Dbb *
 	int splitPageLevel = splitPage->level;
 	int splitPageNumber = splitBdb->pageNumber;
 
-	IndexPage::logIndexPage(splitBdb, transId);
+	IndexPage::logIndexPage(splitBdb, transId, indexKey->index);
 	splitBdb->release(REL_HISTORY);
 
-	IndexPage::logIndexPage(bdb, transId);
+	IndexPage::logIndexPage(bdb, transId, indexKey->index);
 	bdb->release(REL_HISTORY);
 
 	// We need to insert the first key of the newly created parent page
@@ -594,7 +594,7 @@ bool IndexRootPage::splitIndexPage(Dbb *
 			// Log parent page.
 			if (result == NodeAdded)
 				{
-				IndexPage::logIndexPage(parentBdb,transId);
+				IndexPage::logIndexPage(parentBdb,transId, indexKey->index);
 				}
 
 			parentBdb->release(REL_HISTORY);

=== modified file 'storage/falcon/RepositoryVolume.cpp'
--- a/storage/falcon/RepositoryVolume.cpp	2009-03-25 22:11:35 +0000
+++ b/storage/falcon/RepositoryVolume.cpp	2009-04-02 22:36:19 +0000
@@ -31,7 +31,7 @@
 #include "Bitmap.h"
 #include "Stream.h"
 #include "Sync.h"
-#include "Index2RootPage.h"
+#include "IndexRootPage.h"
 #include "IndexPage.h"
 #include "IndexNode.h"
 #include "BDB.h"
@@ -110,7 +110,7 @@ void RepositoryVolume::storeBlob(int64 b
 	int recordNumber = getRecordNumber(&indexKey);
 
 	if (recordNumber == 0)
-		dbb->deleteIndexEntry (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, &indexKey, 0, transaction->transactionId);
+		IndexRootPage::deleteIndexEntry (dbb, VOLUME_INDEX_ID, &indexKey, INDEX_CURRENT_VERSION, transaction->transactionId);
 
 	if (recordNumber > 0)
 		{
@@ -124,8 +124,8 @@ void RepositoryVolume::storeBlob(int64 b
 		}
 
 	int recordId = dbb->insertStub (section, transaction);
-	dbb->updateRecord(section, recordId, stream, transaction, true);
-	dbb->addIndexEntry (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, &indexKey, recordId + 1, transaction->transactionId);
+	dbb->updateRecord (section, recordId, stream, transaction, true);
+	IndexRootPage::addIndexEntry (dbb, VOLUME_INDEX_ID, &indexKey, recordId + 1, transaction->transactionId);
 }
 
 void RepositoryVolume::open()
@@ -234,7 +234,7 @@ void RepositoryVolume::create()
 	Sync syncDDL(&database->syncSysDDL, "RepositoryVolume::create");
 	Transaction *transaction = database->getSystemTransaction();
 	syncDDL.lock(Exclusive);
-	dbb->createIndex(transaction->transactionId, VOLUME_INDEX_VERSION);
+	IndexRootPage::createIndex(dbb, transaction->transactionId);
 	dbb->createSection(transaction->transactionId);
 	syncDDL.unlock();
 	database->commitSystemTransaction();
@@ -342,11 +342,11 @@ int RepositoryVolume::getRecordNumber(in
 int RepositoryVolume::getRecordNumber(IndexKey *indexKey)
 {
 	if (!rootPage)
-		rootPage = Index2RootPage::getIndexRoot(dbb, VOLUME_INDEX_ID);
+		rootPage = IndexRootPage::getIndexRoot(dbb, VOLUME_INDEX_ID);
 
 	Bitmap bitmap;
 	//dbb->scanIndex (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, indexKey, indexKey, false, bitmap);
-	Index2RootPage::scanIndex(dbb, VOLUME_INDEX_ID, rootPage, indexKey, indexKey, false, NO_TRANSACTION, &bitmap);
+	IndexRootPage::scanIndex(dbb, VOLUME_INDEX_ID, rootPage, indexKey, indexKey, false, NO_TRANSACTION, &bitmap);
 	int recordNumber = bitmap.nextSet (0);
 
 	return recordNumber;
@@ -418,8 +418,8 @@ void RepositoryVolume::deleteBlob(int64 
 
 	IndexKey indexKey;
 	makeKey (blobId, &indexKey);
-	dbb->addIndexEntry (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, &indexKey, 0, transaction->transactionId);
-	dbb->deleteIndexEntry (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, &indexKey, recordNumber + 1, transaction->transactionId);
+	IndexRootPage::addIndexEntry (dbb,VOLUME_INDEX_ID, &indexKey, 0, transaction->transactionId);
+	IndexRootPage::deleteIndexEntry (dbb, VOLUME_INDEX_ID, &indexKey, recordNumber + 1, transaction->transactionId);
 }
 
 JString RepositoryVolume::getName()
@@ -485,7 +485,7 @@ void RepositoryVolume::synchronize(Trans
 		{
 		IndexKey indexKey;
 		indexKey.keyLength = 0;
-		bdb = Index2RootPage::findLeaf (dbb, VOLUME_INDEX_ID, 0, &indexKey, Shared, transaction->transactionId);
+		bdb = IndexRootPage::findLeaf (dbb, VOLUME_INDEX_ID, 0, &indexKey, Shared, transaction->transactionId);
 
 		for (;;)
 			{

=== modified file 'storage/falcon/SRLCreateIndex.cpp'
--- a/storage/falcon/SRLCreateIndex.cpp	2009-02-10 22:50:04 +0000
+++ b/storage/falcon/SRLCreateIndex.cpp	2009-04-02 22:36:19 +0000
@@ -22,7 +22,6 @@
 #include "SerialLogControl.h"
 #include "Index.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "Dbb.h"
 
 //////////////////////////////////////////////////////////////////////
@@ -83,19 +82,7 @@ void SRLCreateIndex::pass2()
 	if (!control->isPostFlush())
 		return;
 
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_1:
-			IndexRootPage::redoCreateIndex(log->getDbb(tableSpaceId), indexId, pageNumber);
-			break;
-		
-		case INDEX_VERSION_0:
-			Index2RootPage::redoCreateIndex(log->getDbb(tableSpaceId), indexId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
+	IndexRootPage::redoCreateIndex(log->getDbb(tableSpaceId), indexId, pageNumber);
 }
 
 void SRLCreateIndex::redo()

=== modified file 'storage/falcon/SRLDeleteIndex.cpp'
--- a/storage/falcon/SRLDeleteIndex.cpp	2009-02-12 19:31:23 +0000
+++ b/storage/falcon/SRLDeleteIndex.cpp	2009-04-02 22:36:19 +0000
@@ -24,7 +24,6 @@
 #include "SerialLog.h"
 #include "SerialLogControl.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "Index.h"
 #include "Dbb.h"
 
@@ -85,19 +84,7 @@ void SRLDeleteIndex::pass2()
 	if (!control->isPostFlush())
 		return;
 
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			Index2RootPage::redoIndexDelete(dbb, indexId);
-			break;
-		
-		case INDEX_VERSION_1:
-			IndexRootPage::redoIndexDelete(dbb, indexId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
+	IndexRootPage::redoIndexDelete(dbb, indexId);
 }
 
 void SRLDeleteIndex::redo()
@@ -119,17 +106,5 @@ void SRLDeleteIndex::commit(void)
 	if (!dbb)
 		return;
 
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			Index2RootPage::deleteIndex(dbb, indexId, transactionId);
-			break;
-		
-		case INDEX_VERSION_1:
-			IndexRootPage::deleteIndex(dbb, indexId, transactionId);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
+	IndexRootPage::deleteIndex(dbb, indexId, transactionId);
 }

=== modified file 'storage/falcon/SRLIndexPage.cpp'
--- a/storage/falcon/SRLIndexPage.cpp	2009-03-02 18:36:32 +0000
+++ b/storage/falcon/SRLIndexPage.cpp	2009-04-02 22:36:19 +0000
@@ -24,7 +24,6 @@
 #include "SerialLogTransaction.h"
 #include "Dbb.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "Index.h"
 
 //////////////////////////////////////////////////////////////////////
@@ -96,33 +95,17 @@ void SRLIndexPage::pass1()
 
 void SRLIndexPage::pass2()
 {
+	if (log->tracePage == pageNumber)
+			print();
 	if (log->bumpPageIncarnation(pageNumber, tableSpaceId, objInUse))
 		{
-		if (log->tracePage == pageNumber)
-			print();
-
 		if (control->isPostFlush())
-			switch (indexVersion)
-				{
-				case INDEX_VERSION_0:
-					Index2RootPage::redoIndexPage(log->getDbb(tableSpaceId), pageNumber, 0,  level, 0,  next, length, data);
-					break;
-				
-				case INDEX_VERSION_1:
-					{
-					bool haveSuperNodes = (control->version >=srlVersion14);
-					IndexRootPage::redoIndexPage(log->getDbb(tableSpaceId), pageNumber, level, next, length, data,
-						haveSuperNodes);
-					}
-					break;
-				
-				default:
-					ASSERT(false);
-				}
+			{
+			bool haveSuperNodes = (control->version >=srlVersion14);
+			IndexRootPage::redoIndexPage(log->getDbb(tableSpaceId), pageNumber, level, next, length, data,
+				haveSuperNodes);
+			}
 		}
-	else 
-		if (log->tracePage == pageNumber)
-			print();
 }
 
 void SRLIndexPage::print()

=== modified file 'storage/falcon/SRLUpdateIndex.cpp'
--- a/storage/falcon/SRLUpdateIndex.cpp	2009-01-22 18:40:02 +0000
+++ b/storage/falcon/SRLUpdateIndex.cpp	2009-04-02 22:36:19 +0000
@@ -20,7 +20,6 @@
 #include "DeferredIndex.h"
 #include "Index.h"
 #include "IndexRootPage.h"
-#include "Index2RootPage.h"
 #include "IndexKey.h"
 #include "DeferredIndexWalker.h"
 #include "Transaction.h"
@@ -206,27 +205,8 @@ void SRLUpdateIndex::execute(void)
 	ptr = data;
 	end = ptr + dataLength;
 	Dbb *dbb = log->getDbb(tableSpaceId);
-	
-	switch (indexVersion)
-		{
-		case INDEX_VERSION_0:
-			Index2RootPage::indexMerge(dbb, indexId, this, NO_TRANSACTION);
-			break;
-		
-		case INDEX_VERSION_1:
-			IndexRootPage::indexMerge(dbb, indexId, this, NO_TRANSACTION);
-			break;
-		
-		default:
-			ASSERT(false);
-		}
-		
-	/***
-	IndexKey indexKey;
-	
-	for (int recordNumber; (recordNumber = nextKey(&indexKey)) != -1;)
-		log->dbb->addIndexEntry(indexId, &indexKey, recordNumber, NO_TRANSACTION);
-	***/
+
+	IndexRootPage::indexMerge(dbb, indexId, this, NO_TRANSACTION);
 }
 
 int SRLUpdateIndex::nextKey(IndexKey *indexKey)


Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20090402223619-8xg986k7rylptwlt.bundle
Thread
bzr commit into mysql-6.0-falcon-team branch (vvaintroub:3096)Vladislav Vaintroub3 Apr