btree.c File Reference

Go to the source code of this file.

Defines

#define TRACE(X)
#define VVA_ONLY(X)
#define restoreCursorPosition(p)
#define findCell(P, I)   ((P)->aData + ((P)->maskPage & get2byte(&(P)->aData[(P)->cellOffset+2*(I)])))
#define parseCell(pPage, iCell, pInfo)   sqlite3BtreeParseCellPtr((pPage), findCell((pPage), (iCell)), (pInfo))
#define assertCellInfo(x)
#define getCellInfo(pCur)
#define assertParentIndex(x, y, z)
#define NN   1
#define NB   (NN*2+1)

Functions

int sqlite3_enable_shared_cache (int enable)
static int checkReadLocks (Btree *, Pgno, BtCursor *, i64)
static int queryTableLock (Btree *p, Pgno iTab, u8 eLock)
static int lockTable (Btree *p, Pgno iTable, u8 eLock)
static void unlockAllTables (Btree *p)
static void releasePage (MemPage *pPage)
static void invalidateOverflowCache (BtCursor *pCur)
static void invalidateAllOverflowCache (BtShared *pBt)
static int saveCursorPosition (BtCursor *pCur)
static int saveAllCursors (BtShared *pBt, Pgno iRoot, BtCursor *pExcept)
void sqlite3BtreeClearCursor (BtCursor *pCur)
int sqlite3BtreeRestoreCursorPosition (BtCursor *pCur)
int sqlite3BtreeCursorHasMoved (BtCursor *pCur, int *pHasMoved)
static Pgno ptrmapPageno (BtShared *pBt, Pgno pgno)
static int ptrmapPut (BtShared *pBt, Pgno key, u8 eType, Pgno parent)
static int ptrmapGet (BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno)
static u8findOverflowCell (MemPage *pPage, int iCell)
void sqlite3BtreeParseCellPtr (MemPage *pPage, u8 *pCell, CellInfo *pInfo)
void sqlite3BtreeParseCell (MemPage *pPage, int iCell, CellInfo *pInfo)
static u16 cellSizePtr (MemPage *pPage, u8 *pCell)
static int ptrmapPutOvflPtr (MemPage *pPage, u8 *pCell)
static int ptrmapPutOvfl (MemPage *pPage, int iCell)
static int defragmentPage (MemPage *pPage)
static int allocateSpace (MemPage *pPage, int nByte)
static void freeSpace (MemPage *pPage, int start, int size)
static int decodeFlags (MemPage *pPage, int flagByte)
int sqlite3BtreeInitPage (MemPage *pPage)
static void zeroPage (MemPage *pPage, int flags)
static MemPagebtreePageFromDbPage (DbPage *pDbPage, Pgno pgno, BtShared *pBt)
int sqlite3BtreeGetPage (BtShared *pBt, Pgno pgno, MemPage **ppPage, int noContent)
static int pagerPagecount (Pager *pPager)
static int getAndInitPage (BtShared *pBt, Pgno pgno, MemPage **ppPage)
static void pageReinit (DbPage *pData)
static int sqlite3BtreeInvokeBusyHandler (void *pArg, int n)
int sqlite3BtreeOpen (const char *zFilename, sqlite3 *db, Btree **ppBtree, int flags, int vfsFlags)
static int removeFromSharingList (BtShared *pBt)
static void allocateTempSpace (BtShared *pBt)
static void freeTempSpace (BtShared *pBt)
int sqlite3BtreeClose (Btree *p)
int sqlite3BtreeSetCacheSize (Btree *p, int mxPage)
int sqlite3BtreeSetSafetyLevel (Btree *p, int level, int fullSync)
int sqlite3BtreeSyncDisabled (Btree *p)
int sqlite3BtreeSetPageSize (Btree *p, int pageSize, int nReserve)
int sqlite3BtreeGetPageSize (Btree *p)
int sqlite3BtreeGetReserve (Btree *p)
int sqlite3BtreeMaxPageCount (Btree *p, int mxPage)
int sqlite3BtreeSetAutoVacuum (Btree *p, int autoVacuum)
int sqlite3BtreeGetAutoVacuum (Btree *p)
static int lockBtree (BtShared *pBt)
static int lockBtreeWithRetry (Btree *pRef)
static void unlockBtreeIfUnused (BtShared *pBt)
static int newDatabase (BtShared *pBt)
int sqlite3BtreeBeginTrans (Btree *p, int wrflag)
static int setChildPtrmaps (MemPage *pPage)
static int modifyPagePointer (MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType)
static int relocatePage (BtShared *pBt, MemPage *pDbPage, u8 eType, Pgno iPtrPage, Pgno iFreePage, int isCommit)
static int allocateBtreePage (BtShared *, MemPage **, Pgno *, Pgno, u8)
static int incrVacuumStep (BtShared *pBt, Pgno nFin)
int sqlite3BtreeIncrVacuum (Btree *p)
static int autoVacuumCommit (BtShared *pBt, Pgno *pnTrunc)
int sqlite3BtreeCommitPhaseOne (Btree *p, const char *zMaster)
int sqlite3BtreeCommitPhaseTwo (Btree *p)
int sqlite3BtreeCommit (Btree *p)
void sqlite3BtreeTripAllCursors (Btree *pBtree, int errCode)
int sqlite3BtreeRollback (Btree *p)
int sqlite3BtreeBeginStmt (Btree *p)
int sqlite3BtreeCommitStmt (Btree *p)
int sqlite3BtreeRollbackStmt (Btree *p)
static int btreeCursor (Btree *p, int iTable, int wrFlag, struct KeyInfo *pKeyInfo, BtCursor *pCur)
int sqlite3BtreeCursor (Btree *p, int iTable, int wrFlag, struct KeyInfo *pKeyInfo, BtCursor *pCur)
int sqlite3BtreeCursorSize ()
int sqlite3BtreeCloseCursor (BtCursor *pCur)
void sqlite3BtreeGetTempCursor (BtCursor *pCur, BtCursor *pTempCur)
void sqlite3BtreeReleaseTempCursor (BtCursor *pCur)
int sqlite3BtreeKeySize (BtCursor *pCur, i64 *pSize)
int sqlite3BtreeDataSize (BtCursor *pCur, u32 *pSize)
static int getOverflowPage (BtShared *pBt, Pgno ovfl, MemPage **ppPage, Pgno *pPgnoNext)
static int copyPayload (void *pPayload, void *pBuf, int nByte, int eOp, DbPage *pDbPage)
static int accessPayload (BtCursor *pCur, int offset, int amt, unsigned char *pBuf, int skipKey, int eOp)
int sqlite3BtreeKey (BtCursor *pCur, u32 offset, u32 amt, void *pBuf)
int sqlite3BtreeData (BtCursor *pCur, u32 offset, u32 amt, void *pBuf)
static const unsigned char * fetchPayload (BtCursor *pCur, int *pAmt, int skipKey)
const void * sqlite3BtreeKeyFetch (BtCursor *pCur, int *pAmt)
const void * sqlite3BtreeDataFetch (BtCursor *pCur, int *pAmt)
static int moveToChild (BtCursor *pCur, u32 newPgno)
void sqlite3BtreeMoveToParent (BtCursor *pCur)
static int moveToRoot (BtCursor *pCur)
static int moveToLeftmost (BtCursor *pCur)
static int moveToRightmost (BtCursor *pCur)
int sqlite3BtreeFirst (BtCursor *pCur, int *pRes)
int sqlite3BtreeLast (BtCursor *pCur, int *pRes)
int sqlite3BtreeMovetoUnpacked (BtCursor *pCur, UnpackedRecord *pIdxKey, i64 intKey, int biasRight, int *pRes)
int sqlite3BtreeMoveto (BtCursor *pCur, const void *pKey, i64 nKey, int bias, int *pRes)
int sqlite3BtreeEof (BtCursor *pCur)
sqlite3sqlite3BtreeCursorDb (const BtCursor *pCur)
int sqlite3BtreeNext (BtCursor *pCur, int *pRes)
int sqlite3BtreePrevious (BtCursor *pCur, int *pRes)
static int freePage (MemPage *pPage)
static int clearCell (MemPage *pPage, unsigned char *pCell)
static int fillInCell (MemPage *pPage, unsigned char *pCell, const void *pKey, i64 nKey, const void *pData, int nData, int nZero, int *pnSize)
static int dropCell (MemPage *pPage, int idx, int sz)
static int insertCell (MemPage *pPage, int i, u8 *pCell, int sz, u8 *pTemp, u8 nSkip)
static void assemblePage (MemPage *pPage, int nCell, u8 **apCell, u16 *aSize)
static int balance (BtCursor *, int)
static int balance_quick (BtCursor *pCur)
static int balance_nonroot (BtCursor *pCur)
static int balance_shallower (BtCursor *pCur)
static int balance_deeper (BtCursor *pCur)
int sqlite3BtreeInsert (BtCursor *pCur, const void *pKey, i64 nKey, const void *pData, int nData, int nZero, int appendBias)
int sqlite3BtreeDelete (BtCursor *pCur)
static int btreeCreateTable (Btree *p, int *piTable, int flags)
int sqlite3BtreeCreateTable (Btree *p, int *piTable, int flags)
static int clearDatabasePage (BtShared *pBt, Pgno pgno, MemPage *pParent, int freePageFlag, int *pnChange)
int sqlite3BtreeClearTable (Btree *p, int iTable, int *pnChange)
static int btreeDropTable (Btree *p, int iTable, int *piMoved)
int sqlite3BtreeDropTable (Btree *p, int iTable, int *piMoved)
int sqlite3BtreeGetMeta (Btree *p, int idx, u32 *pMeta)
int sqlite3BtreeUpdateMeta (Btree *p, int idx, u32 iMeta)
int sqlite3BtreeFlags (BtCursor *pCur)
Pagersqlite3BtreePager (Btree *p)
static void checkAppendMsg (IntegrityCk *pCheck, char *zMsg1, const char *zFormat,...)
static int checkRef (IntegrityCk *pCheck, int iPage, char *zContext)
static void checkPtrmap (IntegrityCk *pCheck, Pgno iChild, u8 eType, Pgno iParent, char *zContext)
static void checkList (IntegrityCk *pCheck, int isFreeList, int iPage, int N, char *zContext)
static int checkTreePage (IntegrityCk *pCheck, int iPage, MemPage *pParent, char *zParentContext)
char * sqlite3BtreeIntegrityCheck (Btree *p, int *aRoot, int nRoot, int mxErr, int *pnErr)
const char * sqlite3BtreeGetFilename (Btree *p)
const char * sqlite3BtreeGetDirname (Btree *p)
const char * sqlite3BtreeGetJournalname (Btree *p)
static int btreeCopyFile (Btree *pTo, Btree *pFrom)
int sqlite3BtreeCopyFile (Btree *pTo, Btree *pFrom)
int sqlite3BtreeIsInTrans (Btree *p)
int sqlite3BtreeIsInStmt (Btree *p)
int sqlite3BtreeIsInReadTrans (Btree *p)
void * sqlite3BtreeSchema (Btree *p, int nBytes, void(*xFree)(void *))
int sqlite3BtreeSchemaLocked (Btree *p)
int sqlite3BtreeLockTable (Btree *p, int iTab, u8 isWriteLock)
int sqlite3BtreePutData (BtCursor *pCsr, u32 offset, u32 amt, void *z)
void sqlite3BtreeCacheOverflow (BtCursor *pCur)

