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, 2007-12-04 10:38:41-05:00, jas@rowvwade. +7 -0
Work in progress integrating repositories with Falcon
tablespaces.
storage/falcon/Dbb.cpp@stripped, 2007-12-04 10:38:30-05:00, jas@rowvwade. +23 -3
Added index version to create index to support repositories.
storage/falcon/Dbb.h@stripped, 2007-12-04 10:38:30-05:00, jas@rowvwade. +1 -1
Added index version to create index to support repositories.
storage/falcon/Engine.vcproj@stripped, 2007-12-04 10:38:30-05:00, jas@rowvwade. +30 -0
General update.
storage/falcon/Index.cpp@stripped, 2007-12-04 10:38:31-05:00, jas@rowvwade. +2 -2
Added index version to create index to support repositories.
storage/falcon/RepositoryVolume.cpp@stripped, 2007-12-04 10:38:31-05:00, jas@rowvwade. +26 -9
Work in progress integrating repositories with Falcon
tablespaces.
storage/falcon/RepositoryVolume.h@stripped, 2007-12-04 10:38:32-05:00, jas@rowvwade. +4 -0
Work in progress integrating repositories with Falcon
tablespaces.
storage/falcon/Statement.cpp@stripped, 2007-12-04 10:38:32-05:00, jas@rowvwade. +5 -2
Clean up repository DDL error messages.
diff -Nrup a/storage/falcon/Dbb.cpp b/storage/falcon/Dbb.cpp
--- a/storage/falcon/Dbb.cpp 2007-11-10 14:12:52 -05:00
+++ b/storage/falcon/Dbb.cpp 2007-12-04 10:38:30 -05:00
@@ -389,12 +389,26 @@ int32 Dbb::findNextRecord(Section *secti
return section->findNextRecord(startingRecord, stream);
}
-int32 Dbb::createIndex(TransId transId)
+int32 Dbb::createIndex(TransId transId, int indexVersion)
{
- int indexId = IndexRootPage::createIndex(this, transId);
+ 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);
+ }
if (serialLog)
- serialLog->logControl->createIndex.append(this, transId, indexId, INDEX_CURRENT_VERSION);
+ serialLog->logControl->createIndex.append(this, transId, indexId, indexVersion);
return indexId;
}
@@ -1218,11 +1232,17 @@ void Dbb::logIndexUpdates(DeferredIndex*
bool Dbb::sectionInUse(int sectionId)
{
+ if (tableSpaceId < 0)
+ return false; // repository
+
return serialLog->sectionInUse(sectionId, tableSpaceId);
}
bool Dbb::indexInUse(int indexId)
{
+ if (tableSpaceId < 0)
+ return false; // repository
+
return serialLog->indexInUse(indexId, tableSpaceId);
}
diff -Nrup a/storage/falcon/Dbb.h b/storage/falcon/Dbb.h
--- a/storage/falcon/Dbb.h 2007-10-31 13:05:12 -04:00
+++ b/storage/falcon/Dbb.h 2007-12-04 10:38:30 -05:00
@@ -146,7 +146,7 @@ public:
Cache* open (const char *fileName, int64 cacheSize, TransId transId);
void flush();
bool addIndexEntry (int32 indexId, int indexVersion, IndexKey *key, int32 recordNumber, TransId transId);
- int32 createIndex(TransId transId);
+ int32 createIndex(TransId transId, int indexVersion);
int32 findNextRecord (Section *section, int32 startingRecord, Stream *stream);
bool fetchRecord (int32 sectionId, int32 recordNumber, Stream *stream);
diff -Nrup a/storage/falcon/Engine.vcproj b/storage/falcon/Engine.vcproj
--- a/storage/falcon/Engine.vcproj 2007-10-15 10:47:51 -04:00
+++ b/storage/falcon/Engine.vcproj 2007-12-04 10:38:30 -05:00
@@ -9138,6 +9138,12 @@
RelativePath=".\FsbDerivedTable.h">
</File>
<File
+ RelativePath=".\Gopher.cpp">
+ </File>
+ <File
+ RelativePath=".\Gopher.h">
+ </File>
+ <File
RelativePath=".\LogLock.cpp">
</File>
<File
@@ -9156,6 +9162,18 @@
RelativePath=".\MemFreeBlock.h">
</File>
<File
+ RelativePath=".\Priority.cpp">
+ </File>
+ <File
+ RelativePath=".\Priority.h">
+ </File>
+ <File
+ RelativePath=".\PriorityScheduler.cpp">
+ </File>
+ <File
+ RelativePath=".\PriorityScheduler.h">
+ </File>
+ <File
RelativePath=".\RecordScavenge.cpp">
</File>
<File
@@ -9178,6 +9196,18 @@
</File>
<File
RelativePath=".\SRLDropTableSpace.h">
+ </File>
+ <File
+ RelativePath=".\SRLSession.cpp">
+ </File>
+ <File
+ RelativePath=".\SRLSession.h">
+ </File>
+ <File
+ RelativePath=".\SRLUpdateBlob.cpp">
+ </File>
+ <File
+ RelativePath=".\SRLUpdateBlob.h">
</File>
<File
RelativePath=".\TableSpace.cpp">
diff -Nrup a/storage/falcon/Index.cpp b/storage/falcon/Index.cpp
--- a/storage/falcon/Index.cpp 2007-11-14 01:31:17 -05:00
+++ b/storage/falcon/Index.cpp 2007-12-04 10:38:31 -05:00
@@ -195,8 +195,8 @@ void Index::save()
void Index::create(Transaction *transaction)
{
ASSERT (indexId == -1);
- indexId = dbb->createIndex(TRANSACTION_ID(transaction));
indexVersion = INDEX_CURRENT_VERSION;
+ indexId = dbb->createIndex(TRANSACTION_ID(transaction), indexVersion);
}
void Index::insert(Record * record, Transaction *transaction)
@@ -694,7 +694,7 @@ void Index::rebuildIndex(Transaction *tr
Sync sync (&database->syncSysConnection, "Index::rebuildIndex");
sync.lock (Shared);
int oldId = indexId;
- indexId = dbb->createIndex(TRANSACTION_ID(transaction));
+ indexId = dbb->createIndex(TRANSACTION_ID(transaction), indexVersion);
PreparedStatement *statement = database->prepareStatement (
"update system.indexes set indexId=? where indexName=? and schema=? and tableName=?");
diff -Nrup a/storage/falcon/RepositoryVolume.cpp b/storage/falcon/RepositoryVolume.cpp
--- a/storage/falcon/RepositoryVolume.cpp 2007-10-23 16:50:15 -04:00
+++ b/storage/falcon/RepositoryVolume.cpp 2007-12-04 10:38:31 -05:00
@@ -37,6 +37,7 @@
#include "BDB.h"
#include "Stream.h"
#include "IndexKey.h"
+#include "Index.h"
#define TIMEOUT (60 * 4)
#define VOLUME_INDEX_ID 0
@@ -58,10 +59,12 @@ RepositoryVolume::RepositoryVolume(Repos
volumeNumber = volume;
fileName = file;
database = repository->database;
- dbb = new Dbb (database->dbb, 0);
+ dbb = new Dbb (database->dbb, -1);
isOpen = false;
isWritable = false;
lastAccess = 0;
+ rootPage = 0;
+ section = NULL;
}
RepositoryVolume::~RepositoryVolume()
@@ -77,6 +80,9 @@ void RepositoryVolume::storeBlob(BlobRef
void RepositoryVolume::storeBlob(int64 blobId, Stream *stream, Transaction *transaction)
{
+ if (!section)
+ section = dbb->findSection(VOLUME_SECTION_ID);
+
Sync sync (&syncObject, "RepositoryVolume::getBlob");
sync.lock (Shared);
@@ -110,8 +116,9 @@ void RepositoryVolume::storeBlob(int64 b
throw SQLError (INCONSISTENT_BLOB, "inconsistent values for repository blobId\n");
}
- int recordId = dbb->insertStub (VOLUME_SECTION_ID, transaction);
- dbb->logRecord (VOLUME_SECTION_ID, recordId, stream, transaction);
+ int recordId = dbb->insertStub (section, transaction);
+ //dbb->logRecord (VOLUME_SECTION_ID, recordId, stream, transaction);
+ dbb->updateRecord(section, recordId, stream, transaction, true);
dbb->addIndexEntry (VOLUME_INDEX_ID, VOLUME_INDEX_VERSION, &indexKey, recordId + 1, transaction->transactionId);
}
@@ -211,10 +218,14 @@ void RepositoryVolume::create()
{
IO::createPath (fileName);
dbb->create(fileName, dbb->pageSize, 0, HdrRepositoryFile, 0, NULL, 0);
- //int indexId =
- dbb->createIndex (0);
- //int sectionId =
- dbb->createSection (0);
+ Sync syncSystem(&database->syncSysConnection, "RepositoryVolume::create");
+ Transaction *transaction = database->getSystemTransaction();
+ syncSystem.lock(Exclusive);
+ int indexId = dbb->createIndex(transaction->transactionId, VOLUME_INDEX_VERSION);
+ int sectionId = dbb->createSection(transaction->transactionId);
+ syncSystem.unlock();
+ database->commitSystemTransaction();
+
Bdb *bdb = dbb->fetchPage(HEADER_PAGE, PAGE_header, Exclusive);
BDB_HISTORY(bdb);
bdb->mark (0);
@@ -308,9 +319,12 @@ int RepositoryVolume::getRecordNumber(in
int RepositoryVolume::getRecordNumber(IndexKey *indexKey)
{
+ if (!rootPage)
+ rootPage = Index2RootPage::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, 0, indexKey, indexKey, false, NO_TRANSACTION, &bitmap);
+ Index2RootPage::scanIndex(dbb, VOLUME_INDEX_ID, rootPage, indexKey, indexKey, false, NO_TRANSACTION, &bitmap);
int recordNumber = bitmap.nextSet (0);
return recordNumber;
@@ -318,7 +332,10 @@ int RepositoryVolume::getRecordNumber(In
void RepositoryVolume::fetchRecord(int recordNumber, Stream *stream)
{
- dbb->fetchRecord (VOLUME_SECTION_ID, recordNumber, stream);
+ if (!section)
+ section = dbb->findSection(VOLUME_SECTION_ID);
+
+ dbb->fetchRecord (section, recordNumber, stream);
}
int RepositoryVolume::compare(Stream *stream1, Stream *stream2)
diff -Nrup a/storage/falcon/RepositoryVolume.h b/storage/falcon/RepositoryVolume.h
--- a/storage/falcon/RepositoryVolume.h 2007-09-20 11:42:15 -04:00
+++ b/storage/falcon/RepositoryVolume.h 2007-12-04 10:38:32 -05:00
@@ -32,6 +32,7 @@ class Database;
class Transaction;
class BlobReference;
class IndexKey;
+class Section;
class RepositoryVolume
{
@@ -63,11 +64,14 @@ public:
int64 reverseKey (UCHAR *key);
void synchronize(Transaction *transaction);
void scavenge();
+
int volumeNumber;
+ int32 rootPage;
Repository *repository;
RepositoryVolume *collision;
SyncObject syncObject;
JString fileName;
+ Section *section;
Dbb *dbb;
Database *database;
time_t lastAccess;
diff -Nrup a/storage/falcon/Statement.cpp b/storage/falcon/Statement.cpp
--- a/storage/falcon/Statement.cpp 2007-11-14 18:00:51 -05:00
+++ b/storage/falcon/Statement.cpp 2007-12-04 10:38:32 -05:00
@@ -2773,8 +2773,11 @@ void Statement::createRepository(Syntax
if (sequenceName)
sequence = database->sequenceManager->findSequence (schema, sequenceName);
- if (!sequence && !upgrade)
- throw SQLEXCEPTION (DDL_ERROR, "sequence %s.%s isn't defined", schema, sequenceName);
+ if (!upgrade && !sequence)
+ if (sequenceName)
+ throw SQLEXCEPTION (DDL_ERROR, "sequence %s.%s isn't defined", schema, sequenceName);
+ else
+ throw SQLEXCEPTION (DDL_ERROR, "a sequence name is required for repository %d", schema);
if (repository)
{
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2684) | U-ROWVWADEjas | 4 Dec |