Go to the source code of this file.
Classes | |
struct | MemPage |
struct | MemPage::_OvflCell |
struct | Btree |
struct | BtShared |
struct | CellInfo |
struct | BtCursor |
struct | BtLock |
struct | IntegrityCk |
Defines | |
#define | ROUND8(x) ((x+7)&~7) |
#define | MX_CELL_SIZE(pBt) (pBt->pageSize-8) |
#define | MX_CELL(pBt) ((pBt->pageSize-8)/6) |
#define | SQLITE_FILE_HEADER "SQLite format 3" |
#define | PTF_INTKEY 0x01 |
#define | PTF_ZERODATA 0x02 |
#define | PTF_LEAFDATA 0x04 |
#define | PTF_LEAF 0x08 |
#define | EXTRA_SIZE sizeof(MemPage) |
#define | TRANS_NONE 0 |
#define | TRANS_READ 1 |
#define | TRANS_WRITE 2 |
#define | BTCURSOR_MAX_DEPTH 20 |
#define | CURSOR_INVALID 0 |
#define | CURSOR_VALID 1 |
#define | CURSOR_REQUIRESEEK 2 |
#define | CURSOR_FAULT 3 |
#define | PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1) |
#define | READ_LOCK 1 |
#define | WRITE_LOCK 2 |
#define | PTRMAP_PAGENO(pBt, pgno) ptrmapPageno(pBt, pgno) |
#define | PTRMAP_PTROFFSET(pgptrmap, pgno) (5*(pgno-pgptrmap-1)) |
#define | PTRMAP_ISPAGE(pBt, pgno) (PTRMAP_PAGENO((pBt),(pgno))==(pgno)) |
#define | PTRMAP_ROOTPAGE 1 |
#define | PTRMAP_FREEPAGE 2 |
#define | PTRMAP_OVERFLOW1 3 |
#define | PTRMAP_OVERFLOW2 4 |
#define | PTRMAP_BTREE 5 |
#define | btreeIntegrity(p) |
#define | ISAUTOVACUUM (pBt->autoVacuum) |
#define | get2byte(x) ((x)[0]<<8 | (x)[1]) |
#define | put2byte(p, v) ((p)[0] = (v)>>8, (p)[1] = (v)) |
#define | get4byte sqlite3Get4byte |
#define | put4byte sqlite3Put4byte |
Typedefs | |
typedef struct MemPage | MemPage |
typedef struct BtLock | BtLock |
typedef struct CellInfo | CellInfo |
typedef struct IntegrityCk | IntegrityCk |
Functions | |
int | sqlite3BtreeGetPage (BtShared *, Pgno, MemPage **, int) |
int | sqlite3BtreeInitPage (MemPage *pPage) |
void | sqlite3BtreeParseCellPtr (MemPage *, u8 *, CellInfo *) |
void | sqlite3BtreeParseCell (MemPage *, int, CellInfo *) |
int | sqlite3BtreeRestoreCursorPosition (BtCursor *pCur) |
void | sqlite3BtreeGetTempCursor (BtCursor *pCur, BtCursor *pTempCur) |
void | sqlite3BtreeReleaseTempCursor (BtCursor *pCur) |
void | sqlite3BtreeMoveToParent (BtCursor *pCur) |
#define BTCURSOR_MAX_DEPTH 20 |
Definition at line 423 of file btreeInt.h.
Referenced by moveToChild().
#define btreeIntegrity | ( | p | ) |
assert( p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0 ); \ assert( p->pBt->inTransaction>=p->inTrans );
Definition at line 585 of file btreeInt.h.
Referenced by lockBtreeWithRetry(), sqlite3BtreeBeginTrans(), sqlite3BtreeCommitPhaseTwo(), and sqlite3BtreeRollback().
#define CURSOR_FAULT 3 |
Definition at line 493 of file btreeInt.h.
Referenced by moveToRoot(), sqlite3BtreeDelete(), sqlite3BtreeInsert(), sqlite3BtreeRestoreCursorPosition(), and sqlite3BtreeTripAllCursors().
#define CURSOR_INVALID 0 |
Definition at line 490 of file btreeInt.h.
Referenced by btreeCursor(), checkReadLocks(), moveToRoot(), sqlite3BtreeClearCursor(), sqlite3BtreeData(), sqlite3BtreeDataSize(), sqlite3BtreeFirst(), sqlite3BtreeKeySize(), sqlite3BtreeLast(), sqlite3BtreeMovetoUnpacked(), sqlite3BtreeNext(), sqlite3BtreePrevious(), sqlite3BtreePutData(), and sqlite3BtreeRestoreCursorPosition().
#define CURSOR_REQUIRESEEK 2 |
Definition at line 492 of file btreeInt.h.
Referenced by moveToRoot(), saveCursorPosition(), sqlite3BtreePutData(), and sqlite3BtreeRestoreCursorPosition().
#define CURSOR_VALID 1 |
Definition at line 491 of file btreeInt.h.
Referenced by accessPayload(), checkReadLocks(), fetchPayload(), moveToChild(), moveToLeftmost(), moveToRightmost(), moveToRoot(), saveAllCursors(), saveCursorPosition(), sqlite3BtreeCursorHasMoved(), sqlite3BtreeData(), sqlite3BtreeDataFetch(), sqlite3BtreeDataSize(), sqlite3BtreeEof(), sqlite3BtreeInsert(), sqlite3BtreeKey(), sqlite3BtreeKeyFetch(), sqlite3BtreeKeySize(), sqlite3BtreeLast(), sqlite3BtreeMoveToParent(), sqlite3BtreeMovetoUnpacked(), sqlite3BtreePutData(), and sqlite3BtreeRestoreCursorPosition().
#define EXTRA_SIZE sizeof(MemPage) |
Definition at line 301 of file btreeInt.h.
Referenced by sqlite3BtreeOpen().
#define get2byte | ( | x | ) | ((x)[0]<<8 | (x)[1]) |
Definition at line 623 of file btreeInt.h.
Referenced by allocateSpace(), balance_deeper(), checkTreePage(), defragmentPage(), dropCell(), freeSpace(), insertCell(), lockBtree(), sqlite3BtreeInitPage(), and sqlite3BtreeOpen().
#define get4byte sqlite3Get4byte |
Definition at line 625 of file btreeInt.h.
Referenced by accessPayload(), allocateBtreePage(), autoVacuumCommit(), balance_nonroot(), balance_shallower(), checkList(), checkTreePage(), clearCell(), clearDatabasePage(), freePage(), getOverflowPage(), incrVacuumStep(), insertCell(), lockBtree(), modifyPagePointer(), moveToLeftmost(), moveToRightmost(), moveToRoot(), ptrmapGet(), ptrmapPut(), ptrmapPutOvflPtr(), relocatePage(), setChildPtrmaps(), sqlite3BtreeDelete(), sqlite3BtreeGetMeta(), sqlite3BtreeIntegrityCheck(), sqlite3BtreeMovetoUnpacked(), sqlite3BtreeNext(), sqlite3BtreeOpen(), and sqlite3BtreePrevious().
#define ISAUTOVACUUM (pBt->autoVacuum) |
Definition at line 598 of file btreeInt.h.
Referenced by balance_deeper(), balance_nonroot(), balance_quick(), balance_shallower(), and freePage().
#define MX_CELL | ( | pBt | ) | ((pBt->pageSize-8)/6) |
Definition at line 228 of file btreeInt.h.
Referenced by balance_shallower(), and sqlite3BtreeInitPage().
#define MX_CELL_SIZE | ( | pBt | ) | (pBt->pageSize-8) |
Definition at line 221 of file btreeInt.h.
Referenced by lockBtree(), sqlite3BtreeDelete(), and sqlite3BtreeInsert().
#define PENDING_BYTE_PAGE | ( | pBt | ) | ((PENDING_BYTE/(pBt)->pageSize)+1) |
Definition at line 505 of file btreeInt.h.
Referenced by allocateBtreePage(), autoVacuumCommit(), btreeCopyFile(), btreeCreateTable(), btreeDropTable(), fillInCell(), getOverflowPage(), incrVacuumStep(), ptrmapPageno(), ptrmapPut(), and sqlite3BtreeIntegrityCheck().
#define PTF_INTKEY 0x01 |
Definition at line 254 of file btreeInt.h.
Referenced by btreeDropTable(), decodeFlags(), and newDatabase().
#define PTF_LEAF 0x08 |
Definition at line 257 of file btreeInt.h.
Referenced by balance_deeper(), balance_nonroot(), btreeCreateTable(), btreeDropTable(), clearDatabasePage(), decodeFlags(), newDatabase(), and zeroPage().
#define PTF_LEAFDATA 0x04 |
Definition at line 256 of file btreeInt.h.
Referenced by decodeFlags(), and newDatabase().
#define PTF_ZERODATA 0x02 |
Definition at line 255 of file btreeInt.h.
Referenced by decodeFlags().
#define PTRMAP_BTREE 5 |
Definition at line 580 of file btreeInt.h.
Referenced by balance_deeper(), balance_nonroot(), balance_quick(), checkTreePage(), modifyPagePointer(), relocatePage(), and setChildPtrmaps().
#define PTRMAP_FREEPAGE 2 |
Definition at line 577 of file btreeInt.h.
Referenced by allocateBtreePage(), btreeCreateTable(), checkList(), freePage(), and incrVacuumStep().
#define PTRMAP_ISPAGE | ( | pBt, | |||
pgno | ) | (PTRMAP_PAGENO((pBt),(pgno))==(pgno)) |
Definition at line 543 of file btreeInt.h.
Referenced by allocateBtreePage(), autoVacuumCommit(), fillInCell(), getOverflowPage(), incrVacuumStep(), and ptrmapPut().
#define PTRMAP_OVERFLOW1 3 |
Definition at line 578 of file btreeInt.h.
Referenced by checkTreePage(), fillInCell(), insertCell(), modifyPagePointer(), ptrmapPutOvflPtr(), and relocatePage().
#define PTRMAP_OVERFLOW2 4 |
Definition at line 579 of file btreeInt.h.
Referenced by checkList(), fillInCell(), getOverflowPage(), modifyPagePointer(), and relocatePage().
#define PTRMAP_PAGENO | ( | pBt, | |||
pgno | ) | ptrmapPageno(pBt, pgno) |
Definition at line 541 of file btreeInt.h.
Referenced by autoVacuumCommit(), btreeCreateTable(), btreeDropTable(), ptrmapGet(), ptrmapPut(), and sqlite3BtreeIntegrityCheck().
#define PTRMAP_PTROFFSET | ( | pgptrmap, | |||
pgno | ) | (5*(pgno-pgptrmap-1)) |
Definition at line 542 of file btreeInt.h.
Referenced by ptrmapGet(), and ptrmapPut().
#define PTRMAP_ROOTPAGE 1 |
Definition at line 576 of file btreeInt.h.
Referenced by btreeCreateTable(), btreeDropTable(), incrVacuumStep(), relocatePage(), and sqlite3BtreeIntegrityCheck().
#define put2byte | ( | p, | |||
v | ) | ((p)[0] = (v)>>8, (p)[1] = (v)) |
Definition at line 624 of file btreeInt.h.
Referenced by allocateSpace(), assemblePage(), defragmentPage(), dropCell(), freeSpace(), insertCell(), newDatabase(), and zeroPage().
#define put4byte sqlite3Put4byte |
Definition at line 626 of file btreeInt.h.
Referenced by allocateBtreePage(), autoVacuumCommit(), balance_deeper(), balance_nonroot(), balance_quick(), balance_shallower(), fillInCell(), freePage(), modifyPagePointer(), newDatabase(), ptrmapPut(), sqlite3BtreeDelete(), and sqlite3BtreeUpdateMeta().
#define READ_LOCK 1 |
Definition at line 523 of file btreeInt.h.
Referenced by lockTable(), queryTableLock(), sqlite3BtreeGetMeta(), sqlite3BtreeLockTable(), and sqlite3BtreeSchemaLocked().
#define ROUND8 | ( | x | ) | ((x+7)&~7) |
Definition at line 215 of file btreeInt.h.
Referenced by balance_nonroot().
#define SQLITE_FILE_HEADER "SQLite format 3" |
Definition at line 247 of file btreeInt.h.
#define TRANS_NONE 0 |
Definition at line 342 of file btreeInt.h.
Referenced by lockBtreeWithRetry(), sqlite3BtreeBeginTrans(), sqlite3BtreeCommitPhaseTwo(), sqlite3BtreeIsInReadTrans(), sqlite3BtreeOpen(), sqlite3BtreeRollback(), and unlockBtreeIfUnused().
#define TRANS_READ 1 |
Definition at line 343 of file btreeInt.h.
Referenced by sqlite3BtreeBeginTrans(), sqlite3BtreeCommitPhaseTwo(), and sqlite3BtreeRollback().
#define TRANS_WRITE 2 |
Definition at line 344 of file btreeInt.h.
Referenced by btreeCopyFile(), btreeCreateTable(), btreeDropTable(), sqlite3BtreeBeginStmt(), sqlite3BtreeBeginTrans(), sqlite3BtreeClearTable(), sqlite3BtreeCommitPhaseOne(), sqlite3BtreeCommitPhaseTwo(), sqlite3BtreeDelete(), sqlite3BtreeIncrVacuum(), sqlite3BtreeInsert(), sqlite3BtreeIsInTrans(), sqlite3BtreePutData(), sqlite3BtreeRollback(), and sqlite3BtreeUpdateMeta().
#define WRITE_LOCK 2 |
Definition at line 524 of file btreeInt.h.
Referenced by lockTable(), queryTableLock(), and sqlite3BtreeLockTable().
Definition at line 232 of file btreeInt.h.
Definition at line 402 of file btreeInt.h.
typedef struct IntegrityCk IntegrityCk |
Definition at line 608 of file btreeInt.h.
Definition at line 231 of file btreeInt.h.
Definition at line 1086 of file btree.c.
References btreePageFromDbPage(), BtShared::mutex, BtShared::pPager, sqlite3_mutex_held, sqlite3PagerAcquire(), and SQLITE_OK.
Referenced by allocateBtreePage(), balance_shallower(), btreeCreateTable(), btreeDropTable(), checkTreePage(), freePage(), getAndInitPage(), getOverflowPage(), incrVacuumStep(), lockBtree(), relocatePage(), and sqlite3BtreeRollback().
Definition at line 2902 of file btree.c.
References BtCursor::apPage, BtCursor::iPage, MemPage::pDbPage, BtCursor::pNext, BtCursor::pPrev, and sqlite3PagerRef().
Referenced by sqlite3BtreeDelete().
int sqlite3BtreeInitPage | ( | MemPage * | pPage | ) |
Definition at line 944 of file btree.c.
References MemPage::aData, MemPage::cellOffset, decodeFlags(), get2byte, MemPage::hdrOffset, MemPage::isInit, MemPage::leaf, MemPage::maskPage, BtShared::mutex, MX_CELL, MemPage::nCell, next, MemPage::nFree, MemPage::nOverflow, BtShared::pageSize, MemPage::pBt, MemPage::pDbPage, MemPage::pgno, sqlite3_mutex_held, sqlite3PagerGetData(), sqlite3PagerGetExtra(), SQLITE_CORRUPT_BKPT, SQLITE_OK, and BtShared::usableSize.
Referenced by balance_deeper(), balance_quick(), balance_shallower(), checkTreePage(), getAndInitPage(), modifyPagePointer(), pageReinit(), and setChildPtrmaps().
void sqlite3BtreeMoveToParent | ( | BtCursor * | pCur | ) |
Definition at line 3504 of file btree.c.
References BtCursor::aiIdx, BtCursor::apPage, assertParentIndex, CURSOR_VALID, BtCursor::eState, BtCursor::info, BtCursor::iPage, CellInfo::nSize, MemPage::pgno, releasePage(), and BtCursor::validNKey.
Referenced by sqlite3BtreeNext(), and sqlite3BtreePrevious().
Definition at line 572 of file btree.c.
References MemPage::childPtrSize, getVarint, getVarint32, MemPage::hasData, MemPage::intKey, CellInfo::iOverflow, MemPage::leaf, likely, MemPage::maxLocal, MemPage::minLocal, BtShared::mutex, CellInfo::nData, CellInfo::nHeader, CellInfo::nKey, CellInfo::nLocal, CellInfo::nPayload, CellInfo::nSize, MemPage::pBt, CellInfo::pCell, sqlite3_mutex_held, and BtShared::usableSize.
Referenced by balance_nonroot(), balance_quick(), cellSizePtr(), checkTreePage(), clearCell(), fillInCell(), insertCell(), modifyPagePointer(), and ptrmapPutOvflPtr().
void sqlite3BtreeReleaseTempCursor | ( | BtCursor * | pCur | ) |
Definition at line 2917 of file btree.c.
References BtCursor::apPage, BtCursor::iPage, MemPage::pDbPage, and sqlite3PagerUnref().
Referenced by sqlite3BtreeDelete().
int sqlite3BtreeRestoreCursorPosition | ( | BtCursor * | pCur | ) |
Definition at line 385 of file btree.c.
References CURSOR_FAULT, CURSOR_INVALID, CURSOR_REQUIRESEEK, CURSOR_VALID, BtCursor::eState, BtCursor::nKey, BtCursor::pKey, BtCursor::skip, sqlite3_free(), sqlite3BtreeMoveto(), and SQLITE_OK.
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1