Lines Matching defs:u32

11609 typedef UINT32_TYPE u32;           /* 4-byte unsigned integer */
11617 ** that can be stored in a u32 without loss of data. The value
11632 typedef u32 tRowcnt; /* 32-bit is the default */
11679 typedef u32 uptr;
12064 SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*);
12109 SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue);
12110 SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
12277 SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*);
12278 SQLITE_PRIVATE const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt);
12279 SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor*);
12280 SQLITE_PRIVATE int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
12285 SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
12429 u32 cnt; /* Number of times this instruction was executed */
12758 SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe*, u32 addr, u8);
12759 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
12760 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
12761 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
12915 typedef u32 Pgno;
13012 SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
13075 SQLITE_PRIVATE u32 sqlite3PagerDataVersion(Pager*);
13153 u32 pageHash; /* Hash of page content */
13787 u32 bDisable; /* Only operate the lookaside when zero */
13891 u32 magic; /* Magic number for detect library misuse */
13910 int (*xTrace)(u32,void*,void*,void*); /* Trace function */
14576 u32 nRef; /* Number of references to this KeyInfo object */
14870 u32 flags; /* Various flags. EP_* See below */
15093 u32 nAlloc; /* Number of entries allocated in a[] below */
15246 u32 selFlags; /* Various SF_* values */
15435 u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */
15535 u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
15536 u32 oldmask; /* Mask of old.* columns referenced */
15537 u32 newmask; /* Mask of new.* columns referenced */
15744 u32 nChar; /* Length of the string so far */
15745 u32 nAlloc; /* Amount of space allocated in zText */
15746 u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
15802 u32 szPma; /* Maximum Sorter PMA size */
16149 SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList*);
16188 SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32);
16189 SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec*, u32);
16190 SQLITE_PRIVATE int sqlite3BitvecTestNotNull(Bitvec*, u32);
16191 SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec*, u32);
16192 SQLITE_PRIVATE void sqlite3BitvecClear(Bitvec*, u32, void*);
16194 SQLITE_PRIVATE u32 sqlite3BitvecSize(Bitvec*);
16247 Expr*,ExprList*,u32,Expr*,Expr*);
16298 SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
16299 SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *);
16396 SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
16440 SQLITE_PRIVATE u32 sqlite3Utf8Read(const u8**);
16459 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *, u32 *);
16468 (u8)((*(A)<(u8)0x80)?((B)=(u32)*(A)),1:sqlite3GetVarint32((A),(u32 *)&(B)))
16470 (u8)(((u32)(B)<(u32)0x80)?(*(A)=(unsigned char)(B)),1:\
16707 SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*);
16758 SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, u32, int*);
16778 SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
16779 SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
17742 u32 cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */
17743 u32 payloadSize; /* Total number of bytes in the record */
17744 u32 szRow; /* Byte available in aRow */
17745 u32 iHdrOffset; /* Offset to next unparsed byte of the header */
17747 u32 *aOffset; /* Pointer to aType[nField] */
17748 u32 aType[1]; /* Type values for all entries in the record */
17827 u32 uTemp; /* Transient storage for serial_type in OP_MakeRecord */
17990 u32 magic; /* Magic number for sanity checking */
17998 u32 cacheCtr; /* VdbeCursor row cache generation counter */
18020 u32 aCounter[5]; /* Counters used by sqlite3_stmt_status() */
18033 u32 expmask; /* Binding to these vars invalidates VM */
18083 SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32);
18085 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int, u32*);
18086 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32);
18087 SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
18122 SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,u32,u32,int,Mem*);
18194 typedef u32 sqlite3StatValueType;
21174 u32 prevSize; /* Size of previous chunk in Mem3Block elements */
21175 u32 size4x; /* 4x the size of current chunk in Mem3Block elements */
21178 u32 next; /* Index in mem3.aPool[] of next free chunk */
21179 u32 prev; /* Index in mem3.aPool[] of previous free chunk */
21195 u32 nPool;
21211 u32 mnMaster;
21219 u32 iMaster;
21220 u32 szMaster;
21227 u32 aiSmall[MX_SMALL-1]; /* For sizes 2 through MX_SMALL, inclusive */
21228 u32 aiHash[N_HASH]; /* For sizes MX_SMALL+1 and larger */
21237 static void memsys3UnlinkFromList(u32 i, u32 *pRoot){
21238 u32 next = mem3.aPool[i].u.list.next;
21239 u32 prev = mem3.aPool[i].u.list.prev;
21257 static void memsys3Unlink(u32 i){
21258 u32 size, hash;
21277 static void memsys3LinkIntoList(u32 i, u32 *pRoot){
21291 static void memsys3Link(u32 i){
21292 u32 size, hash;
21342 static void *memsys3Checkout(u32 i, u32 nBlock){
21343 u32 x;
21360 static void *memsys3FromMaster(u32 nBlock){
21372 u32 newi, x;
21405 static void memsys3Merge(u32 *pRoot){
21406 u32 iNext, prev, size, i, x;
21445 u32 i;
21446 u32 nBlock;
21447 u32 toFree;
21529 u32 size, x;
21682 u32 i, j;
21683 u32 size;
21892 u32 currentOut; /* Current checkout, including internal fragmentation */
21893 u32 currentCount; /* Current number of distinct checkouts */
21894 u32 maxOut; /* Maximum instantaneous currentOut */
21895 u32 maxCount; /* Maximum instantaneous currentCount */
21896 u32 maxRequest; /* Largest allocation (exclusive of internal frag) */
22015 if( (u32)nByte>mem5.maxRequest ){
22071 u32 size, iLogsize;
22086 assert( iBlock+size-1<(u32)mem5.nBlock );
23890 u32 nScratchFree;
24201 assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch );
26836 SQLITE_PRIVATE u32 sqlite3Utf8Read(
27086 u32 c;
27905 u32 u = 0;
28038 u32 a,b,s;
28208 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){
28209 u32 a,b;
28272 *v = (u32)v64;
28321 *v = (u32)v64;
28341 SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
28343 u32 x;
28348 u32 x;
28353 u32 x;
28361 SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
28366 u32 x = __builtin_bswap32(v);
28370 u32 x = _byteswap_ulong(v);
28448 u32 magic;
28465 u32 magic;
33608 (u32)sStat.st_ino, (u32)sStat.st_dev);
37517 u32 magic1; /* Magic number to detect structure corruption. */
37522 u32 magic2; /* Magic number to detect structure corruption. */
43121 (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*))
43135 /* Number of u32 values in hash table. */
43136 #define BITVEC_NINT (BITVEC_USIZE/sizeof(u32))
43171 u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */
43172 u32 nSet; /* Number of bits that are set - only valid for aHash
43175 u32 iDivisor; /* Number of bits handled by each apSub[] entry. */
43177 /* Max iDivisor is max(u32) / BITVEC_NPTR + 1. */
43181 u32 aHash[BITVEC_NINT]; /* Hash table representation */
43191 SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32 iSize){
43206 SQLITE_PRIVATE int sqlite3BitvecTestNotNull(Bitvec *p, u32 i){
43211 u32 bin = i/p->iDivisor;
43221 u32 h = BITVEC_HASH(i++);
43229 SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec *p, u32 i){
43245 SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec *p, u32 i){
43246 u32 h;
43252 u32 bin = i/p->iDivisor;
43289 u32 *aiValues = sqlite3StackAllocRaw(0, sizeof(p->u.aHash));
43316 SQLITE_PRIVATE void sqlite3BitvecClear(Bitvec *p, u32 i, void *pBuf){
43321 u32 bin = i/p->iDivisor;
43332 u32 *aiValues = pBuf;
43338 u32 h = BITVEC_HASH(aiValues[j]-1);
43368 SQLITE_PRIVATE u32 sqlite3BitvecSize(Bitvec *p){
46226 SQLITE_PRIVATE int sqlite3WalFindFrame(Wal *, Pgno, u32 *);
46227 SQLITE_PRIVATE int sqlite3WalReadFrame(Wal *, u32, int, u8 *);
46241 SQLITE_PRIVATE void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData);
46245 SQLITE_PRIVATE int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData);
46730 u32 aWalData[WAL_SAVEPOINT_NDATA]; /* WAL savepoint context */
46936 u32 cksumInit; /* Quasi-random value added to every checksum */
46937 u32 nSubRec; /* Number of records written to sub-journal */
46947 u32 iDataVersion; /* Changes whenever database content changes */
46959 u32 vfsFlags; /* Flags for sqlite3_vfs.xOpen() */
46960 u32 sectorSize; /* Assumed sector size during rollback */
47337 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
47356 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
47464 static u32 pager_datahash(int nByte, unsigned char *pData){
47465 u32 hash = 0;
47472 static u32 pager_pagehash(PgHdr *pPage){
47523 static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){
47525 u32 len; /* Length in bytes of master journal name */
47527 u32 cksum; /* MJ checksum value read from journal */
47528 u32 u; /* Unsigned loop counter */
47663 u32 nHeader = (u32)pPager->pageSize;/* Size of buffer pointed to by zHeader */
47664 u32 nWrite; /* Bytes of header sector written */
47782 u32 *pNRec, /* OUT: Value read from the nRec field */
47783 u32 *pDbSize /* OUT: Value of original database size field */
47828 u32 iPageSize; /* Page-size field of journal header */
47829 u32 iSectorSize; /* Sector-size field of journal header */
47908 u32 cksum = 0; /* Checksum of string zMaster */
47980 SQLITE_PRIVATE u32 sqlite3PagerDataVersion(Pager *pPager){
48411 static u32 pager_cksum(Pager *pPager, const u8 *aData){
48412 u32 cksum = pPager->cksumInit; /* Checksum value to return */
48497 u32 cksum; /* Checksum used for sanity checking */
48988 u32 nRec; /* Number of Records in the journal */
48989 u32 u; /* Unsigned loop counter */
49193 static int readDbPage(PgHdr *pPg, u32 iFrame){
49256 u32 change_counter;
49293 u32 iFrame = 0;
49641 u32 ii; /* Loop counter */
49642 u32 nJRec = 0; /* Number of Journal Records */
49643 u32 dummy;
49655 nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager));
49669 u32 ii; /* Loop counter */
49936 SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){
49949 u32 pageSize = *pPageSize;
49953 && pageSize && pageSize!=(u32)pPager->pageSize
50866 u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */
51006 szPageDflt = (u32)pPager->sectorSize;
51596 u32 iFrame = 0; /* Frame to read from WAL file */
51988 u32 cksum;
52238 }else if( pPager->sectorSize > (u32)pPager->pageSize ){
53982 u32 iVersion; /* Wal-index version */
53983 u32 unused; /* Unused (padding) field */
53984 u32 iChange; /* Counter incremented each transaction */
53988 u32 mxFrame; /* Index of last valid frame in the WAL */
53989 u32 nPage; /* Size of database in pages */
53990 u32 aFrameCksum[2]; /* Checksum of last frame in log */
53991 u32 aSalt[2]; /* Two salt values copied from WAL header */
53992 u32 aCksum[2]; /* Checksum over all prior fields */
54055 u32 nBackfill; /* Number of WAL frames backfilled into DB */
54056 u32 aReadMark[WAL_NREADER]; /* Reader marks */
54058 u32 nBackfillAttempted; /* WAL frames perhaps written, or maybe not */
54059 u32 notUsed0; /* Available for future enhancements */
54107 u32 iCallback; /* Value to pass to log callback (or 0) */
54111 volatile u32 **apWiData; /* Pointer to wal-index content in memory */
54112 u32 szPage; /* Database page size */
54123 u32 minFrame; /* Ignore wal frames before this one */
54124 u32 iReCksum; /* On commit, recalculate checksums from here */
54126 u32 nCkpt; /* Checkpoint sequence counter in the wal-header */
54176 u32 *aPgno; /* Array of page numbers. */
54199 #define HASHTABLE_NPAGE_ONE (HASHTABLE_NPAGE - (WALINDEX_HDR_SIZE/sizeof(u32)))
54203 sizeof(ht_slot)*HASHTABLE_NSLOT + HASHTABLE_NPAGE*sizeof(u32) \
54215 static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){
54220 int nByte = sizeof(u32*)*(iPage+1);
54221 volatile u32 **apNew;
54222 apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte);
54228 sizeof(u32*)*(iPage+1-pWal->nWiData));
54236 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ);
54271 ** The argument to this macro must be of type u32. On a little-endian
54272 ** architecture, it returns the u32 value that results from interpreting
54295 const u32 *aIn, /* Initial checksum value input */
54296 u32 *aOut /* OUT: Final checksum value output */
54298 u32 s1, s2;
54299 u32 *aData = (u32 *)a;
54300 u32 *aEnd = (u32 *)&a[nByte];
54368 u32 iPage, /* Database page number for frame */
54369 u32 nTruncate, /* New db size (or 0 for non-commit frames) */
54374 u32 *aCksum = pWal->hdr.aFrameCksum;
54399 u32 *piPage, /* OUT: Database page number for frame */
54400 u32 *pnTruncate, /* OUT: New db size (or 0 if not commit) */
54405 u32 *aCksum = pWal->hdr.aFrameCksum;
54406 u32 pgno; /* Page number of the frame */
54515 static int walHash(u32 iPage){
54542 volatile u32 **paPgno, /* OUT: Pointer to page number array */
54543 u32 *piZero /* OUT: Frame associated with *paPgno[0] */
54546 volatile u32 *aPgno;
54552 u32 iZero;
54557 aPgno = &aPgno[WALINDEX_HDR_SIZE/sizeof(u32)];
54576 static int walFramePage(u32 iFrame){
54590 static u32 walFramePgno(Wal *pWal, u32 iFrame){
54593 return pWal->apWiData[0][WALINDEX_HDR_SIZE/sizeof(u32) + iFrame - 1];
54612 volatile u32 *aPgno = 0; /* Page number array for hash table */
54613 u32 iZero = 0; /* frame == (aHash[x]+iZero) */
54672 static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
54674 u32 iZero = 0; /* One less than frame number of aPgno[1] */
54675 volatile u32 *aPgno = 0; /* Page number array */
54764 u32 aFrameCksum[2] = {0, 0};
54801 u32 magic; /* Magic value read from WAL header */
54802 u32 version; /* Magic value read from WAL header */
54860 u32 pgno; /* Database page number for frame */
54861 u32 nTruncate; /* dbsize field from frame header */
55045 u32 *piPage, /* OUT: The page number of the next page */
55046 u32 *piFrame /* OUT: Wal frame index of next page */
55048 u32 iMin; /* Result pgno must be greater than iMin */
55049 u32 iRet = 0xFFFFFFFF; /* 0xffffffff is never a valid page number */
55057 u32 iPg = pSegment->aPgno[pSegment->aIndex[pSegment->iNext]];
55097 const u32 *aContent, /* Pages in wal - keys for the sort */
55154 const u32 *aContent, /* Pages in wal */
55168 u32 iSub = 0; /* Index into aSub array */
55235 u32 iLast; /* Last frame in log */
55271 u32 iZero;
55272 volatile u32 *aPgno;
55284 nEntry = (int)((u32*)aHash - (u32*)aPgno);
55292 walMergesort((u32 *)aPgno, aTmp, aIndex, &nEntry);
55296 p->aSegment[i].aPgno = (u32 *)aPgno;
55353 static void walRestartHdr(Wal *pWal, u32 salt1){
55356 u32 *aSalt = pWal->hdr.aSalt; /* Big-endian salt values */
55411 u32 iDbpage = 0; /* Next database page to write */
55412 u32 iFrame = 0; /* Wal frame containing data for iDbpage */
55413 u32 mxSafeFrame; /* Max frame that can be backfilled */
55414 u32 mxPage; /* Max database page to write */
55451 u32 y = pInfo->aReadMark[i];
55471 u32 nBackfill = pInfo->nBackfill;
55545 u32 salt1;
55678 u32 aCksum[2]; /* Checksum on the header content */
55738 volatile u32 *page0; /* Chunk of wal-index containing header */
55854 u32 mxReadMark; /* Largest aReadMark[] value */
55858 u32 mxFrame; /* Wal frame to lock to */
55972 u32 thisMark = pInfo->aReadMark[i];
56170 u32 *piRead /* OUT: Frame number (or zero) */
56172 u32 iRead = 0; /* If !=0, WAL frame to return data from */
56173 u32 iLast = pWal->hdr.mxFrame; /* Last page in WAL for this reader */
56219 volatile u32 *aPgno; /* Pointer to array of page numbers */
56220 u32 iZero; /* Frame number corresponding to aPgno[0] */
56231 u32 iFrame = aHash[iKey] + iZero;
56247 u32 iRead2 = 0;
56248 u32 iTest;
56271 u32 iRead, /* Frame to read */
56405 ** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32
56410 SQLITE_PRIVATE void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){
56421 ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
56424 SQLITE_PRIVATE int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData){
56469 u32 salt1;
56579 static int walRewriteChecksums(Wal *pWal, u32 iLast){
56584 u32 iRead; /* Next frame to read from wal file */
56601 rc = sqlite3OsRead(pWal->pWalFd, aBuf, sizeof(u32)*2, iCksumOff);
56603 pWal->hdr.aFrameCksum[1] = sqlite3Get4byte(&aBuf[sizeof(u32)]);
56611 u32 iPgno, nDbSize;
56637 u32 iFrame; /* Next frame address */
56644 u32 iFirst = 0; /* First frame that may be overwritten */
56680 u32 aCksum[2]; /* Checksum for wal-header */
56736 u32 iWrite = 0;
56978 u32 ret = 0;
57501 u32 iDataVersion; /* Combines with pBt->pPager->iDataVersion */
57576 u32 pageSize; /* Total number of bytes on a page */
57577 u32 usableSize; /* Number of usable bytes on each page */
57579 u32 nPage; /* Number of pages in the database */
57612 u32 nPayload; /* Bytes of payload */
57825 u32 *heap; /* Min-heap used for analyzing cell coverage */
59241 u32 nPayload; /* Number of bytes of cell payload */
59309 u32 nPayload; /* Number of bytes of cell payload */
59363 u32 nSize; /* Size value to return */
59393 nSize += (u32)(pIter - pCell);
59718 u32 iLast = pPage->pBt->usableSize-4; /* Largest possible freeblock offset */
59719 u32 iEnd = iStart + iSize; /* First byte past the iStart buffer */
60100 SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree *p){
60408 assert( sizeof(u32)==4 );
60806 pBt->pageSize = (u32)pageSize;
60972 u32 pageSize;
60973 u32 usableSize;
61065 if( (u32)pageSize!=pBt->pageSize ){
62431 SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor *pCur){
62578 u32 offset, /* Begin reading this far into payload */
62579 u32 amt, /* Read this many bytes */
62632 const u32 ovflSize = pBt->usableSize - 4; /* Bytes content per ovfl page */
62787 SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
62804 SQLITE_PRIVATE int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
62845 u32 *pAmt /* Write the number of available bytes here */
62847 u32 amt;
62877 SQLITE_PRIVATE const void *sqlite3BtreePayloadFetch(BtCursor *pCur, u32 *pAmt){
62891 static int moveToChild(BtCursor *pCur, u32 newPgno){
63668 u32 n; /* Number of pages on the freelist */
63669 u32 k; /* Number of leaves on the trunk of the freelist */
63689 u32 nSearch = 0; /* Count of the number of search attempts */
63766 }else if( k>(u32)(pBt->usableSize/4 - 2) ){
63835 u32 closest;
63839 u32 i;
64035 u32 nLeaf; /* Initial number of leaf cells on trunk page */
64045 if( nLeaf > (u32)pBt->usableSize/4 - 2 ){
64049 if( nLeaf < (u32)pBt->usableSize/4 - 8 ){
64130 u32 ovflPageSize;
64381 u32 pc; /* Offset to cell content of cell being deleted */
64399 if( pc < (u32)get2byte(&data[hdr+5]) || pc+sz > pPage->pBt->usableSize ){
65815 u32 key = get4byte(&apNew[i]->aData[8]);
66811 SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
66841 SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
67140 ** This heap is used for cell overlap and coverage testing. Each u32
67145 static void btreeHeapInsert(u32 *aHeap, u32 x){
67146 u32 j, i = ++aHeap[0];
67155 static int btreeHeapPull(u32 *aHeap, u32 *pOut){
67156 u32 j, i, x;
67211 u32 pc; /* Address of a cell */
67212 u32 usableSize; /* Usable size of the page */
67213 u32 contentOffset; /* Offset to the start of the cell content area */
67214 u32 *heap = 0; /* Min-heap used for checking cell coverage */
67215 u32 x, prev = 0; /* Next and previous entry on the min-heap */
67361 u32 size;
67376 assert( (u32)i<=usableSize-4 ); /* Enforced by btreeInitPage() */
67378 assert( (u32)(i+size)<=usableSize ); /* Enforced by btreeInitPage() */
67379 btreeHeapInsert(heap, (((u32)i)<<16)|(i+size-1));
67388 assert( (u32)j<=usableSize-4 ); /* Enforced by btreeInitPage() */
67493 sCheck.heap = (u32*)sqlite3PageMalloc( pBt->pageSize );
67721 SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
67875 u32 iDestSchema; /* Original schema cookie in destination */
68133 u32 newPgsz = nSrcPgsz;
69604 u32 offset, /* Offset from the start of data to return bytes from. */
69605 u32 amt, /* Number of bytes to return. */
69630 u32 offset, /* Offset from the start of data to return bytes from. */
69631 u32 amt, /* Number of bytes to return. */
69636 u32 available = 0; /* Number of bytes available on the local btree page */
70072 u32 iSerial; /* Serial type */
70074 u32 nVal; /* Bytes of space required for argv[0] */
70257 u32 t; /* a column type code */
71113 SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe *p, u32 addr, u8 iNewOpcode){
71116 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, u32 addr, int val){
71119 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
71122 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
72638 u32 iRandom;
73476 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){
73478 u32 n;
73498 return 8+(u32)u;
73517 n = (u32)pMem->n;
73548 SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32 serial_type){
73600 u32 i[2];
73602 u32 t;
73628 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){
73629 u32 len;
73634 u32 i;
73670 #define FOUR_BYTE_UINT(x) (((u32)(x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])
73682 static u32 SQLITE_NOINLINE serialGet(
73684 u32 serial_type, /* Serial type to deserialize */
73688 u32 y = FOUR_BYTE_UINT(buf+4);
73718 SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(
73720 u32 serial_type, /* Serial type to deserialize */
73862 u32 idx; /* Offset in aKey[] to read from */
73864 u32 szHdr;
73873 u32 serial_type;
73906 u32 d1; /* Offset into aKey[] of next data element */
73907 u32 idx1; /* Offset into aKey[] of next header element */
73908 u32 szHdr1; /* Number of bytes in header */
73939 u32 serial_type1;
73950 if( d1+serial_type1+2>(u32)nKey1
73951 && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1
74011 u32 szHdr;
74012 u32 idx;
74013 u32 notUsed;
74019 assert( szHdr<=(u32)nKey );
74203 static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){
74204 u32 y;
74263 u32 d1; /* Offset into aKey[] of next data element */
74265 u32 szHdr1; /* Size of record header in bytes */
74266 u32 idx1; /* Offset of first type in header */
74277 u32 s1;
74300 u32 serial_type;
74461 u32 y;
74657 u32 szHdr; /* Size of the header */
74658 u32 typeRowid; /* Serial type of the rowid */
74659 u32 lenRowid; /* Size of the rowid */
74673 rc = sqlite3VdbeMemFromBtree(pCur, 0, (u32)nCellKey, 1, &m);
74701 testcase( (u32)m.n==szHdr+lenRowid );
74702 if( unlikely((u32)m.n<szHdr+lenRowid) ){
74753 rc = sqlite3VdbeMemFromBtree(pCur, 0, (u32)nCellKey, 1, &m);
74838 v->expmask |= ((u32)1 << (iVar-1));
75877 /* .uTemp = */ (u32)0,
76205 ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff)
76547 u32 v;
76635 u32 nRec;
77253 ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField +
77270 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*sizeof(u32)*nField];
77739 u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP];
79520 u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
79528 u32 offset; /* Offset into the data */
79530 u32 avail; /* Number of bytes of available data */
79531 u32 t; /* A type code from the record header */
79573 if( pC->payloadSize <= (u32)avail ){
79575 }else if( pC->payloadSize > (u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){
79652 aOffset[i] = (u32)(offset64 & 0xffffffff);
79669 pC->iHdrOffset = (u32)(zHdr - zData);
79807 u32 serial_type; /* Type field */
79815 u32 len; /* Length of a field */
80295 sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
80352 sqlite3BtreeGetMeta(db->aDb[iDb].pBt, iCookie, (u32 *)&iMeta);
80475 if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){
81750 u32 n;
81783 if( n>(u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){
84175 u32 type = pC->aType[p->iCol];
84480 int (*xCall)(BtCursor*, u32, u32, void*)
85604 u32 szPma = sqlite3GlobalConfig.szPma;
88296 pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
88300 pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
90140 u32 n = sqlite3Strlen30(z);
90338 u32 staticFlag; /* EP_Static if space not obtained from malloc */
90373 u32 nSize = (u32)exprStructSize(p);
90759 SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList *pList){
90761 u32 m = 0;
91208 SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, u32 inFlags, int *prRhsHasNull){
91315 u32 savedNQueryLoop = pParse->nQueryLoop;
92391 u32 constMask = 0; /* Mask of function arguments that are constant */
93323 u32 combinedFlags;
94925 u32 nRowid; /* Sizeof aRowid[] */
94928 u32 iHash; /* Tiebreaker hash */
94938 u32 iPrn; /* Pseudo-random number used for sampling */
95100 p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
97728 u32 flags, /* LOCATE_VIEW or LOCATE_NOERR */
97778 u32 flags,
98527 u32 h = 0;
101048 if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
102971 u32 mask; /* Mask of OLD.* columns in use */
103845 u32 matchOther /* The escape char (LIKE) or '[' (GLOB) */
103847 u32 c, c2; /* Next pattern and input string chars */
103848 u32 matchOne = pInfo->matchOne; /* "?" or "_" */
103849 u32 matchAll = pInfo->matchAll; /* "*" or "%" */
103891 u32 cx;
103916 u32 prior_c = 0;
104002 u32 escape;
106105 #define COLUMN_MASK(x) (((x)>31) ? 0xffffffff : ((u32)1<<(x)))
106111 SQLITE_PRIVATE u32 sqlite3FkOldmask(
106115 u32 mask = 0;
110015 u32 nExt; /* Number of entries in aExt[] */
110050 u32 i;
110134 u32 i;
110255 u32 iArg; /* Extra argument */
112841 sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]);
113074 sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie);
113597 u32 selFlags, /* Flag parameters, such as SF_Distinct */
115124 u32 cnt; /* Index added to make the name unique */
119229 u32 nAlloc; /* Slots allocated for azResult[] */
119230 u32 nRow; /* Number of rows in the result */
119231 u32 nColumn; /* Number of columns in the result */
119232 u32 nData; /* Slots used in azResult[]. (nRow+1)*nColumn */
120470 SQLITE_PRIVATE u32 sqlite3TriggerColmask(
120480 u32 mask = 0;
120979 u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0);
121639 u32 meta;
123037 u32 iLikeRepCntr; /* LIKE range processing counter register (times 2) */
123099 u32 wsFlags; /* WHERE_* flags describing the plan */
123260 u32 opMask; /* Acceptable operators */
123412 u32 op, /* Mask of WO_xx values describing operator */
123616 u32 flags; /* Flags that describe this loop */
124740 pLevel->iLikeRepCntr = (u32)++pParse->nMem;
125269 u32 x = pLevel->iLikeRepCntr;
127000 u32 opMask, /* Operator(s) to scan for */
127061 u32 op, /* Mask of WO_xx values describing operator */
127449 assert( (u32)n==pLoop->u.btree.nEq );
128191 (u32)iLower, (u32)iUpper, nOut));
128935 u32 saved_wsFlags; /* Original value of pNew->wsFlags */
137297 u32 mask; /* Mask of the bit in sqlite3.flags to set/clear */
138315 db->xTrace = (int(*)(u32,void*,void*,void*))xTrace;
141582 typedef unsigned int u32; /* 4-byte unsigned integer */
141651 u32 nLeafAdd; /* Number of leaf blocks added this trans */
141864 u32 *aMI; /* See above */
141982 SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *);
142107 u32 a;
142131 u32 a;
142144 *pi = (int)(a | ((u32)(*p & 0x0F) << 28));
145139 const u32 nMinMerge = 64; /* Minimum amount of incr-merge work to do */
147373 pE->aMI = (u32 *)sqlite3_malloc(pTab->nColumn * 3 * sizeof(u32));
147375 memset(pE->aMI, 0, pTab->nColumn * 3 * sizeof(u32));
147458 u32 *aiOut /* Array to write results into (see above) */
147467 aiOut[iCol*3 + 1] = (u32)pCsr->nDoc;
147468 aiOut[iCol*3 + 2] = (u32)pCsr->nDoc;
152598 u32 *pnWord /* IN/OUT: Incr. by number tokens inserted */
152729 u32 *aSz
152873 u32 *aSz, /* Sizes of deleted document written here */
155107 u32 *a, /* The integer values */
155123 u32 *a, /* Write the integer values */
155133 a[i] = (u32)(x & 0xffffffff);
155145 u32 *aSz /* Sizes of each column, in tokens */
155189 u32 *aSzIns, /* Size increases */
155190 u32 *aSzDel, /* Size decreases */
155195 u32 *a; /* Array of integers that becomes the BLOB */
155203 a = sqlite3_malloc( (sizeof(u32)+10)*nStat );
155221 memset(a, 0, sizeof(u32)*(nStat) );
155229 if( nChng<0 && a[0]<(u32)(-nChng) ){
155235 u32 x = a[i+1];
155307 u32 *aSz = 0;
155308 u32 *aSzIns = 0;
155309 u32 *aSzDel = 0;
155323 int nByte = sizeof(u32) * (p->nColumn+1)*3;
155324 aSz = (u32 *)sqlite3_malloc(nByte);
157279 u32 *aSzDel
157295 memset(aSzDel, 0, sizeof(u32) * (p->nColumn+1) * 2);
157333 u32 *aSzIns = 0; /* Sizes of inserted documents */
157334 u32 *aSzDel = 0; /* Sizes of deleted documents */
157584 u32 *aMatchinfo; /* Pre-allocated buffer */
157589 ** (nElem * sizeof(u32)) bytes in size. See the MatchinfoBuffer code below
157597 u32 aMatchinfo[1];
157623 int nByte = sizeof(u32) * (2*nElem + 1) + sizeof(MatchinfoBuffer);
157630 pRet->aMatchinfo[1+nElem] = pRet->aMatchinfo[0] + sizeof(u32)*(nElem+1);
157641 MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]);
157643 assert( (u32*)p==&pBuf->aMatchinfo[1]
157644 || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2]
157646 if( (u32*)p==&pBuf->aMatchinfo[1] ){
157657 static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){
157659 u32 *aOut = 0;
157671 aOut = (u32*)sqlite3_malloc(p->nElem * sizeof(u32));
157674 if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32));
157684 memcpy(&p->aMatchinfo[2+p->nElem], &p->aMatchinfo[1], p->nElem*sizeof(u32));
158366 p->aMatchinfo[iStart + iCol] = (u32)nHit;
158536 *pnDoc = (u32)nDoc;
158715 pInfo->aMatchinfo[0] = (u32)nDoc;
158728 u32 iVal;
158731 iVal = (u32)(((u32)(nToken&0xffffffff)+nDoc/2)/nDoc);
158747 pInfo->aMatchinfo[iCol] = (u32)nToken;
158763 int nZero = fts3MatchinfoSize(pInfo, zArg[i]) * sizeof(u32);
158799 ** 'matchinfo' data is an array of 32-bit unsigned integers (C type u32).
158811 u32 *aOut = 0;
158832 int nMatchinfo = 0; /* Number of u32 elements in match-info */
158878 int n = pCsr->pMIBuffer->nElem * sizeof(u32);
160036 typedef unsigned int u32;
160198 u32 anQueue[RTREE_MAX_DEPTH+1]; /* Number of queued entries by iLevel */
160211 u32 u; /* Unsigned for byte-order conversions */
160314 u32 magic; /* Always RTREE_GEOMETRY_MAGIC */
160337 (((u32)p[0]) << 24) +
160338 (((u32)p[1]) << 16) +
160339 (((u32)p[2]) << 8) +
160340 (((u32)p[3]) << 0)
160367 u32 i;
160369 assert( sizeof(u32)==4 );
160902 c.u = ((u32)a[0]<<24) + ((u32)a[1]<<16) \
160903 +((u32)a[2]<<8) + a[3]; \
161536 memset(pCsr->anQueue, 0, sizeof(u32)*(pRtree->iDepth + 1));
165101 typedef unsigned int u32;
165128 u32 iCookie;
165223 u32 iDbPage;
165224 u32 iWalFrame;
165288 u32 iMaxFrame; /* Largest iWalFrame value in aFrame[] */
165289 u32 mLock;
165323 u32 iCookie; /* Cookie value for main db files */
167231 pRet->iCookie = (u32)sqlite3_column_int64(pStmt, 1);
167235 pRet->iOalSz = (u32)sqlite3_column_int64(pStmt, 1);
167451 u32 volatile *ptr;
167542 const u32 mReq = (1<<WAL_LOCK_WRITE)|(1<<WAL_LOCK_CKPT)|(1<<WAL_LOCK_READ0);
167543 u32 iFrame;
167560 iFrame = (u32)((iOff-32) / (i64)(iAmt+24)) + 1;
167574 pRbu->aFrame[pRbu->nFrame-1].iDbPage = (u32)(iOff / pRbu->pgsz) + 1;
168178 ((u32 volatile*)ptr)[24] = p->iMaxFrame;
168850 static u32 rbuGetU32(u8 *aBuf){
168851 return ((u32)aBuf[0] << 24)
168852 + ((u32)aBuf[1] << 16)
168853 + ((u32)aBuf[2] << 8)
168854 + ((u32)aBuf[3]);
168861 static void rbuPutU32(u8 *aBuf, u32 iVal){
168912 u32 iRoot = rbuGetU32(&aBuf[52]) ? 1 : 0;
169721 u32 iChildPg; /* Child node (or 0 if this is a leaf) */
169723 u32 *aOvfl; /* Array of overflow page numbers */
169729 u32 iPgno;
169740 u32 iRightChildPg; /* Right-child page number (or 0) */
169756 u32 iPageno; /* Value of 'pageno' column */
170005 u32 nPayload; /* Bytes of payload total (local+overflow) */
170012 if( nPayload>(u32)p->nMxPayload ) p->nMxPayload = nPayload;
170016 assert( nPayload>=(u32)nLocal );
170018 if( nPayload>(u32)nLocal ){
170023 pCell->aOvfl = sqlite3_malloc64(sizeof(u32)*nOvfl);
170028 u32 iPrev = pCell->aOvfl[j-1];
170092 u32 iRoot = (u32)sqlite3_column_int64(pCsr->pStmt, 1);
170626 #define SESSION_UINT32(x) (((u32)(x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])
170634 u32 y = SESSION_UINT32(aRec+4);
175078 typedef unsigned int u32;
175138 u32 n; /* Bytes of content, or number of sub-nodes */
175141 u32 iAppend; /* More terms for ARRAY and OBJECT */
175142 u32 iKey; /* Key for ARRAY objects in json_tree() */
175149 u32 nNode; /* Number of slots of aNode[] used */
175150 u32 nAlloc; /* Number of slots of aNode[] allocated */
175153 u32 *aUp; /* Index of parent of each node */
175200 static int jsonGrow(JsonString *p, u32 N){
175227 static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){
175266 static void jsonAppendString(JsonString *p, const char *zIn, u32 N){
175267 u32 i;
175321 u32 n = (u32)sqlite3_value_bytes(pValue);
175327 u32 n = (u32)sqlite3_value_bytes(pValue);
175372 static u32 jsonNodeSize(JsonNode *pNode){
175426 u32 j = 1;
175449 u32 j = 1;
175566 u32 i;
175567 u32 n = pNode->n;
175570 u32 j;
175583 u32 v = 0, k;
175632 static int jsonParseAddNode(JsonParse*,u32,u32,const char*);
175649 u32 eType, /* Node type */
175650 u32 n, /* Content size or sub-node count */
175653 u32 nNew;
175676 u32 eType, /* Node type */
175677 u32 n, /* Content size or sub-node count */
175701 static int jsonParseValue(JsonParse *pParse, u32 i){
175703 u32 j;
175716 if( x==(-2) && pParse->nNode==(u32)iThis+1 ) return j+1;
175736 pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
175746 if( x==(-3) && pParse->nNode==(u32)iThis+1 ) return j+1;
175756 pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
175874 static void jsonParseFillInParentage(JsonParse *pParse, u32 i, u32 iParent){
175876 u32 j;
175902 u32 *aUp;
175904 aUp = pParse->aUp = sqlite3_malloc( sizeof(u32)*pParse->nNode );
175917 static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){
175941 u32 iRoot, /* Begin the search at this node */
175946 u32 i, j, nKey;
175987 u32 iStart, iLabel;
176030 u32 iStart;
176157 u32 i;
176261 u32 i;
176344 u32 n;
176361 n = (u32)sqlite3_value_bytes(argv[i]);
176386 u32 i;
176391 for(i=1; i<(u32)argc; i++){
176419 u32 i;
176428 for(i=1; i<(u32)argc; i+=2){
176466 u32 i;
176477 for(i=1; i<(u32)argc; i+=2){
176612 u32 n;
176624 n = (u32)sqlite3_value_bytes(argv[0]);
176657 u32 iRowid; /* The rowid */
176658 u32 iBegin; /* The first node of the scan */
176659 u32 i; /* Index in sParse.aNode[] of current row */
176660 u32 iEnd; /* EOF when i equals or exceeds this value */
176771 u32 iUp = p->sParse.aUp[p->i];
176808 u32 i /* Path to this element */
176811 u32 iUp;
176845 u32 iKey;
177822 typedef unsigned int u32;
178043 static int sqlite3Fts5BufferSize(int*, Fts5Buffer*, u32);
178045 static void sqlite3Fts5BufferAppendBlob(int*, Fts5Buffer*, u32, const u8*);
178061 (u32)((pBuf)->n) + (u32)(nn) <= (u32)((pBuf)->nSpace) ? 0 : \
178293 static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v);
178294 static int sqlite3Fts5GetVarintLen(u32 iVal);
178298 #define fts5GetVarint32(a,b) sqlite3Fts5GetVarint32(a,(u32*)&b)
180421 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
180422 if( (u32)pBuf->nSpace<nByte ){
180423 u32 nNew = pBuf->nSpace ? pBuf->nSpace : 64;
180469 u32 nData,
180743 u32 hash = 13;
180784 u32 i;
184623 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
188479 u32 aUsed[(FTS5_MAX_SEGMENT+31) / 32];
188482 u32 mask;
189356 u32 dummy;
196901 static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v){
196902 u32 a,b;
196956 *v = (u32)v64;
196980 u32 a,b,s;
197212 static int sqlite3Fts5GetVarintLen(u32 iVal){