Variables

static const char zMagicHeader [] = SQLITE_FILE_HEADER
static BtShared *SQLITE_WSD sqlite3SharedCacheList = 0

Define Documentation

#define assertCellInfo (  ) 

Definition at line 2949 of file btree.c.

#define assertParentIndex ( x,
y,
 ) 

Definition at line 3493 of file btree.c.

Referenced by balance_nonroot(), and sqlite3BtreeMoveToParent().

#define findCell ( P,
 )     ((P)->aData + ((P)->maskPage & get2byte(&(P)->aData[(P)->cellOffset+2*(I)])))
#define getCellInfo ( pCur   ) 
Value:
if( pCur->info.nSize==0 ){                                                   \
    int iPage = pCur->iPage;                                                   \
    sqlite3BtreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info); \
    pCur->validNKey = 1;                                                       \
  }else{                                                                       \
    assertCellInfo(pCur);                                                      \
  }

Definition at line 2964 of file btree.c.

Referenced by accessPayload(), fetchPayload(), sqlite3BtreeDataSize(), sqlite3BtreeKeySize(), and sqlite3BtreeLast().

#define NB   (NN*2+1)

Definition at line 4758 of file btree.c.

Referenced by balance_nonroot().

#define NN   1

Definition at line 4757 of file btree.c.

