Lines Matching defs:i64

14375 #define IS_BIG_INT(X)  (((X)&~(i64)0xffffffff)!=0)
14881 typedef sqlite_int64 i64; /* 8-byte signed integer */
15051 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
15053 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
15714 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
15715 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
15716 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
15718 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
15733 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
15734 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
15909 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64);
16145 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, i64*);
16271 i64 intKey,
16340 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor*);
16343 SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor*);
16360 SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor*);
16384 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
16395 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64);
16497 i64 *pI64; /* Used when p4type is P4_INT64 */
16986 SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val);
17148 i64 nRef; /* Number of users of this page */
17229 SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache*);
17234 SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr*);
17647 i64 lastRowid; /* ROWID of most recent insert (see above) */
17648 i64 szMmap; /* Default mmap_size setting */
17671 i64 nChange; /* Value returned by sqlite3_changes() */
17672 i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
17755 i64 nDeferredCons; /* Net deferred constraints this transaction. */
17756 i64 nDeferredImmCons; /* Net deferred immediate constraints */
18159 i64 nDeferredCons; /* Number of deferred fk violations */
18160 i64 nDeferredImmCons; /* Number of deferred imm fk. */
18675 i64 i; /* Cache of aMem[0].u.i for vdbeRecordCompareInt() */
20915 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet*, i64);
20916 SQLITE_PRIVATE int sqlite3RowSetTest(RowSet*, int iBatch, i64);
20917 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet*, i64*);
21184 SQLITE_PRIVATE i64 sqlite3RealToI64(double);
21185 SQLITE_PRIVATE int sqlite3Int64ToText(i64,char*);
21238 SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8);
21239 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*);
21277 SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, i64);
21278 SQLITE_PRIVATE int sqlite3AddInt64(i64*,i64);
21279 SQLITE_PRIVATE int sqlite3SubInt64(i64*,i64);
21280 SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64);
21405 SQLITE_PRIVATE int sqlite3StrAccumEnlarge(StrAccum*, i64);
23200 i64 seqCount; /* Sequence counter */
23227 i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
23261 i64 iOffset; /* File offset of the row being cached */
23297 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
23308 i64 nChange; /* Statement changes (Vdbe.nChange) */
23309 i64 nDbChange; /* Value of db->nChange */
23329 i64 i; /* Integer value used when MEM_Int is set in flags */
23558 i64 nChange; /* Number of db changes made since last reset */
23560 i64 iCurrentTime; /* Value of julianday('now') for this statement */
23561 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
23562 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
23563 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
23580 i64 startTime; /* Time when query started - used for profiling */
23642 i64 iKey1; /* First key value passed to hook */
23643 i64 iKey2; /* Second key value passed to hook */
23697 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
23716 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, i64, u8, void(*)(void*));
23717 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
23738 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
23739 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem*);
23769 Vdbe*,VdbeCursor*,int,const char*,Table*,i64,int,int);
24663 #define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff)
24832 if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */
24833 || p->iJD>2130141456*(i64)100000 /* 2038-01-18 */
24846 t = (time_t)(x.iJD/1000 - 21086676*(i64)10000);
24849 t = (time_t)(p->iJD/1000 - 21086676*(i64)10000);
24901 }else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */
24902 && p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */
25051 i64 iOrigJD; /* Original localtime */
25052 i64 iGuess; /* Guess at the corresponding utc time */
25054 i64 iErr; /* Guess is off by this much */
25209 p->iJD += (i64)D*86400000;
25390 sqlite3_result_double(context, (x.iJD - 21086676*(i64)10000000)/1000.0);
25392 sqlite3_result_int64(context, x.iJD/1000 - 21086676*(i64)10000);
25719 (x.iJD - 21086676*(i64)10000000)/1000.0);
25721 i64 iS = (i64)(x.iJD/1000 - 21086676*(i64)10000);
26125 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
26129 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
26133 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
26140 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
26230 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
26234 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
26239 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
26243 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
26989 i64 iSize; /* Size of this allocation */
28587 if( (iFullSz/2)>=(i64)n ) return iFullSz/2;
31512 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
31521 i64 v;
31526 v = va_arg(ap,i64) ;
31700 i64 szBufNeeded; /* Size of a temporary buffer needed */
31701 szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;
31835 i64 nPrior = 1;
31844 i64 nCopyBytes;
31915 i64 i, j, k, n;
32086 SQLITE_PRIVATE int sqlite3StrAccumEnlarge(StrAccum *p, i64 N){
32099 i64 szNew = p->nChar + N + 1;
32137 testcase( p->nChar + (i64)N > 0x7fffffff );
32138 if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
35652 SQLITE_PRIVATE int sqlite3Int64ToText(i64 v, char *zOut){
35721 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
35767 *pNum = -(i64)u;
35769 *pNum = (i64)u;
35824 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
36514 SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
36518 i64 iA = *pA;
36534 SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
36549 SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
36553 i64 iA = *pA;
40485 static int unixMapfile(unixFile *pFd, i64 nByte);
41685 i64 newOffset;
41808 i64 iOff, /* File offset to begin writing at */
41827 i64 iSeek = lseek(fd, iOff, SEEK_SET);
41852 static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
42179 static int unixTruncate(sqlite3_file *id, i64 nByte){
42229 static int unixFileSize(sqlite3_file *id, i64 *pSize){
42267 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
42269 i64 nSize; /* Required file size */
42277 if( nSize>(i64)buf.st_size ){
42298 i64 iWrite; /* Next offset to write to */
42388 rc = fcntlSizeHint(pFile, *(i64 *)pArg);
42432 i64 newLimit = *(i64*)pArg;
42445 *(i64*)pArg = pFile->mmapSizeMax;
43291 MAP_SHARED, pShmNode->hShm, szRegion*(i64)pShmNode->nRegion
43671 i64 nNew /* Required mapping size */
43676 i64 nOrig = pFd->mmapSizeActual; /* Size of pOrig region in bytes */
43693 i64 nReuse = pFd->mmapSize;
43696 i64 nReuse = (pFd->mmapSize & ~(szSyspage-1));
43761 static int unixMapfile(unixFile *pFd, i64 nMap){
43798 static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
43834 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
50264 i64 newLimit = *(i64*)pArg;
50277 *(i64*)pArg = pFile->mmapSizeMax;
51164 static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
51211 static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
54262 i64 nRefSum; /* Sum of ref counts over all pages */
54501 i64 n;
54506 n = ((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
55049 SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache *pCache){
55056 SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr *p){
55097 mxPage = (int)((-1024*(i64)mxPage)/(p->szPage+p->szExtra));
55129 return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
55458 i64 szBulk;
55465 szBulk = pCache->szAlloc * (i64)pcache1.nInitPage;
55467 szBulk = -1024 * (i64)pcache1.nInitPage;
55469 if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){
55470 szBulk = pCache->szAlloc*(i64)pCache->nMax;
56526 i64 v; /* ROWID value for this entry */
56649 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){
56847 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){
57027 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
57031 SQLITE_PRIVATE void sqlite3WalLimit(Wal*, i64);
57541 i64 iOffset; /* Starting offset in main journal */
57542 i64 iHdrOffset; /* See above */
57772 i64 journalOff; /* Current write offset in the journal file */
57773 i64 journalHdr; /* Byte offset to previous journal header */
57793 i64 pageSize; /* Number of bytes in a page */
57794 i64 journalSizeLimit; /* Size limit for persistent journal files */
58208 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
58227 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
58411 i64 szJ; /* Total size in bytes of journal file pJrnl */
58464 static i64 journalHdrOffset(Pager *pPager){
58465 i64 offset = 0;
58466 i64 c = pPager->journalOff;
58502 const i64 iLimit = pPager->journalSizeLimit; /* Local cache of jsl */
58522 i64 sz;
58619 i64 sz = 0;
58691 i64 journalSize, /* Size of the open journal file in bytes */
58697 i64 iHdrOff; /* Offset of journal header being read */
58816 i64 iHdrOff; /* Offset of header in journal file */
58817 i64 jrnlSize; /* Size of journal file on disk */
59389 i64 *pOffset, /* Offset of record to playback */
59520 i64 ofst = (pgno-1)*(i64)pPager->pageSize;
59640 i64 nSuperJournal; /* Size of super-journal file */
59762 i64 currentSize, newSize;
59767 newSize = szPage*(i64)nPage;
59900 i64 szJ; /* Size of the journal file in bytes */
60137 i64 iOffset = (pPg->pgno-1)*(i64)pPager->pageSize;
60397 i64 n = 0; /* Size of db file in bytes */
60504 i64 szJ; /* Effective size of the main journal */
60505 i64 iHdrOff; /* End of first segment of main-journal records */
60591 i64 offset = (i64)pSavepoint->iSubRec*(4+pPager->pageSize);
60597 assert( offset==(i64)ii*(4+pPager->pageSize) );
60871 i64 nByte = 0;
61171 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pData);
61205 sqlite3OsUnfetch(pPager->fd, (i64)(pPg->pgno-1)*pPager->pageSize, pPg->pData);
61408 i64 iNextHdrOffset;
61553 i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */
61646 i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize);
62763 (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData
62772 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1)*pPager->pageSize, pData);
63076 i64 iOff = pPager->journalOff;
63706 ((i64)pPager->dbSize*pPager->pageSize)-szPage);
64118 i64 sz = (pPager->pageSize+4)*(i64)pRel->iSubRec;
64553 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 iLimit){
65410 WAL_HDRSIZE + ((iFrame)-1)*(i64)((szPage)+WAL_FRAME_HDRSIZE) \
65422 i64 mxWalSize; /* Truncate WAL to this size upon reset */
66289 i64 nSize; /* Size of log file */
66400 i64 iOffset = walFrameOffset(iFrame, szPage);
66549 i64 mxWalSize, /* Truncate WAL to this size on reset */
66647 SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){
67170 i64 nReq = ((i64)mxPage * szPage);
67171 i64 nSize; /* Current size of database file */
67175 if( (nSize+65536+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
67190 i64 iOffset;
67204 iOffset = (iDbpage-1)*(i64)szPage;
67214 i64 szDb = pWal->hdr.nPage*(i64)szPage;
67285 static void walLimitSize(Wal *pWal, i64 nMax){
67286 i64 sz;
67670 i64 szWal; /* Size of wal file on disk in bytes */
67671 i64 iOffset; /* Current offset when reading wal file */
68159 i64 szDb; /* Size of db file in bytes */
68168 i64 iDbOff; /* Offset of db file entry */
68169 i64 iWalOff; /* Offset of wal file entry */
68175 iDbOff = (i64)(pgno-1) * szPage;
68533 i64 iOffset;
68859 i64 iCksumOff;
68882 i64 iOff = walFrameOffset(iRead, szPage);
68916 i64 iOffset; /* Next byte to write in WAL file */
69016 i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
69085 i64 sz = pWal->mxWalSize;
69993 i64 nKey; /* The key for INTKEY tables, or nPayload otherwise */
70054 i64 nKey; /* Size of pKey, or last integer key */
70222 i64 nRow; /* Number of rows visited in current tree */
71137 i64 iRow, /* The rowid that might be changing */
71406 i64 nKey, /* Integer key for tables. Size of pKey for indices */
71415 assert( nKey==(i64)(int)nKey );
71756 static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){
71871 pInfo->nKey = *(i64*)&iKey;
73201 assert( sizeof(i64)==8 );
75399 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
75423 SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor *pCur){
75427 return (i64)pCur->pBt->pageSize*((i64)pCur->pPage->pgno - 1) +
75428 (i64)(pCur->info.pPayload - pCur->pPage->aData);
75763 rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
76253 i64 intKey, /* The table key */
76336 i64 nCellKey;
76734 SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
76735 i64 n;
80155 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
80643 i64 *pnChange /* Add number of Cells freed to this counter */
80706 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, i64 *pnChange){
80932 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3 *db, BtCursor *pCur, i64 *pnEntry){
80933 i64 nEntry = 0; /* Value to return in *pnEntry */
81286 i64 *piMinKey, /* Write minimum integer primary key here */
81287 i64 maxKey /* Error if integer primary key greater than this */
81664 i64 notUsed;
82248 const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz;
82250 i64 iOff;
82263 for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
82301 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
82302 i64 iCurrent;
82482 const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
82486 i64 iOff;
82487 i64 iEnd;
82491 || (i64)nDestTruncate*(i64)pgszDest >= iSize || (
82740 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
82896 i64 x;
83405 static SQLITE_NOINLINE i64 memIntValue(const Mem *pMem){
83406 i64 value = 0;
83410 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem *pMem){
83482 i64 ix = sqlite3RealToI64(pMem->u.r);
83549 SQLITE_PRIVATE i64 sqlite3RealToI64(double r){
83552 return (i64)r;
83709 static SQLITE_NOINLINE void vdbeReleaseAndSetInt64(Mem *pMem, i64 val){
83719 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
83731 SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val){
83943 i64 n, /* Bytes in string, or negative */
83947 i64 nByte = n; /* New value for pMem->n */
83998 i64 nAlloc = nByte;
84443 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
84445 i64 iVal;
84736 i64 iField; /* Next unread data byte */
87844 i64 offset = 0;
88459 i64 cnt = p->aOp[i].nExec;
88460 i64 cycles = p->aOp[i].nCycle;
88718 # define MAX_6BYTE ((((i64)0x00008000)<<32)-1)
88719 i64 i = pMem->u.i;
88885 pMem->u.i = *(i64*)&x;
88984 pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
89348 ** number. Return negative, zero, or positive if the first (i64) is less than,
89351 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64 i, double r){
89364 i64 y;
89367 y = (i64)r;
89485 static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){
89502 return (i64)*(int*)&y;
89506 return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
89512 return (i64)*(i64*)&x;
89606 i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
89607 i64 rhs = pRhs->u.i;
89787 i64 v;
89788 i64 lhs;
89810 lhs = (i64)*(int*)&y;
89815 lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
89822 lhs = *(i64*)&x;
89997 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
89998 i64 nCellKey = 0;
90082 i64 nCellKey = 0;
90111 SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, i64 nChange){
90305 i64 iKey1, /* Initial key value */
90310 i64 iKey2;
90876 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
90878 SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
91644 ** of type i64, on certain architectures (x86) with certain compiler
92045 i64 nData, /* Number of bytes of data to be bound */
92110 return sqlite3_bind_int64(p, i, (i64)iValue);
92770 i64 res = 0;
92774 *(i64*)pOut = res;
92852 i64 res = 0;
92879 *(i64*)pOut = res;
93431 static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
93432 i64 iValue;
93822 i64 iOffset, /* Offset to the start of the content value */
94848 i64 nByte; /* Total size of the output string or blob */
94950 i64 iA; /* Integer value of left operand */
94951 i64 iB; /* Integer value of right operand */
95086 i64 iA;
95088 i64 iB;
96497 i64 nByte; /* Data space required for this record */
96498 i64 nZero; /* Number of zero bytes at the end of the record */
96618 i64 i = pRec->u.i;
96821 i64 nEntry;
97851 i64 iKey; /* The rowid we are to seek to */
98607 i64 v; /* The new rowid */
98648 # define MAX_ROWID (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
98867 i64 iKey; /* Rowid value to insert with */
98944 i64 iKey = sqlite3BtreeIntegerKey(pC->uc.pCursor);
99173 i64 v;
99317 i64 sz;
99697 i64 rowid; /* Rowid that P1 current points to */
99850 i64 nCellKey = 0;
99964 i64 nChange;
100316 i64 val;
100672 i64 x;
100955 sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]);
102974 i64 iEof; /* Bytes of data stored in pFd */
102988 i64 szPMA; /* Size of pList as PMA in bytes */
103150 i64 iReadOff; /* Current read offset */
103151 i64 iEof; /* 1 byte past EOF for this PmaReader */
103198 i64 iStartOff; /* Offset to start writing file at */
103219 i64 iWriteOff; /* Offset of start of buffer in file */
103310 if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){
103414 if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){
103433 i64 iOff /* Offset in pFile */
103526 i64 iStart, /* Start offset in pFile */
103528 i64 *pnByte /* IN/OUT: Increment this value by PMA size */
103793 i64 mxCache; /* Cache size in bytes*/
103870 i64 t;
103876 i64 t = 0;
103885 i64 t;
103896 i64 t;
104085 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
104086 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
104106 i64 nExtend, /* Attempt to extend file to this size */
104117 i64 max = SQLITE_MAX_MMAP_SIZE;
104256 i64 iStart /* Offset of pFd to begin writing at */
104307 static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){
104355 i64 iSz = pList->szPMA + sqlite3VarintLen(pList->szPMA) + pTask->file.iEof;
104574 i64 nReq; /* Bytes of memory required */
104575 i64 nPMA; /* Bytes of PMA space required */
104681 i64 iStart = pIncr->iStartOff;
104695 i64 iEof = writer.iWriteOff + writer.iBufEnd;
105110 i64 *piOffset, /* IN/OUT: Readr offset in pTask->file */
105114 i64 iOff = *piOffset;
105122 i64 nDummy = 0;
105148 i64 nDiv = SORTER_MAX_MERGE_COUNT;
105149 while( nDiv < (i64)nPMA ){
105245 i64 iReadOff = 0;
106171 i64 iOff = 0;
106286 i64 iOff = p->nChunkSize;
110324 i64 i;
112269 i64 mask = (1<<nExpr)-1;
113080 i64 value;
115543 i64 nExclude; /* Number of tables to exclude from the search */
115558 i64 i, j;
117330 i64 nNew = sqlite3Strlen30(zNew);
117331 i64 nSql = sqlite3Strlen30(zSql);
117336 i64 nQuot = 0;
118723 i64 iRowid; /* Rowid in main table of the key */
118785 static void sampleSetRowidInt64(sqlite3 *db, StatSample *p, i64 iRowid){
120163 i64 nSum100 = 0; /* Number of terms contributing to sumEq */
120164 i64 nDist100; /* Number of distinct values in index */
120168 nDist100 = (i64)100 * pFinal->anDLt[iCol];
120172 nDist100 = ((i64)100 * pIdx->aiRowEst[0]) / pIdx->aiRowEst[iCol+1];
120190 avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
122099 i64 nColl;
122100 i64 n;
122908 z = sqlite3DbMallocRaw(db, (i64)sName.n + 1 + (i64)sType.n + (sType.n>0) );
122922 aNew = sqlite3DbRealloc(db,p->aCol,((i64)p->nCol+1)*sizeof(p->aCol[0]));
124972 i64 nByte;
128811 i64 m = sqlite3_context_db_handle(context)->enc<=SQLITE_UTF8 ? 1 : 2;
128841 i64 iVal = sqlite3_value_int64(argv[0]);
128998 i64 p1, p2;
129125 static void *contextMalloc(sqlite3_context *context, i64 nByte){
129156 z1 = contextMalloc(context, ((i64)n)+1);
129175 z1 = contextMalloc(context, ((i64)n)+1);
129763 i64 nBlob = sqlite3_value_bytes(pValue);
129893 z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
130004 i64 n;
130034 i64 nOut; /* Maximum size of zOut */
130065 zOut = contextMalloc(context, (i64)nOut);
130152 ((i64)nChar)*(sizeof(char*)+sizeof(unsigned)));
130209 i64 j, k, n = 0;
130394 i64 iSum; /* Running sum as a signed integer */
130395 i64 cnt; /* Number of elements summed */
130425 static void kahanBabuskaNeumaierStepInt64(volatile SumCtx *pSum, i64 iVal){
130427 i64 iBig, iSm;
130442 i64 iVal
130445 i64 iSm = iVal % 16384;
130479 i64 x = p->iSum;
130515 i64 iVal = sqlite3_value_int64(argv[0]);
130582 i64 n;
138932 static void returnSingleInt(Vdbe *v, i64 value){
139364 i64 x = 0;
139481 i64 iLimit = -2;
145219 i64 n;
145265 const i64 k = sqlite3Strlen30(zType);
147363 aCsrMap = sqlite3DbMallocZero(db, ((i64)pParse->nTab+1)*sizeof(int));
155121 i64 saved_nChange; /* Saved value of db->nChange */
155122 i64 saved_nTotalChange; /* Saved value of db->nTotalChange */
155196 i64 sz = 0;
164321 i64 nRow0 = sqlite3LogEstToInt(p->aiRowLogEst[0]);
169509 i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p));
169515 i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p));
169524 i64 nValue;
169525 i64 nStep;
169526 i64 nTotal;
169564 i64 nStep;
169575 i64 iVal;
169582 if( ((i64)fVal)!=fVal ) goto error_out;
169583 iVal = (i64)fVal;
169768 i64 nTotal; /* Total rows in partition */
169769 i64 nParam; /* Parameter passed to ntile(N) */
169770 i64 iRow; /* Current row */
169818 i64 nLarge = p->nTotal - p->nParam*nSize;
169819 i64 iSmall = nLarge*(nSize+1);
169820 i64 iRow = p->iRow;
185964 typedef sqlite3_int64 i64; /* 8-byte signed integer */
185989 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
185990 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
186138 i64 iMinDocid; /* Minimum docid to return */
186139 i64 iMaxDocid; /* Maximum docid to return */
186216 i64 iOrDocid;
186351 i64 nBuffer; /* Allocated size of aBuffer[] in bytes */
186414 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(i64 nByte);
187743 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
188060 i64 nAlloc = 0; /* Size of allocated buffer */
188106 if( (i64)nPrefix+nSuffix>nAlloc ){
188108 nAlloc = ((i64)nPrefix+nSuffix) * 2;
188132 *piFirst = (i64)iChild;
188137 *piLast = (i64)iChild;
188144 if( piFirst ) *piFirst = (i64)iChild;
188145 if( piLast ) *piLast = (i64)iChild;
188679 *pVal = (i64)((u64)*pVal - iVal);
188681 *pVal = (i64)((u64)*pVal + iVal);
188733 /* #define DOCID_CMP(i1, i2) ((bDescDoclist?-1:1) * (i64)((u64)i1-i2)) */
188800 aOut = sqlite3_malloc64((i64)n1+n2+FTS3_VARINT_MAX-1+FTS3_BUFFER_PADDING);
189052 pTS->aaOutput[0] = sqlite3_malloc64((i64)nDoclist + FTS3_VARINT_MAX + 1);
189433 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
189704 i64 iLastRowid = sqlite3_last_insert_rowid(p->db);
190965 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
196677 i64 nLeafData; /* Number of bytes of leaf data written */
197142 i64 nNew = p->nSpace * 2;
197562 i64 iDocid = sqlite3_column_int64(pSelect, 0);
197706 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
197823 pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2);
197884 ** overflow - hence the (i64) casts. */
197885 if( (i64)nPrefix+nSuffix>(i64)pReader->nTermAlloc ){
197886 i64 nNew = ((i64)nPrefix+nSuffix)*2;
198031 pReader->iDocid = (i64)((u64)pReader->iDocid - iDelta);
198033 pReader->iDocid = (i64)((u64)pReader->iDocid + iDelta);
198562 char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2);
198726 i64 nReq; /* Number of bytes required on leaf page */
198841 char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2);
198984 static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){
199149 i64 nList
199212 rc = fts3MsrBufferData(pMsr, pList, (i64)nList+1);
199349 static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, i64 nReq){
199445 (i64)pCsr->nDoclist);
199490 iDelta = (i64)((u64)iPrev - (u64)iDocid);
199493 iDelta = (i64)((u64)iDocid - (u64)iPrev);
199499 (i64)nByte+nDoclist+FTS3_NODE_PADDING);
199525 rc = fts3GrowSegReaderBuffer(pCsr, (i64)nDoclist+FTS3_NODE_PADDING);
199570 i64 *piEndBlock,
199571 i64 *pnByte
199581 *piEndBlock = (i64)iVal;
199591 *pnByte = ((i64)iVal * (i64)iMul);
199612 i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1;
199613 i64 nLimit = (nByte*3)/2;
199623 i64 nSize = 0, dummy;
199715 i64 iMaxLevel = 0; /* Max level number for this index/langid */
201357 i64 iAbsLevel, /* First varint to store in hint */
201364 pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], (i64)nInput);
201376 static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){
201426 const i64 nMod = FTS3_SEGDIR_MAXLEVEL * p->nIndex;
201675 i64 iDocid, /* Docid for current row. */
201730 i64 iDocid = 0;
201731 i64 iCol = 0;
201747 iDocid = (i64)((u64)iDocid - iVal);
201749 iDocid = (i64)((u64)iDocid + iVal);
201816 i64 iDocid = sqlite3_column_int64(pStmt, 0);
202339 typedef sqlite3_int64 i64;
202392 i64 iHead; /* Next value in position list */
202394 i64 iTail; /* Next value in trailing position list */
202558 static void fts3GetDeltaPosition(char **pp, i64 *piPos){
202666 static void fts3SnippetAdvance(char **ppIter, i64 *piIter, int iNext){
202669 i64 iIter = *piIter;
202752 i64 iCsr = pPhrase->iTail;
202799 i64 iFirst = 0;
203865 i64 iPos; /* Position just read from pList */
203866 i64 iOff; /* Offset of this term from read positions */
203885 i64 iPos = 0; /* First position in position-list */
206963 if( (i64)i+sz+n > pParse->nBlob
206964 && (i64)i+sz+n > pParse->nBlob-pParse->delta
207384 i64 d = (i64)nIns - (i64)nDel;
209318 i64 f = sqlite3_value_int64(argv[1]);
209400 i64 iErrPos = 0; /* Error position to be returned */
209410 iErrPos = (i64)jsonbValidityCheck(&s, 0, s.nBlob, 1);
209636 i64 iKey; /* Key for JSONB_ARRAY */
209920 i64 x;
210396 typedef sqlite3_int64 i64;
210494 i64 nRowEst; /* Estimated number of rows in this table */
210689 i64 iNode; /* The node number */
210703 i64 iRowid; /* Node or entry ID */
210854 static i64 readInt64(u8 *p){
210858 return (i64)_byteswap_uint64(x);
210862 return (i64)__builtin_bswap64(x);
210864 i64 x;
210868 return (i64)(
210913 static int writeInt64(u8 *p, i64 i){
210915 i = (i64)__builtin_bswap64((u64)i);
210918 i = (i64)_byteswap_uint64((u64)i);
210957 static unsigned int nodeHash(i64 iNode){
210965 static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){
211030 i64 iNode, /* Node number to load */
211251 static i64 nodeGetRowid(
211693 i64 iRowid,
212116 i64 iRowid, /* The rowid searching for */
212124 i64 iNode = sqlite3_column_int64(pRtree->pReadRowid, 0);
212167 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
212194 i64 iRowid = sqlite3_value_int64(argv[0]);
212195 i64 iNode = 0;
212344 i64 nRow; /* Estimated rows returned by this scan */
212449 case 5: area = (i64)p->aCoord[9].i - (i64)p->aCoord[8].i;
212450 case 4: area *= (i64)p->aCoord[7].i - (i64)p->aCoord[6].i;
212451 case 3: area *= (i64)p->aCoord[5].i - (i64)p->aCoord[4].i;
212452 case 2: area *= (i64)p->aCoord[3].i - (i64)p->aCoord[2].i;
212453 default: area *= (i64)p->aCoord[1].i - (i64)p->aCoord[0].i;
212850 i64 iRowid,
212972 i64 iRowid = nodeGetRowid(pRtree, pRight, i);
212983 i64 iRowid = nodeGetRowid(pRtree, pLeft, i);
213029 i64 iNode; /* Node number of parent node */
213226 static int rtreeNewRowid(Rtree *pRtree, i64 *piRowid){
213291 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
213629 i64 nRow = RTREE_MIN_ROWEST;
214233 static u8 *rtreeCheckGetNode(RtreeCheck *pCheck, i64 iNode, int *pnNode){
214280 i64 iKey, /* Key for mapping */
214281 i64 iVal /* Expected value for mapping */
214306 i64 ii = sqlite3_column_int64(pStmt, 0);
214331 i64 iNode, /* Node id to use in error messages */
214379 i64 iNode /* Node to check */
214413 i64 iVal = readInt64(pCell);
214438 static void rtreeCheckCount(RtreeCheck *pCheck, const char *zTbl, i64 nExpect){
214446 i64 nActual = sqlite3_column_int64(pCount, 0);
215996 i64 iRowid = sqlite3_value_int64(argv[0]);
215997 i64 iNode = 0;
216223 i64 oldRowid; /* The old rowid */
216225 i64 newRowid; /* The new rowid */
218329 typedef sqlite3_int64 i64;
218352 i64 iWalCksum;
218354 i64 nProgress;
218356 i64 iOalSz;
218357 i64 nPhaseOneStep;
218523 i64 iOalSz;
218524 i64 nPhaseOneStep;
218538 i64 iWalCksum;
218539 i64 szTemp; /* Current size of all temp files in use */
218540 i64 szTempLimit; /* Total size limit for temp files */
218576 i64 sz; /* Size of file in bytes (temp only) */
221105 static i64 rbuShmChecksum(sqlite3rbu *p){
221106 i64 iRet = 0;
221112 iRet = (i64)(((u64)ptr[10] << 32) + ptr[11]);
221218 static int rbuCaptureWalRead(sqlite3rbu *pRbu, i64 iOff, int iAmt){
221237 iFrame = (u32)((iOff-32) / (i64)(iAmt+24)) + 1;
221250 static int rbuCaptureDbWrite(sqlite3rbu *pRbu, i64 iOff){
221263 i64 iOff;
221266 iOff = (i64)(pFrame->iWalFrame-1) * (p->pgsz + 24) + 32 + 24;
221270 iOff = (i64)(pFrame->iDbPage-1) * p->pgsz;
221692 RBU_STATE_COOKIE, (i64)pFd->iCookie,
222432 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
222446 *pnTwo = (int)(MAX_PROGRESS * (i64)p->nStep / (i64)p->nFrame);
222649 i64 nDiff = nNew - pFd->sz;
222872 i64 szNew = iAmt+iOfst;
223685 i64 nUnused; /* Value of 'unused' column */
223686 i64 nPayload; /* Value of 'payload' column */
223687 i64 iOffset; /* Value of 'pgOffset' column */
223688 i64 szPage; /* Value of 'pgSize' column */
224077 pCsr->iOffset = (i64)pCsr->szPage * (pCsr->iPageno - 1);
224950 i64 nMalloc; /* Number of bytes of data allocated */
224951 i64 nMaxChangesetSize;
225358 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
225395 static unsigned int sessionHashAppendI64(unsigned int h, i64 i){
225431 i64 iRowid,
225462 i64 iVal;
225771 i64 iRowid, /* Rowid value if pTab->bRowid */
225815 i64 iVal = sessionGetI64(a);
226218 i64 iVal = sqlite3_column_int64(pDflt, iField);
226226 i64 iVal = 0;
226274 static int sessionBufferGrow(SessionBuffer *p, i64 nByte, int *pRc){
226276 i64 nReq = p->nBuf + nByte;
226279 i64 nNew = p->nAlloc ? p->nAlloc : 128;
226466 i64 nNew = 2;
226573 i64 iRowid,
226985 i64 iRowid = (pTab->bRowid ? sqlite3_column_int64(pStmt, 0) : 0);
227048 i64 iRowid = (pTab->bRowid ? sqlite3_column_int64(pStmt, 0) : 0);
227786 i64 iVal = sessionGetI64(a);
227796 i64 iVal = sessionGetI64(a);
230565 i64 iVal;
230570 memcpy(&iVal, &rVal, sizeof(i64));
232086 typedef sqlite3_int64 i64;
232115 # define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
232116 # define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
232346 static void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64);
232357 #define fts5BufferAppendVarint(a,b,c) sqlite3Fts5BufferAppendVarint(a,b,(i64)c)
232385 i64 iPos; /* (iCol<<32) + iPos */
232395 i64 iPrev;
232397 static int sqlite3Fts5PoslistWriterAppend(Fts5Buffer*, Fts5PoslistWriter*, i64);
232398 static void sqlite3Fts5PoslistSafeAppend(Fts5Buffer*, i64*, i64);
232403 i64 *piOff /* IN/OUT: Current offset */
232433 i64 iRowid;
232468 i64 iRowid,
232504 static int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch);
232528 static int sqlite3Fts5IterToken(Fts5IndexIter*, i64, int, int, const char**, int*);
232554 i64 iDocid /* Docid to add or remove data from */
232574 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize);
232603 static int sqlite3Fts5IndexGetOrigin(Fts5Index *p, i64 *piOrigin);
232604 static int sqlite3Fts5IndexContentlessDelete(Fts5Index *p, i64 iOrigin, i64 iRowid);
232610 Fts5IndexIter*, const char*, int, i64 iRowid, int iCol, int iOff
232664 static Fts5Table *sqlite3Fts5TableFromCsrid(Fts5Global*, i64);
232685 i64 iRowid, /* Rowid for this entry */
232747 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**);
232748 static int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*);
232749 static int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64);
232756 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol);
232757 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg);
232758 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow);
232816 ** i64 iRowid = sqlite3Fts5ExprRowid(pExpr);
232819 static int sqlite3Fts5ExprFirst(Fts5Expr*, Fts5Index *pIdx, i64 iMin, int bDesc);
232820 static int sqlite3Fts5ExprNext(Fts5Expr*, i64 iMax);
232822 static i64 sqlite3Fts5ExprRowid(Fts5Expr*);
232839 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr*, i64);
232846 static int sqlite3Fts5ExprInstToken(Fts5Expr*, i64, int, int, int, int, const char**, int*);
235269 static void sqlite3Fts5BufferAppendVarint(int *pRc, Fts5Buffer *pBuf, i64 iVal){
235397 i64 *piOff /* IN/OUT: Current offset */
235406 i64 iOff = *piOff;
235416 iOff = ((i64)iVal) << 32;
235426 *piOff = (iOff & (i64)0x7FFFFFFF<<32)+((iOff + (iVal-2)) & 0x7FFFFFFF);
235465 i64 *piPrev,
235466 i64 iPos
235469 static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32;
235483 i64 iPos
236709 #define FTS5_LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
236757 int (*xNext)(Fts5Expr*, Fts5ExprNode*, int, i64);
236759 i64 iRowid; /* Current rowid */
237035 i64 nText = strlen(zText);
237165 static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){
237166 i64 iRet = 0;
237175 i64 iRowid = p->pIter->iRowid;
237192 i64 iRowid,
237231 i64 iPrev = -1;
237235 i64 iMin = FTS5_LARGEST_INT64;
237321 i64 iPos = aIter[0].iPos;
237326 i64 iAdj = iPos + i;
237362 i64 iPos; /* Current position */
237363 i64 iLookahead; /* Next position */
237366 #define FTS5_LOOKAHEAD_EOF (((i64)1) << 62)
237452 i64 iMin;
237453 i64 iMax;
237475 i64 iPos = a[i].reader.iPos;
237513 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
237517 i64 iLast = *piLast;
237518 i64 iRowid;
237539 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
237543 i64 iLast = *piLast;
237549 i64 iRowid = p->pIter->iRowid;
237689 i64 iLhs,
237690 i64 iRhs
237769 i64 iLast; /* Lastest rowid any iterator points to */
237798 i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0);
237836 i64 iFrom
237847 i64 iRowid = fts5ExprSynonymRowid(pTerm, pExpr->bDesc, 0);
237853 i64 ii = p->pIter->iRowid;
237929 i64 iFrom
237972 i64 iFrom
237975 i64 iLast = pNode->iRowid;
238005 i64 iLast = pAnd->iRowid;
238056 i64 iFrom
238099 i64 iFrom
238220 static int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){
238251 static int sqlite3Fts5ExprNext(Fts5Expr *p, i64 iLast){
238269 static i64 sqlite3Fts5ExprRowid(Fts5Expr *p){
239663 i64 iOff;
239701 i64 iRowid = pExpr->pRoot->iRowid;
239746 sCtx.iOff = (((i64)iCol) << 32) - 1;
239776 static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){
239820 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){
239892 i64 iRowid,
240014 i64 iRowid; /* Rowid of last value written */
240185 i64 iRowid, /* Rowid for this entry */
240820 ((i64)(segid) << (FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)) + \
240821 ((i64)(dlidx) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B)) + \
240822 ((i64)(height) << (FTS5_DATA_PAGE_B)) + \
240823 ((i64)(pgno)) \
240885 i64 iWriteRowid; /* Rowid for current doc being written */
240907 i64 iStructVersion; /* data_version when pStruct read */
240915 i64 iRowid;
240970 i64 iPrev; /* Previous rowid value written to page */
240976 i64 iPrevRowid; /* Previous rowid written to current leaf */
241054 i64 iLeafOffset; /* Byte offset within current leaf */
241077 i64 iRowid; /* Current rowid */
241157 i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */
241183 i64 iRowid; /* First rowid on leaf iLeafPgno */
241324 static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
241402 static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){
241436 static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){
241460 static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){
241483 i64 iFirst = FTS5_SEGMENT_ROWID(iSegid, 0);
241484 i64 iLast = FTS5_SEGMENT_ROWID(iSegid+1, 0)-1;
241488 i64 iTomb1 = FTS5_TOMBSTONE_ROWID(iSegid, 0);
241489 i64 iTomb2 = FTS5_TOMBSTONE_ROWID(iSegid, pSeg->nPgTombstone-1);
241550 i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel);
241780 static i64 fts5IndexDataVersion(Fts5Index *p){
241781 i64 iVersion = 0;
241915 fts5BufferSafeAppendVarint(&buf, (i64)pStruct->nWriteCounter);
242256 i64 iRowid = FTS5_DLIDX_ROWID(iSegid, i, iLeafPg);
242285 static i64 fts5DlidxIterRowid(Fts5DlidxIter *pIter){
242385 i64 iOff = pIter->iLeafOffset;
242418 i64 iOff = pIter->iLeafOffset; /* Offset to read at */
242715 i64 iDelta;
242929 i64 iAbs = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno);
243105 if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){
243120 if( (i64)iOff+nNew>n || nNew<1 ){
243187 i64 val = sqlite3_column_int(pIdxSelect, 0);
243280 i64 val = sqlite3_column_int64(pSel, 0);
243621 i64 iMatch /* Advance iterator at least this far */
243849 i64 iFrom /* Advance at least as far as this */
243924 i64 nSlot; /* Power of two >= nSeg */
244548 static i64 fts5MultiIterRowid(Fts5Iter *pIter){
244559 i64 iMatch
244562 i64 iRowid;
244761 sqlite3_bind_int64(p->pIdxWriter, 3, bFlag + ((i64)pWriter->iBtPage<<1));
244810 static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){
244811 i64 iRowid;
244827 i64 iRowid
244833 i64 iVal;
244850 i64 iFirst = fts5DlidxExtractFirstRowid(&pDlidx->buf);
244871 i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno);
244887 i64 iRowid;
245014 i64 iRowid
245063 i64 dummy;
245171 i64 iLeafRowid;
245404 i64 nEntry = 0;
245405 i64 nTomb = 0;
245611 i64 iRowid = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno);
245912 i64 iId = FTS5_SEGMENT_ROWID(iSegid, pSeg->iTermLeafPgno);
245993 i64 iRowid
246000 i64 iThis = fts5MultiIterRowid(pIter);
246081 i64 iRowid = 0;
246082 i64 iPrev = 0;
246417 i64 iDelta;
246460 i64 *piLastRowid, /* IN/OUT: Previous rowid written (if any) */
246461 i64 iRowid /* Rowid to append */
246484 static void fts5NextRowid(Fts5Buffer *pBuf, int *piOff, i64 *piRowid){
246507 i64 iRowid1 = 0;
246508 i64 iRowid2 = 0;
246509 i64 iOut = 0;
246545 i64 iPos; /* For iterating through a position list */
246599 i64 iLastRowid = 0;
246635 i64 iPrev = 0;
246763 i64 iLastRowid = 0;
246872 static int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){
247129 i64 iRowid; /* Row this token is located in */
247130 i64 iPos; /* Position of token */
247208 i64 iRowid,
247209 i64 iPos
247243 i64 iRowid = SMALLEST_INT64;
247279 i64 iPrev = 0;
247325 i64 iMinPos = LARGEST_INT64;
247366 static void fts5TokendataIterNext(Fts5Iter *pIter, int bFrom, i64 iFrom){
247681 static int sqlite3Fts5IterNextFrom(Fts5IndexIter *pIndexIter, i64 iMatch){
247710 i64 iRowid,
247718 i64 iPos = (((i64)iCol)<<32) + iOff;
247775 i64 iRowid, int iCol, int iOff
247790 fts5TokendataIterAppendMap(p, pT, ii, iRowid, (((i64)iCol)<<32) + iOff);
247814 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){
247819 memset(anSize, 0, sizeof(i64) * nCol);
247893 static int sqlite3Fts5IndexGetOrigin(Fts5Index *p, i64 *piOrigin){
248188 i64 iTombstoneRowid = FTS5_TOMBSTONE_ROWID(pSeg->iSegid, ii);
248204 static int sqlite3Fts5IndexContentlessDelete(Fts5Index *p, i64 iOrigin, i64 iRowid){
248238 i64 iRowid,
248276 i64 iRowid = fts5DlidxIterRowid(pDlidx);
248279 cksum1 += iRowid + ((i64)pgno<<32);
248288 i64 iRowid = fts5DlidxIterRowid(pDlidx);
248291 cksum2 += iRowid + ((i64)pgno<<32);
248315 i64 rowid = pIter->iRowid;
248479 i64 iTermOff = 0;
248488 i64 iOff;
248549 i64 iRow; /* Rowid for this leaf */
248617 i64 iKey;
248640 i64 iRowid;
248646 i64 iDlRowid = fts5DlidxIterRowid(pDlidx);
248737 i64 iPos = 0; /* Position read from poslist */
248739 i64 iRowid = fts5MultiIterRowid(pIter);
248786 i64 iRowid, /* Rowid from %_data table */
248793 *piPgno = (int)(iRowid & (((i64)1 << FTS5_DATA_PAGE_B) - 1));
248796 *piHeight = (int)(iRowid & (((i64)1 << FTS5_DATA_HEIGHT_B) - 1));
248802 *piSegid = (int)(iRowid & (((i64)1 << FTS5_DATA_ID_B) - 1));
248810 static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){
248942 i64 iDocid = 0;
248956 i64 iDelta;
248987 i64 iRowid = 0;
249037 i64 iRowid; /* Rowid for record being decoded */
249100 sqlite3Fts5BufferAppendPrintf(&rc, &s, " %lld", (i64)iVal);
249278 i64 iRowid;
249680 i64 iNextId; /* Used to allocate unique cursor ids */
249742 i64 iRowid; /* Current rowid */
249772 i64 iCsrId; /* Cursor id */
249777 i64 iFirstRowid; /* Return no rowids earlier than this */
249778 i64 iLastRowid; /* Return no rowids later than this */
249783 i64 iSpecial; /* Result of special query */
250483 i64 iRowid = sqlite3Fts5ExprRowid(pCsr->pExpr);
250805 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
251031 static i64 fts5CursorRowid(Fts5Cursor *pCsr){
251229 i64 *piRowid
251342 i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */
251359 i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */
251368 i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
251369 i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
251479 static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){
251729 i64 iRowid = fts5CursorRowid(pCsr);
251979 i64 iRowid = fts5CursorRowid(pCsr);
252071 static Fts5Cursor *fts5CursorFromCsrid(Fts5Global *pGlobal, i64 iCsrId){
252087 i64 iCsrId;
252110 i64 iCsrId /* Id of cursor to find */
252731 i64 nTotalRow; /* Total number of rows in FTS table */
252732 i64 *aTotalSize; /* Total sizes of each column */
253011 + pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */
253016 p->aTotalSize = (i64*)&p[1];
253117 i64 iDel,
253157 p->aTotalSize[iCol-1] -= (i64)ctx.szCol;
253180 static int fts5StorageContentlessDelete(Fts5Storage *p, i64 iDel){
253181 i64 iOrigin = 0;
253216 i64 iRowid, /* id value */
253226 i64 iOrigin = 0;
253289 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel, sqlite3_value **apVal){
253388 i64 iRowid = sqlite3_column_int64(pScan, 0);
253405 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
253445 static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){
253469 i64 *piRowid
253504 i64 iRowid
253531 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
253544 static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){
253574 i64 iRowid;
253660 i64 *aTotalSize; /* Array of size pConfig->nCol */
253667 aTotalSize = (i64*)sqlite3_malloc64(pConfig->nCol*(sizeof(int)+sizeof(i64)));
253670 memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol);
253738 i64 nRow = 0;
253743 i64 nRow = 0;
253826 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol){
253855 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnToken){
253873 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){
253892 i64 iLastRowid = sqlite3_last_insert_rowid(p->pConfig->db);
256592 i64 *aCnt;
256593 i64 *aDoc;
256596 i64 rowid; /* This table's current rowid value */
256600 i64 iInstPos;
256878 i64 iId = sqlite3_column_int64(pStmt, 0);
256899 i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
256906 pCsr->aCnt = (i64*)&pCsr[1];
256967 i64 *pp = &pCsr->iInstPos;
257034 memset(pCsr->aCnt, 0, nCol * sizeof(i64));
257035 memset(pCsr->aDoc, 0, nCol * sizeof(i64));
257042 i64 iPos = 0; /* 64-bit position read from poslist */
257210 i64 iVal = 0;