Home | History | Annotate | Download | only in dist

Lines Matching defs:btree

9986 ** Defer sourcing vdbe.h and btree.h until after the "u8" and 
9990 /************** Include btree.h in the middle of sqliteInt.h *****************/
9991 /************** Begin file btree.h *******************************************/
10030 typedef struct Btree Btree;
10039 Btree **ppBtree, /* Return open Btree* here */
10055 SQLITE_PRIVATE int sqlite3BtreeClose(Btree*);
10056 SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int);
10058 SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree*,sqlite3_int64);
10060 SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags(Btree*,unsigned);
10061 SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*);
10062 SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix);
10063 SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*);
10064 SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int);
10065 SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*);
10066 SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int);
10067 SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree*);
10068 SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p);
10069 SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int);
10070 SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *);
10071 SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int);
10072 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster);
10073 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*, int);
10074 SQLITE_PRIVATE int sqlite3BtreeCommit(Btree*);
10075 SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*,int,int);
10076 SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*,int);
10077 SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, int*, int flags);
10078 SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree*);
10079 SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree*);
10080 SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree*);
10081 SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
10082 SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *pBtree);
10083 SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *pBtree, int iTab, u8 isWriteLock);
10084 SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *, int, int);
10086 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
10087 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
10088 SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
10090 SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);
10105 SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*);
10106 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, int*);
10108 SQLITE_PRIVATE int sqlite3BtreeTripAllCursors(Btree*, int, int);
10110 SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue);
10111 SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
10113 SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p);
10160 Btree*, /* BTree containing table to open */
10195 SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
10196 SQLITE_PRIVATE struct Pager *sqlite3BtreePager(Btree*);
10201 SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBt, int iVersion);
10206 SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *pBt);
10219 SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
10223 SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
10232 SQLITE_PRIVATE void sqlite3BtreeEnter(Btree*);
10240 SQLITE_PRIVATE int sqlite3BtreeSharable(Btree*);
10241 SQLITE_PRIVATE void sqlite3BtreeLeave(Btree*);
10247 SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree*);
10267 /************** End of btree.h ***********************************************/
10832 ** NOTE: These values must match the corresponding BTREE_ values in btree.h.
11530 Btree *pBt; /* The B*Tree structure for this database file */
11538 ** Most Schema objects are associated with a Btree. The exception is
11543 ** Schema objects are automatically deallocated when the last Btree that
11547 ** A thread must be holding a mutex on the corresponding Btree in order
11549 ** holding a mutex on the sqlite3 connection pointer that owns the Btree.
11837 #define SQLITE_CellSizeCk 0x10000000 /* Check btree cell sizes on load */
12193 int tnum; /* Root BTree page for this table */
13848 SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
14224 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
15297 ** A cursor is a pointer into a single BTree within a database file.
15298 ** The cursor can seek to a BTree entry with a particular key, or
15299 ** loop over all entries of the Btree. You can also insert new BTree
15311 Btree *pBt; /* Separate file holding temporary table */
15327 Pgno pgnoRoot; /* Root page of the open btree cursor */
15961 Btree *pBt = db->aDb[i].pBt;
41163 ** is the extension added by the btree.c module containing information such
41189 ** The btree.c module deals with pointers to MemPage objects.
43592 ** 28 of the database header by the btree). If the size of the file
46772 /* This routine is only called by btree immediately after creating
47822 /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */
49665 ** behavior. But when the Btree needs to know the filename for matching to
53515 ** This file contains code used to implement mutexes on Btree objects.
53516 ** This code really belongs in btree.c. But btree.c is getting too
53557 ** BTrees. Each BTree is identified by the index of its root page. The
53571 ** Each page can be either a btree page, a freelist page, an overflow
53574 ** The first page is always a btree page. The first 100 bytes of the first
53627 ** Each btree pages is divided into three sections: The header, the
53657 ** The flags define the format of this btree page. The leaf flag means that
53708 ** bytes of key and data in a btree cell.
53775 ** first byte of on-disk image of every BTree page.
53788 ** walk up the BTree from any leaf to the root. Care must be taken to
53838 ** a btree handle is closed.
53841 Btree *pBtree; /* Btree handle holding this lock */
53851 /* A Btree handle
53868 ** in the referenced BtShared that point back to this Btree since those
53869 ** cursors have to go through this Btree to find their BtShared and
53872 struct Btree {
53873 sqlite3 *db; /* The database connection holding this btree */
53874 BtShared *pBt; /* Sharable content of this btree */
53880 int nBackup; /* Number of backup operations reading this btree */
53882 Btree *pNext; /* List of other sharable Btrees from the same db */
53883 Btree *pPrev; /* Back pointer of the same list */
53890 ** Btree.inTrans may take one of the following values.
53893 ** of the Btree structure. At most one of these may open a write transaction,
53906 ** private Btree object for the file and each of those Btrees points
53937 sqlite3 *db; /* Database connection currently using this Btree */
53967 BtLock *pLock; /* List of locks held on this shared-btree struct */
53968 Btree *pWriter; /* Btree with currently open write transaction */
54029 Btree *pBtree; /* The Btree to which this cursor belongs */
54063 #define BTCF_Multiple 0x20 /* Maybe another cursor on the same btree */
54153 ** PTRMAP_BTREE: The database page is a non-root btree page. The page number
54154 ** identifies the parent page in the btree.
54163 ** of handle p (type Btree*) are internally consistent.
54220 ** cell addresses in a btree header.
54244 static void lockBtreeMutex(Btree *p){
54258 static void SQLITE_NOINLINE unlockBtreeMutex(Btree *p){
54270 static void SQLITE_NOINLINE btreeLockCarefully(Btree *p);
54273 ** Enter a mutex on the given BTree object.
54277 ** But we keep a reference count in Btree.wantToLock so the behavior
54282 ** Btrees belonging to the same database connection as the p Btree
54288 SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *p){
54289 /* Some basic sanity checking on the Btree. The list of Btrees
54291 ** Btree.pBt value. All elements of the list should belong to
54322 static void SQLITE_NOINLINE btreeLockCarefully(Btree *p){
54323 Btree *pLater;
54358 ** Exit the recursive mutex on a Btree.
54360 SQLITE_PRIVATE void sqlite3BtreeLeave(Btree *p){
54373 ** Return true if the BtShared mutex is held on the btree, or if the
54378 SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *p){
54391 ** Enter and leave a mutex on a Btree given a cursor owned by that
54392 ** Btree. These entry points are used by incremental I/O and can be
54405 ** Enter the mutex on every Btree associated with a database
54420 Btree *p;
54429 Btree *p;
54438 ** Return true if a particular Btree requires a lock. Return FALSE if
54441 SQLITE_PRIVATE int sqlite3BtreeSharable(Btree *p){
54458 Btree *p;
54482 Btree *p;
54499 ** are null #defines in btree.h.
54501 ** If shared cache is disabled, then all btree mutex routines, including
54502 ** the ones below, are no-ops and are null #defines in btree.h.
54505 SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *p){
54511 Btree *p = db->aDb[i].pBt;
54521 /************** Begin file btree.c *******************************************/
54561 ** from the header of a btree page. If the page size is 65536 and the page
54646 ** Btree connection pBtree:
54662 Btree *pBtree, /* Handle that must hold lock */
54737 ** It is illegal for pBtree to write if some other Btree object that
54739 ** the iRoot table. Except, if the other Btree object has the
54748 static int hasReadConflicts(Btree *pBtree, Pgno iRoot){
54763 ** Query to see if Btree handle p may obtain a lock of type eLock
54768 static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
54777 /* If requesting a write-lock, then the Btree must have an open write
54824 ** Add a lock on the table with root-page iTable to the shared-btree used
54825 ** by Btree handle p. Parameter eLock must be either READ_LOCK or
54830 ** (a) The specified Btree object p is connected to a sharable
54833 ** (b) No other Btree objects hold a lock that conflicts
54840 static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){
54868 /* If the above search did not find a BtLock struct associating Btree p
54898 ** the setSharedCacheTableLock() procedure) held by Btree object p.
54900 ** This function assumes that Btree p has an open read or write
54904 static void clearAllSharedCacheTableLocks(Btree *p){
54932 /* This function is called when Btree p is concluding its
54946 ** This function changes all write-locks held by Btree p into read-locks.
54948 static void downgradeAllSharedCacheTableLocks(Btree *p){
54978 ** on the shared btree structure pBt.
54984 ** on the shared btree structure pBt.
55009 Btree *pBtree, /* The database file to check */
55195 ** the location in the btree is remembered in such a way that it can be
55196 ** moved back to the same spot after the btree has been modified. This
55200 ** If there are two or more cursors on the same btree, then all such
55268 BtCursor *pCur, /* Cursor open on the btree to be searched */
55269 const void *pKey, /* Packed key if the btree is an index */
55338 ** from under them, for example. Cursor might also move if a btree
55352 ** has been moved by some outside activity (such as a btree rebalance or
55506 ** Given a btree page and a cell index (0 means the first cell on
55565 ** btreeParseCellPtr() => table btree leaf nodes
55566 ** btreeParseCellNoPayload() => table btree internal nodes
55567 ** btreeParseCellPtrIndex() => index btree nodes
55715 ** data area of the btree-page. The return number includes the cell
56248 BtShared *pBt; /* The main btree structure */
56401 ** the btree layer.
56425 BtShared *pBt, /* The btree */
56463 SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree *p){
56558 BtShared *pBt, /* The btree */
56594 /* pPage might not be a btree page; it might be an overflow page
56598 ** btreeInitPage() be called on every btree page so we make
56606 ** Invoke the busy handler for a btree.
56638 const char *zFilename, /* Name of the file containing the BTree database */
56640 Btree **ppBtree, /* Pointer to new Btree object written here */
56644 BtShared *pBt = 0; /* Shared part of btree structure */
56645 Btree *p; /* Handle to return */
56682 p = sqlite3MallocZero(sizeof(Btree));
56695 ** If this Btree is a candidate for shared cache, try to find an
56733 Btree *pExisting = db->aDb[iDb].pBt;
56764 ** The following asserts make sure that structures used by the btree are
56859 /* If the new Btree uses a sharable pBtShared, then link the new
56860 ** Btree into the list of all sharable Btrees for the same connection.
56865 Btree *pSib;
57000 SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
57023 /* If there are still other outstanding references to the shared-btree
57025 ** up the shared-btree.
57070 SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
57084 SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree *p, sqlite3_int64 szMmap){
57104 Btree *p, /* The btree to set the safety level on */
57117 ** Return TRUE if the given btree is set to safety level 1. In other
57120 SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree *p){
57151 SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){
57184 SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){
57199 SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p){
57215 SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree *p){
57232 SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree *p, int mxPage){
57245 SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){
57264 SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
57288 SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){
57573 SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){
57617 SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
57625 /* If the btree is already in a write-transaction, or it
57642 ** on this shared-btree structure and a second write transaction is
57803 ** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child
57806 ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
57875 BtShared *pBt, /* Btree */
57901 /* If pDbPage was a btree-page, then it may have child pages and/or cells
58089 SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
58199 ** Otherwise, sync the database file for the btree pBt. zMaster points to
58210 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
58237 static void btreeEndTransaction(Btree *p){
58253 ** transaction count of the shared btree. If the transaction count
58299 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){
58331 SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
58368 SQLITE_PRIVATE int sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode, int writeOnly){
58411 SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode, int writeOnly){
58480 SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p, int iStatement){
58511 SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){
58537 ** Create a new cursor for the BTree whose root is on the page
58569 Btree *p, /* The btree */
58613 /* If there are two or more cursors on the same btree, then all such
58627 Btree *p, /* The btree */
58673 Btree *pBtree = pCur->pBtree;
58934 MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */
58935 BtShared *pBt = pCur->pBt; /* Btree this cursor belongs to */
58959 /* Check if data must be read/written to/from the btree page itself. */
59182 ** any btree routine is called.
59210 ** or be destroyed on the next call to any Btree routine,
59786 ** Zero is the common case. The btree implementation is free to use the
59788 ** SQLite btree implementation does not. (Note that the comdb2 btree
59896 ** Zero is the common case. The btree implementation is free to use the
59898 ** SQLite btree implementation does not. (Note that the comdb2 btree
60001 BtShared *pBt, /* The btree */
61674 ** offset section of the btree page will be overwritten and we will no
62236 BtShared *pBt = pRoot->pBt; /* The BTree */
62405 ** Insert a new record into the BTree. The key is given by (pKey,nKey)
62439 Btree *p = pCur->pBtree;
62586 Btree *p = pCur->pBtree;
62736 ** Create a new BTree table. Write into *piTable the page
62746 static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){
62889 SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
62902 BtShared *pBt, /* The BTree that contains the table */
62968 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){
63016 static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
63119 SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
63148 SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
63178 SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
63278 ** Return the pager associated with a BTree. This routine is used for
63281 SQLITE_PRIVATE Pager *sqlite3BtreePager(Btree *p){
63478 ** entry represents the span of a cell or freeblock on a btree page.
63778 ** This routine does a complete check of the given BTree file. aRoot[] is
63791 Btree *p, /* The btree to be checked */
63907 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
63920 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
63928 SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *p){
63935 ** Run a checkpoint on the Btree passed as the first argument.
63938 ** transaction on the shared-cache the argument Btree is connected to.
63942 SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree *p, int eMode, int *pnLog, int *pnCkpt){
63961 SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree *p){
63967 SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree *p){
63975 ** a single shared-btree. The memory is used by client code for its own
63977 ** the shared-btree). The btree layer manages reference counting issues.
63979 ** The first time this is called on a shared-btree, nBytes bytes of memory
63988 ** Just before the shared-btree is closed, the function passed as the
63991 ** on the memory, the btree layer does that.
63993 SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
64006 ** btree as the argument handle holds an exclusive lock on the
64009 SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *p){
64026 SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
64115 SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){
64165 ** Return true if the given Btree is read-only.
64167 SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *p){
64176 /************** End of btree.c ***********************************************/
64200 Btree *pDest; /* Destination b-tree file */
64206 Btree *pSrc; /* Source b-tree file */
64245 ** the Btree objects may have their own mutexes that require locking.
64259 static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
64308 static int checkReadTransaction(sqlite3 *db, Btree *p){
64481 ** Then clear the Btree layer MemPage.isInit flag. Both this module
64483 ** of the page 'extra' space to invalidate the Btree layers
64751 ** no need to check the return values of the btree methods here, as
64803 /* If a transaction is still open on the Btree, roll it back. */
64922 SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
65257 ** sqlite3_value_text()), or for ensuring that values to be used as btree
65917 ** Move data out of a btree key or data field and into a Mem structure.
65924 ** pMem->zMalloc to hold the content from the btree, if possible. New
65936 int key, /* If true, retrieve from the btree key, not data. */
65962 int key, /* If true, retrieve from the btree key, not data. */
65965 char *zData; /* Data from the btree layer */
65966 u32 available = 0; /* Number of bytes available on the local btree page */
67908 ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
68736 Btree *pBt = db->aDb[i].pBt;
68770 Btree *pBt = db->aDb[i].pBt;
68782 Btree *pBt = db->aDb[i].pBt;
68852 Btree *pBt = db->aDb[i].pBt;
68897 Btree *pBt = db->aDb[i].pBt;
68930 Btree *pBt = db->aDb[i].pBt;
69006 Btree *pBt = db->aDb[i].pBt;
69549 ** pointed to was deleted out from under it. Or maybe the btree was
71451 Btree *pBt = db->aDb[i].pBt;
75254 BtCursor *pCrsr; /* The BTree cursor */
75893 ** back any currently active btree transactions. If there are any active
75989 Btree *pBt;
76217 Btree *pX;
76300 ** since moved into the btree layer. */
76320 ** The cursor points to a BTree table if P4==0 and to a BTree index
76325 ** in btree.h. These flags control aspects of the operation of
76326 ** the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are
76749 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
76766 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
76785 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
76788 ** P1 index btree has a matching key prefix. If there are no matches, jump
76886 btree (with integer
77606 ** The P3 value is a hint to the btree implementation. If P3==1, that
77639 ** The P3 value is a hint to the btree implementation. If P3==1, that
77971 /* All OP_Destroy operations occur on the same btree */
78104 ** on every btree. This is a prerequisite for invoking
78857 Btree *pBt; /* Btree to change journal mode of */
78972 Btree *pBt;
79434 Btree *pBt;
79736 /* This VDBE program seeks a btree cursor to the identified
92055 /* Open the database file. If the btree is successfully opened, use
94479 ** no rowid btree for a WITHOUT ROWID. Instead, the canonical
94480 ** data storage is a covering index btree.
94531 /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master
95067 ** used by SQLite when the btree layer moves a table root page. The
95110 ** if a root-page of another table is moved by the btree-layer whilst
95138 ** in case a root-page belonging to another table is moved by the btree layer
95253 ** at the btree
95552 int iTab = pParse->nTab++; /* Btree cursor used for pTab */
95553 int iIdx = pParse->nTab++; /* Btree cursor used for pIndex */
96784 Btree *pBt;
97672 ** Find and return the schema associated with a BTree. Create
97675 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){
98294 ** 1. iDataCur is an open cursor on the btree that is the canonical data
98449 ** btree for the table pTab. (This will be either the table itself
103380 u8 pik_flags; /* flag values passed to the btree insert */
106297 Btree *pBt = pDb->pBt;
106323 Btree *pBt = pDb->pBt;
106489 Btree *pBt = pDb->pBt;
107688 Btree *pBt;
108225 Btree *pBt = db->aDb[iDb].pBt; /* Btree database to read cookie from */
108352 Btree *pBt = db->aDb[i].pBt;
115638 ** command. If the latter, then the row-records in the table btree on disk
115704 int iDataCur; /* Cursor for the canonical data btree */
116527 Btree *pMain; /* The database being vacuumed */
116528 Btree *pTemp; /* The temporary database we vacuum into */
116731 /* Copy Btree meta values */
116762 ** was committed at the btree level). So it safe to end the transaction
118143 struct { /* Information for internal btree tables */
118146 } btree;
118546 #define WHERE_INDEXED 0x00000200 /* WhereLoop.u.btree.pIndex is valid */
118605 Index *pIndex = pLoop->u.btree.pIndex;
118606 u16 nEq = pLoop->u.btree.nEq;
118668 || ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
118686 assert( pLoop->u.btree.pIndex!=0 );
118687 pIdx = pLoop->u.btree.pIndex;
118759 if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 && pLoop->u.btree.pIndex!=0 ){
118760 zObj = pLoop->u.btree.pIndex->zName;
118910 && pLoop->u.btree.pIndex!=0
118911 && pLoop->u.btree.pIndex->aSortOrder[iEq]
119023 nEq = pLoop->u.btree.nEq;
119025 pIdx = pLoop->u.btree.pIndex;
119031 nReg = pLoop->u.btree.nEq + nExtraReg;
119255 assert( pLoop->u.btree.nEq==1 );
119410 u16 nEq = pLoop->u.btree.nEq; /* Number of == or IN terms */
119427 pIdx = pLoop->u.btree.pIndex;
119906 && (ii==0 || pSubLoop->u.btree.pIndex==pCov)
119907 && (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex))
119910 pCov = pSubLoop->u.btree.pIndex;
122071 pLoop->u.btree.nEq = pLoop->nLTerm = nKeyCol;
122097 pLoop->u.btree.pIndex = pIdx;
122118 assert( (u32)n==pLoop->u.btree.nEq );
122632 Index *p = pLoop->u.btree.pIndex;
122633 int nEq = pLoop->u.btree.nEq;
122712 ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
122749 Index *p = pLoop->u.btree.pIndex;
122750 int nEq = pLoop->u.btree.nEq;
122918 Index *p = pBuilder->pNew->u.btree.pIndex;
122919 int nEq = pBuilder->pNew->u.btree.nEq;
122983 Index *p = pBuilder->pNew->u.btree.pIndex;
123047 if( p->u.btree.pIndex && (zName = p->u.btree.pIndex->zName)!=0 ){
123053 sqlite3DebugPrintf(".%-16s %2d", zName, p->u.btree.nEq);
123103 }else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){
123104 sqlite3DbFree(db, p->u.btree.pIndex->zColAff);
123105 sqlite3DbFree(db, p->u.btree.pIndex);
123106 p->u.btree.pIndex = 0;
123150 pFrom->u.btree.pIndex = 0;
123451 Index *pIndex = p->u.btree.pIndex;
123453 p->u.btree.pIndex = 0;
123545 ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the
123571 u16 saved_nEq; /* Original value of pNew->u.btree.nEq */
123594 assert( pNew->u.btree.nEq<pProbe->nColumn );
123596 saved_nEq = pNew->u.btree.nEq;
123627 pNew->u.btree.nEq = saved_nEq;
123655 assert( saved_nEq==pNew->u.btree.nEq );
123705 int nEq = ++pNew->u.btree.nEq;
123719 && pNew->u.btree.nEq<=pProbe->nSampleCol
123777 && pNew->u.btree.nEq<pProbe->nColumn
123787 pNew->u.btree.nEq = saved_nEq;
123811 pNew->u.btree.nEq++;
123822 pNew->u.btree.nEq = saved_nEq;
123953 struct SrcList_item *pSrc; /* The FROM clause btree term to add */
124020 pNew->u.btree.nEq = 1;
124022 pNew->u.btree.pIndex = 0;
124061 pNew->u.btree.nEq = 0;
124068 pNew->u.btree.pIndex = pProbe;
124640 }else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
124660 if( j<pLoop->u.btree.nEq
124688 && j>=pLoop->u.btree.nEq
125247 pLoop->u.btree.nEq = 1;
125271 pLoop->u.btree.nEq = j;
125272 pLoop->u.btree.pIndex = pIdx;
125328 ** There are Btree cursors associated with each table. t1 uses cursor
125717 Index *pIx = pLoop->u.btree.pIndex;
125867 VdbeComment((v, "next skip-scan on %s", pLoop->u.btree.pIndex->zName));
125960 pIdx = pLoop->u.btree.pIndex;
131556 Btree *pBt = db->aDb[i].pBt;
131798 Btree *pBt = db->aDb[j].pBt;
132016 Btree *p = db->aDb[i].pBt;
134178 Btree *pBtree;
134593 ** Return the Btree pointer identified by zDbName. Return NULL if not found.
134595 SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
134612 Btree *pBt;
134628 Btree *pBt;
163194 static int statDecodePage(Btree *pBt, StatPage *p){
163291 Btree *pBt = pTab->db->aDb[pTab->iDb].pBt;
163320 Btree *pBt = pTab->db->aDb[pCsr->iDb].pBt;