Referenced by balance_nonroot().

#define parseCell ( pPage,
iCell,
pInfo   )     sqlite3BtreeParseCellPtr((pPage), findCell((pPage), (iCell)), (pInfo))

Definition at line 639 of file btree.c.

Referenced by sqlite3BtreeParseCell().

#define restoreCursorPosition (  ) 
#define TRACE (  ) 
#define VVA_ONLY (  ) 

Function Documentation

static int accessPayload ( BtCursor pCur,
int  offset,
int  amt,
unsigned char *  pBuf,
int  skipKey,
int  eOp 
) [static]
static int allocateBtreePage ( BtShared pBt,
MemPage **  ppPage,
Pgno pPgno,
Pgno  nearby,
u8  exact 
) [static]
static int allocateSpace ( MemPage pPage,
int  nByte 
) [static]
static void allocateTempSpace ( BtShared pBt  )  [static]

Definition at line 1475 of file btree.c.

References BtShared::pageSize, BtShared::pTmpSpace, and sqlite3PageMalloc().

Referenced by sqlite3BtreeDelete(), and sqlite3BtreeInsert().

static void assemblePage ( MemPage pPage,
int  nCell,
u8 **  apCell,
u16 aSize 
) [static]
static int autoVacuumCommit ( BtShared pBt,
Pgno pnTrunc 
) [static]
static int balance ( BtCursor pCur,
int  isInsert 
) [static]
static int balance_deeper ( BtCursor pCur  )  [static]
static int balance_nonroot ( BtCursor pCur  )  [static]
static int balance_quick ( BtCursor pCur  )  [static]
static int balance_shallower ( BtCursor pCur  )  [static]
static int btreeCopyFile ( Btree pTo,
Btree pFrom 
) [static]
static int btreeCreateTable ( Btree p,
int *  piTable,
int  flags 
) [static]
static int btreeCursor ( Btree p,
int  iTable,
int  wrFlag,
struct KeyInfo pKeyInfo,
BtCursor pCur 
) [static]
static int btreeDropTable ( Btree p,
int  iTable,
int *  piMoved 
) [static]
static MemPage* btreePageFromDbPage ( DbPage pDbPage,
Pgno  pgno,
BtShared pBt 
) [static]
static u16 cellSizePtr ( MemPage pPage,
u8 pCell 
) [static]
static void checkAppendMsg ( IntegrityCk pCheck,
char *  zMsg1,
const char *  zFormat,
  ... 
) [static]
static void checkList ( IntegrityCk pCheck,
int  isFreeList,
int  iPage,
int  N,
char *  zContext 
) [static]
static void checkPtrmap ( IntegrityCk pCheck,
Pgno  iChild,
u8  eType,
Pgno  iParent,
char *  zContext 
) [static]

