Below is the list of changes that have just been committed into a local
6.0 repository of klewis. When klewis 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-05-09 23:18:41-05:00, klewis@klewis-mysql. +5 -0
Use boolean instead of a flag. This flag field was not
a problem because it only had one flag defined. But the
best practice for coding in a multithreading environment
is to use booleans instead of a flag field.
storage/falcon/BDB.h@stripped, 2008-05-09 23:18:09-05:00, klewis@klewis-mysql. +2 -10
Cleanup
storage/falcon/Cache.cpp@stripped, 2008-05-09 23:18:24-05:00, klewis@klewis-mysql. +1 -1
Compiler warning
storage/falcon/PageInventoryPage.cpp@stripped, 2008-05-09 23:18:26-05:00,
klewis@klewis-mysql. +2 -2
Use boolean instead of a flag.
storage/falcon/Section.cpp@stripped, 2008-05-09 23:18:29-05:00, klewis@klewis-mysql. +5 -5
Use boolean instead of a flag.
storage/falcon/SectionPage.h@stripped, 2008-05-09 23:18:31-05:00, klewis@klewis-mysql. +1 -3
Use boolean instead of a flag. This flag field was not
a problem because it only had one flag defined. But the
best practice for coding in a multithreading environment
is to use booleans instead of a flag field.
diff -Nrup a/storage/falcon/BDB.h b/storage/falcon/BDB.h
--- a/storage/falcon/BDB.h 2008-05-09 14:58:08 -05:00
+++ b/storage/falcon/BDB.h 2008-05-09 23:18:09 -05:00
@@ -51,13 +51,6 @@
#define BDB_HISTORY(_bdb_) {}
#endif
-/*** replaced by individual booleans
-static const int BDB_dirty = 1;
-static const int BDB_writer = 4; // PageWriter wants to hear about this
-static const int BDB_register = 8; // Register with PageWrite on next release
-static const int BDB_write_pending = 16; // Asynchronous write is pending
-****/
-
class Page;
class Cache;
class Dbb;
@@ -104,10 +97,9 @@ public:
SyncObject syncWrite;
time_t lastMark;
LockType lockType;
- //short flags;
- bool flushIt;
+ bool flushIt; // PageWriter wants to hear about this
bool isDirty;
- bool isRegistered; // page write cares
+ bool isRegistered; // Register with PageWrite on next release
volatile INTERLOCK_TYPE useCount;
#ifdef COLLECT_BDB_HISTORY
diff -Nrup a/storage/falcon/Cache.cpp b/storage/falcon/Cache.cpp
--- a/storage/falcon/Cache.cpp 2008-05-08 15:37:14 -05:00
+++ b/storage/falcon/Cache.cpp 2008-05-09 23:18:24 -05:00
@@ -288,7 +288,7 @@ Bdb* Cache::fetchPage(Dbb *dbb, int32 pa
// If buffer has moved out of the upper "fraction" of the LRU queue, move it back up
- if (bdb->age < bufferAge - upperFraction)
+ if (bdb->age < bufferAge - (uint64) upperFraction)
{
sync.lock (Exclusive);
moveToHead (bdb);
diff -Nrup a/storage/falcon/PageInventoryPage.cpp b/storage/falcon/PageInventoryPage.cpp
--- a/storage/falcon/PageInventoryPage.cpp 2008-03-11 10:16:31 -05:00
+++ b/storage/falcon/PageInventoryPage.cpp 2008-05-09 23:18:26 -05:00
@@ -298,8 +298,8 @@ void PageInventoryPage::validateInventor
case PAGE_sections:
{
SectionPage *pg = (SectionPage*) page;
- validation->warning("orphan section page %d/%d, section=%d, seq=%d, level=%d,
flgs=%d",
- pageNumber, tableSpaceId, pg->section, pg->level, pg->flags);
+ validation->warning("orphan section page %d/%d, section=%d, seq=%d, level=%d,
%sFull",
+ pageNumber, tableSpaceId, pg->section, pg->level, (pg->isFull ? "is" :
"not"));
}
break;
diff -Nrup a/storage/falcon/Section.cpp b/storage/falcon/Section.cpp
--- a/storage/falcon/Section.cpp 2008-03-27 01:09:20 -05:00
+++ b/storage/falcon/Section.cpp 2008-05-09 23:18:29 -05:00
@@ -349,7 +349,7 @@ int32 Section::insertStub(TransId transI
BDB_HISTORY(bdb);
SectionPage *pages = (SectionPage*) bdb->buffer;
- if (pages->flags & SECTION_FULL)
+ if (pages->isFull)
{
bdb->release(REL_HISTORY);
bdb = NULL;
@@ -513,7 +513,7 @@ void Section::updateRecord(int32 recordN
Bdb *bdb = getSectionPage (sequence, Shared, transId);
BDB_HISTORY(bdb);
SectionPage *sectionPage = (SectionPage*) bdb->buffer;
- int flags = sectionPage->flags;
+ bool isFull = sectionPage->isFull;
int32 pageNumber = sectionPage->pages [slot % dbb->pagesPerSection];
ASSERT (pageNumber);
bdb = dbb->handoffPage (bdb, pageNumber, PAGE_record_locator, Exclusive);
@@ -555,7 +555,7 @@ void Section::updateRecord(int32 recordN
bdb->release(REL_HISTORY);
- if (flags & SECTION_FULL)
+ if (isFull)
markFull (false, sequence, transId);
return;
@@ -1180,9 +1180,9 @@ void Section::markFull(bool isFull, int
SectionPage *pages = (SectionPage*) bdb->buffer;
if (isFull)
- pages->flags |= SECTION_FULL;
+ pages->isFull = true;
else
- pages->flags &= ~SECTION_FULL;
+ pages->isFull = false;
bdb->release(REL_HISTORY);
}
diff -Nrup a/storage/falcon/SectionPage.h b/storage/falcon/SectionPage.h
--- a/storage/falcon/SectionPage.h 2007-09-20 10:42:33 -05:00
+++ b/storage/falcon/SectionPage.h 2008-05-09 23:18:31 -05:00
@@ -33,8 +33,6 @@ class Bitmap;
struct SectionAnalysis;
-#define SECTION_FULL 1
-
class SectionPage : public Page
{
public:
@@ -46,7 +44,7 @@ public:
int section;
int sequence; /* sequence in level */
short level; /* 0 = root; */
- short flags;
+ bool isFull;
int32 pages [1];
};
| Thread |
|---|
| • bk commit into 6.0 tree (klewis:1.2673) | klewis | 10 May |