Definition at line 6609 of file btree.c.

References checkAppendMsg(), IntegrityCk::pBt, ptrmapGet(), and SQLITE_OK.

Referenced by checkList(), checkTreePage(), and sqlite3BtreeIntegrityCheck().

static int checkReadLocks ( Btree pBtree,
Pgno  pgnoRoot,
BtCursor pExclude,
i64  iRow 
) [static]
static int checkRef ( IntegrityCk pCheck,
int  iPage,
char *  zContext 
) [static]

Definition at line 6590 of file btree.c.

References IntegrityCk::anRef, checkAppendMsg(), and IntegrityCk::nPage.

Referenced by checkList(), and checkTreePage().

static int checkTreePage ( IntegrityCk pCheck,
int  iPage,
MemPage pParent,
char *  zParentContext 
) [static]
static int clearCell ( MemPage pPage,
unsigned char *  pCell 
) [static]
static int clearDatabasePage ( BtShared pBt,
Pgno  pgno,
MemPage pParent,
int  freePageFlag,
int *  pnChange 
) [static]
static int copyPayload ( void *  pPayload,
void *  pBuf,
int  nByte,
int  eOp,
DbPage pDbPage 
) [static]

Definition at line 3120 of file btree.c.

References sqlite3PagerWrite(), and SQLITE_OK.

Referenced by accessPayload().

static int decodeFlags ( MemPage pPage,
int  flagByte 
) [static]
static int defragmentPage ( MemPage pPage  )  [static]
static int dropCell ( MemPage pPage,
int  idx,
int  sz 
) [static]
static const unsigned char* fetchPayload ( BtCursor pCur,
int *  pAmt,
int  skipKey 
) [static]
static int fillInCell ( MemPage pPage,
unsigned char *  pCell,
const void *  pKey,
i64  nKey,
const void *  pData,
int  nData,
int  nZero,
int *  pnSize 
) [static]
static u8* findOverflowCell ( MemPage pPage,
int  iCell 
) [static]
static int freePage ( MemPage pPage  )  [static]
static void freeSpace ( MemPage pPage,
int  start,
int  size 
) [static]
static void freeTempSpace ( BtShared pBt  )  [static]

Definition at line 1484 of file btree.c.

References BtShared::pTmpSpace, and sqlite3PageFree().

Referenced by lockBtree(), sqlite3BtreeClose(), and sqlite3BtreeSetPageSize().

static int getAndInitPage ( BtShared pBt,
Pgno  pgno,
MemPage **  ppPage 
) [static]
static int getOverflowPage ( BtShared pBt,
Pgno  ovfl,
MemPage **  ppPage,
Pgno pPgnoNext 
) [static]
static int incrVacuumStep ( BtShared pBt,
Pgno  nFin 
) [static]
static int insertCell ( MemPage pPage,
int  i,
u8 pCell,
int  sz,
u8 pTemp,
u8  nSkip 
) [static]
static void invalidateAllOverflowCache ( BtShared pBt  )  [static]
static void invalidateOverflowCache ( BtCursor pCur  )  [static]
static int lockBtree ( BtShared pBt  )  [static]
static int lockBtreeWithRetry ( Btree pRef  )  [static]
static int lockTable ( Btree p,
Pgno  iTable,
u8  eLock 
) [static]
static int modifyPagePointer ( MemPage pPage,
Pgno  iFrom,
Pgno  iTo,
u8  eType 
) [static]
static int moveToChild ( BtCursor pCur,
u32  newPgno 
) [static]
static int moveToLeftmost ( BtCursor pCur  )  [static]
static int moveToRightmost ( BtCursor pCur  )  [static]
static int moveToRoot ( BtCursor pCur  )  [static]
static int newDatabase ( BtShared pBt  )  [static]
static void pageReinit ( DbPage pData  )  [static]
static int pagerPagecount ( Pager pPager  )  [static]
static int ptrmapGet ( BtShared pBt,
Pgno  key,
u8 pEType,
Pgno pPgno 
) [static]
static Pgno ptrmapPageno ( BtShared pBt,
Pgno  pgno 
) [static]

Definition at line 437 of file btree.c.

References BtShared::mutex, PENDING_BYTE_PAGE, sqlite3_mutex_held, and BtShared::usableSize.

static int ptrmapPut ( BtShared pBt,
Pgno  key,
u8  eType,
Pgno  parent 
) [static]
static int ptrmapPutOvfl ( MemPage pPage,
int  iCell 
) [static]
static int ptrmapPutOvflPtr ( MemPage pPage,
u8 pCell 
) [static]
static int queryTableLock ( Btree p,
Pgno  iTab,
u8  eLock 
) [static]
static void releasePage ( MemPage pPage  )  [static]
static int relocatePage ( BtShared pBt,
MemPage pDbPage,
u8  eType,
Pgno  iPtrPage,
Pgno  iFreePage,
int  isCommit 
) [static]
static int removeFromSharingList ( BtShared pBt  )  [static]
static int saveAllCursors ( BtShared pBt,
Pgno  iRoot,
BtCursor pExcept 
) [static]
static int saveCursorPosition ( BtCursor pCur  )  [static]
static int setChildPtrmaps ( MemPage pPage  )  [static]
int sqlite3_enable_shared_cache ( int  enable  ) 

Definition at line 75 of file btree.c.

References sqlite3GlobalConfig, and SQLITE_OK.

int sqlite3BtreeBeginStmt ( Btree p  ) 
int sqlite3BtreeBeginTrans ( Btree p,
int  wrflag 
)
void sqlite3BtreeCacheOverflow ( BtCursor pCur  ) 
void sqlite3BtreeClearCursor ( BtCursor pCur  ) 
int sqlite3BtreeClearTable ( Btree p,
int  iTable,
int *  pnChange 
)
int sqlite3BtreeClose ( Btree p  ) 
int sqlite3BtreeCloseCursor ( BtCursor pCur  ) 
int sqlite3BtreeCommit ( Btree p  ) 
int sqlite3BtreeCommitPhaseOne ( Btree p,
const char *  zMaster 
)
int sqlite3BtreeCommitPhaseTwo ( Btree p  ) 
int sqlite3BtreeCommitStmt ( Btree p  ) 
int sqlite3BtreeCopyFile ( Btree pTo,
Btree pFrom 
)

Definition at line 7255 of file btree.c.

References btreeCopyFile(), sqlite3BtreeEnter, and sqlite3BtreeLeave.

Referenced by sqlite3RunVacuum().

int sqlite3BtreeCreateTable ( Btree p,
int *  piTable,
int  flags 
)

Definition at line 6197 of file btree.c.

References btreeCreateTable(), Btree::db, BtShared::db, Btree::pBt, sqlite3BtreeEnter, and sqlite3BtreeLeave.

Referenced by sqlite3VdbeExec().

int sqlite3BtreeCursor ( Btree p,
int  iTable,
int  wrFlag,
struct KeyInfo pKeyInfo,
BtCursor pCur 
)
sqlite3* sqlite3BtreeCursorDb ( const BtCursor pCur  ) 

Definition at line 3895 of file btree.c.

References Btree::db, sqlite3::mutex, BtCursor::pBtree, and sqlite3_mutex_held.

Referenced by sqlite3VdbeMemFromBtree().

int sqlite3BtreeCursorHasMoved ( BtCursor pCur,
int *  pHasMoved 
)

Definition at line 415 of file btree.c.

References CURSOR_VALID, BtCursor::eState, restoreCursorPosition, BtCursor::skip, and SQLITE_OK.

Referenced by sqlite3VdbeCursorMoveto().

int sqlite3BtreeCursorSize ( void   ) 

Definition at line 2861 of file btree.c.

Referenced by allocateCursor(), schemaIsValid(), and sqlite3InitOne().

int sqlite3BtreeData ( BtCursor pCur,
u32  offset,
u32  amt,
void *  pBuf 
)
const void* sqlite3BtreeDataFetch ( BtCursor pCur,
int *  pAmt 
)

Definition at line 3437 of file btree.c.

References CURSOR_VALID, BtCursor::eState, and fetchPayload().

Referenced by sqlite3VdbeExec(), and sqlite3VdbeMemFromBtree().

int sqlite3BtreeDataSize ( BtCursor pCur,
u32 pSize 
)
int sqlite3BtreeDelete ( BtCursor pCur  ) 
int sqlite3BtreeDropTable ( Btree p,
int  iTable,
int *  piMoved 
)

Definition at line 6414 of file btree.c.

References btreeDropTable(), Btree::db, BtShared::db, Btree::pBt, sqlite3BtreeEnter, and sqlite3BtreeLeave.

Referenced by sqlite3VdbeExec().

int sqlite3BtreeEof ( BtCursor pCur  ) 

Definition at line 3884 of file btree.c.

References CURSOR_VALID, and BtCursor::eState.

Referenced by sqlite3VdbeExec().

int sqlite3BtreeFirst ( BtCursor pCur,
int *  pRes 
)
int sqlite3BtreeFlags ( BtCursor pCur  ) 
int sqlite3BtreeGetAutoVacuum ( Btree p  ) 
const char* sqlite3BtreeGetDirname ( Btree p  ) 

Definition at line 7027 of file btree.c.

References Btree::pBt, BtShared::pPager, and sqlite3PagerDirname().

Referenced by vdbeCommit().

const char* sqlite3BtreeGetFilename ( Btree p  ) 

Definition at line 7016 of file btree.c.

References Btree::pBt, BtShared::pPager, and sqlite3PagerFilename().

Referenced by sqlite3Pragma(), and vdbeCommit().

const char* sqlite3BtreeGetJournalname ( Btree p  ) 

Definition at line 7040 of file btree.c.

References Btree::pBt, BtShared::pPager, and sqlite3PagerJournalname().

Referenced by vdbeCommit().

int sqlite3BtreeGetMeta ( Btree p,
int  idx,
u32 pMeta 
)
int sqlite3BtreeGetPage ( BtShared pBt,
Pgno  pgno,
MemPage **  ppPage,
int  noContent 
)
int sqlite3BtreeGetPageSize ( Btree p  ) 

Definition at line 1649 of file btree.c.

References BtShared::pageSize, and Btree::pBt.

Referenced by sqlite3Pragma(), and sqlite3RunVacuum().

int sqlite3BtreeGetReserve ( Btree p  ) 
void sqlite3BtreeGetTempCursor ( BtCursor pCur,
BtCursor pTempCur 
)
int sqlite3BtreeIncrVacuum ( Btree p  ) 
int sqlite3BtreeInitPage ( MemPage pPage  ) 
int sqlite3BtreeInsert ( BtCursor pCur,
const void *  pKey,
i64  nKey,
const void *  pData,
int  nData,
int  nZero,
int  appendBias 
)
char* sqlite3BtreeIntegrityCheck ( Btree p,
int *  aRoot,
int  nRoot,
int  mxErr,
int *  pnErr 
)
static int sqlite3BtreeInvokeBusyHandler ( void *  pArg,
int  n 
) [static]
int sqlite3BtreeIsInReadTrans ( Btree p  ) 

Definition at line 7286 of file btree.c.

References Btree::db, Btree::inTrans, sqlite3::mutex, sqlite3_mutex_held, and TRANS_NONE.

Referenced by detachFunc(), and invalidateTempStorage().

int sqlite3BtreeIsInStmt ( Btree p  ) 

Definition at line 7278 of file btree.c.

References BtShared::inStmt, and Btree::pBt.

Referenced by sqlite3VdbeExec().

int sqlite3BtreeIsInTrans ( Btree p  ) 
int sqlite3BtreeKey ( BtCursor pCur,
u32  offset,
u32  amt,
void *  pBuf 
)
const void* sqlite3BtreeKeyFetch ( BtCursor pCur,
int *  pAmt 
)

Definition at line 3430 of file btree.c.

References CURSOR_VALID, BtCursor::eState, and fetchPayload().

Referenced by sqlite3VdbeExec(), and sqlite3VdbeMemFromBtree().

int sqlite3BtreeKeySize ( BtCursor pCur,
i64 pSize 
)
int sqlite3BtreeLast ( BtCursor pCur,
int *  pRes 
)
int sqlite3BtreeLockTable ( Btree p,
int  iTab,
u8  isWriteLock 
)
int sqlite3BtreeMaxPageCount ( Btree p,
int  mxPage 
)
int sqlite3BtreeMoveto ( BtCursor pCur,
const void *  pKey,
i64  nKey,
int  bias,
int *  pRes 
)
void sqlite3BtreeMoveToParent ( BtCursor pCur  ) 
int sqlite3BtreeMovetoUnpacked ( BtCursor pCur,
UnpackedRecord pIdxKey,
i64  intKey,
int  biasRight,
int *  pRes 
)
int sqlite3BtreeNext ( BtCursor pCur,
int *  pRes 
)
int sqlite3BtreeOpen ( const char *  zFilename,
sqlite3 db,
Btree **  ppBtree,
int  flags,
int  vfsFlags 
)
Pager* sqlite3BtreePager ( Btree p  )  [read]
void sqlite3BtreeParseCell ( MemPage pPage,
int  iCell,
CellInfo pInfo 
)

Definition at line 641 of file btree.c.

References parseCell.

void sqlite3BtreeParseCellPtr ( MemPage pPage,
u8 pCell,
CellInfo pInfo 
)
int sqlite3BtreePrevious ( BtCursor pCur,
int *  pRes 
)
int sqlite3BtreePutData ( BtCursor pCsr,
u32  offset,
u32  amt,
void *  z 
)
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  ) 
int sqlite3BtreeRollback ( Btree p  ) 
int sqlite3BtreeRollbackStmt ( Btree p  ) 
void* sqlite3BtreeSchema ( Btree p,
int  nBytes,
void(*)(void *)  xFree 
)
int sqlite3BtreeSchemaLocked ( Btree p  ) 
int sqlite3BtreeSetAutoVacuum ( Btree p,
int  autoVacuum 
)
int sqlite3BtreeSetCacheSize ( Btree p,
int  mxPage 
)
int sqlite3BtreeSetPageSize ( Btree p,
int  pageSize,
int  nReserve 
)
int sqlite3BtreeSetSafetyLevel ( Btree p,
int  level,
int  fullSync 
)
int sqlite3BtreeSyncDisabled ( Btree p  ) 
void sqlite3BtreeTripAllCursors ( Btree pBtree,
int  errCode 
)
int sqlite3BtreeUpdateMeta ( Btree p,
int  idx,
u32  iMeta 
)
static void unlockAllTables ( Btree p  )  [static]
static void unlockBtreeIfUnused ( BtShared pBt  )  [static]
static void zeroPage ( MemPage pPage,
int  flags 
) [static]

Variable Documentation

BtShared* SQLITE_WSD sqlite3SharedCacheList = 0 [static]

Definition at line 63 of file btree.c.

Referenced by removeFromSharingList(), and sqlite3BtreeOpen().

const char zMagicHeader[] = SQLITE_FILE_HEADER [static]

Definition at line 24 of file btree.c.

Referenced by lockBtree(), and newDatabase().


ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1