Lines Matching refs:i64

11148 #define IS_BIG_INT(X)  (((X)&~(i64)0xffffffff)!=0)
11607 typedef sqlite_int64 i64; /* 8-byte signed integer */ typedef
11737 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
11738 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
12231 i64 intKey,
12276 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor*);
12298 SQLITE_PRIVATE int sqlite3BtreeCount(BtCursor *, i64 *);
12409 i64 *pI64; /* Used when p4type is P4_INT64 */
13026 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64);
13534 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
13535 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
13536 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
13538 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
13551 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
13552 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
13872 i64 lastRowid; /* ROWID of most recent insert (see above) */
13873 i64 szMmap; /* Default mmap_size setting */
13964 i64 nDeferredCons; /* Net deferred constraints this transaction. */
13965 i64 nDeferredImmCons; /* Net deferred immediate constraints */
14227 i64 nDeferredCons; /* Number of deferred fk violations */
14228 i64 nDeferredImmCons; /* Number of deferred imm fk. */
16201 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet*, i64);
16202 SQLITE_PRIVATE int sqlite3RowSetTest(RowSet*, int iBatch, i64);
16203 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet*, i64*);
16481 SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8);
16482 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*);
16505 SQLITE_PRIVATE int sqlite3AddInt64(i64*,i64);
16506 SQLITE_PRIVATE int sqlite3SubInt64(i64*,i64);
16507 SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64);
17725 i64 seqCount; /* Sequence counter */
17726 i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
17780 i64 *anExec; /* Event counters from parent frame */
17785 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
17813 i64 i; /* Integer value used when MEM_Int is set in flags */
18022 i64 startTime; /* Time when query started - used for profiling */
18024 i64 iCurrentTime; /* Value of julianday('now') for this statement */
18025 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
18026 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
18027 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
18039 i64 *anExec; /* Number of times each op has been executed */
18066 i64 iKey1; /* First key value passed to hook */
18067 i64 iKey2; /* Second key value passed to hook */
18092 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
18103 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
18115 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*);
18132 SQLITE_PRIVATE void sqlite3VdbePreUpdateHook(Vdbe*,VdbeCursor*,int,const char*,Table*,i64,int);
19057 t = (time_t)(x.iJD/1000 - 21086676*(i64)10000); in localtimeOffset()
19137 p->iJD = (p->iJD + 43200)/86400 + 21086676*(i64)10000000; in parseModifier()
19554 (i64)(x.iJD/1000 - 21086676*(i64)10000)); in strftimeFunc()
19778 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){ in sqlite3OsRead()
19782 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){ in sqlite3OsWrite()
19786 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){ in sqlite3OsTruncate()
19793 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){ in sqlite3OsFileSize()
19868 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){ in sqlite3OsFetch()
19872 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){ in sqlite3OsUnfetch()
19877 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){ in sqlite3OsFetch()
19881 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){ in sqlite3OsUnfetch()
20615 i64 iSize; /* Size of this allocation */
25022 flag_longlong = sizeof(char*)==sizeof(i64);
25028 i64 v;
25032 v = va_arg(ap,i64);
25181 if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){
25183 = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 );
25416 assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
25428 i64 szNew = p->nChar;
25467 testcase( p->nChar + (i64)N > 0x7fffffff );
25468 if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
27554 i64 s = 0; /* significand */
27774 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
27811 *pNum = -(i64)u;
27813 *pNum = (i64)u;
27860 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
28484 SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
28485 i64 iA = *pA;
28500 SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
28511 #define TWOPOWER32 (((i64)1)<<32)
28512 #define TWOPOWER31 (((i64)1)<<31)
28513 SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
28514 i64 iA = *pA;
28515 i64 iA1, iA0, iB1, iB0, r;
31242 static int unixMapfile(unixFile *pFd, i64 nByte);
32444 i64 newOffset;
32550 i64 iOff, /* File offset to begin writing at */
32569 i64 iSeek = lseek(fd, iOff, SEEK_SET);
32594 static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
32921 static int unixTruncate(sqlite3_file *id, i64 nByte){
32971 static int unixFileSize(sqlite3_file *id, i64 *pSize){
33009 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
33011 i64 nSize; /* Required file size */
33019 if( nSize>(i64)buf.st_size ){
33040 i64 iWrite; /* Next offset to write to */
33112 rc = fcntlSizeHint(pFile, *(i64 *)pArg);
33142 i64 newLimit = *(i64*)pArg;
33147 *(i64*)pArg = pFile->mmapSizeMax;
33804 MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
34056 i64 nNew /* Required mapping size */
34061 i64 nOrig = pFd->mmapSizeActual; /* Size of pOrig region in bytes */
34078 i64 nReuse = pFd->mmapSize;
34081 i64 nReuse = (pFd->mmapSize & ~(szSyspage-1));
34146 static int unixMapfile(unixFile *pFd, i64 nMap){
34183 static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
34214 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
40629 i64 newLimit = *(i64*)pArg;
40634 *(i64*)pArg = pFile->mmapSizeMax;
41474 static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
41515 static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
43742 return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
44316 mxPage = (int)((-1024*(i64)mxPage)/(p->szPage+p->szExtra));
44348 return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
44636 i64 szBulk;
44643 szBulk = pCache->szAlloc * (i64)pcache1.nInitPage;
44645 szBulk = -1024 * (i64)pcache1.nInitPage;
44647 if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){
45713 i64 v; /* ROWID value for this entry */
45832 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){
46030 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){
46209 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
46213 SQLITE_PRIVATE void sqlite3WalLimit(Wal*, i64);
46724 i64 iOffset; /* Starting offset in main journal */
46725 i64 iHdrOffset; /* See above */
46942 i64 journalOff; /* Current write offset in the journal file */
46943 i64 journalHdr; /* Byte offset to previous journal header */
46963 i64 journalSizeLimit; /* Size limit for persistent journal files */
47337 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
47356 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
47526 i64 szJ; /* Total size in bytes of journal file pJrnl */
47577 static i64 journalHdrOffset(Pager *pPager){
47578 i64 offset = 0;
47579 i64 c = pPager->journalOff;
47615 const i64 iLimit = pPager->journalSizeLimit; /* Local cache of jsl */
47635 i64 sz;
47781 i64 journalSize, /* Size of the open journal file in bytes */
47787 i64 iHdrOff; /* Offset of journal header being read */
47906 i64 iHdrOff; /* Offset of header in journal file */
47907 i64 jrnlSize; /* Size of journal file on disk */
48489 i64 *pOffset, /* Offset of record to playback */
48621 i64 ofst = (pgno-1)*(i64)pPager->pageSize;
48738 i64 nMasterJournal; /* Size of master journal file */
48850 i64 currentSize, newSize;
48855 newSize = szPage*(i64)nPage;
48987 i64 szJ; /* Size of the journal file in bytes */
49209 i64 iOffset = (pgno-1)*(i64)pPager->pageSize;
49474 i64 n = 0; /* Size of db file in bytes */
49583 i64 szJ; /* Effective size of the main journal */
49584 i64 iHdrOff; /* End of first segment of main-journal records */
49670 i64 offset = (i64)pSavepoint->iSubRec*(4+pPager->pageSize);
49676 assert( offset==(i64)ii*(4+pPager->pageSize) );
49956 i64 nByte = 0;
50238 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pData);
50271 sqlite3OsUnfetch(pPager->fd, (i64)(pPg->pgno-1)*pPager->pageSize, pPg->pData);
50446 i64 iNextHdrOffset;
50591 i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */
50685 i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize);
51637 (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData
51647 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1)*pPager->pageSize, pData);
51990 i64 iOff = pPager->journalOff;
53419 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 iLimit){
54096 WAL_HDRSIZE + ((iFrame)-1)*(i64)((szPage)+WAL_FRAME_HDRSIZE) \
54108 i64 mxWalSize; /* Truncate WAL to this size upon reset */
54763 i64 nSize; /* Size of log file */
54799 i64 iOffset; /* Next offset to read from log file */
54960 i64 mxWalSize, /* Truncate WAL to this size on reset */
55029 SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){
55470 i64 nSize; /* Current size of database file */
55484 i64 nReq = ((i64)mxPage * szPage);
55494 i64 iOffset;
55503 iOffset = (iDbpage-1)*(i64)szPage;
55512 i64 szDb = pWal->hdr.nPage*(i64)szPage;
55581 static void walLimitSize(Wal *pWal, i64 nMax){
55582 i64 sz;
56276 i64 iOffset;
56585 i64 iCksumOff;
56608 i64 iOff = walFrameOffset(iRead, szPage);
56642 i64 iOffset; /* Next byte to write in WAL file */
56740 i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
56812 i64 sz = pWal->mxWalSize;
57610 i64 nKey; /* The key for INTKEY tables, or nPayload otherwise */
57653 i64 nKey; /* Size of pKey, or last integer key */
58638 i64 iRow, /* The rowid that might be changing */
58896 i64 nKey, /* Integer key for tables. Size of pKey for indices */
58906 assert( nKey==(i64)(int)nKey );
59287 pInfo->nKey = *(i64*)&iKey;
60406 assert( sizeof(i64)==8 );
62414 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
62744 rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
63199 i64 intKey, /* The table key */
63273 i64 nCellKey;
66874 SQLITE_PRIVATE int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){
66875 i64 nEntry = 0; /* Value to return in *pnEntry */
67192 i64 *piMinKey, /* Write minimum integer primary key here */
67193 i64 maxKey /* Error if integer primary key greater than this */
67514 i64 notUsed;
68095 const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz;
68104 i64 iOff;
68143 for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
68181 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
68182 i64 iCurrent;
68349 const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
68353 i64 iOff;
68354 i64 iEnd;
68358 || (i64)nDestTruncate*(i64)pgszDest >= iSize || (
68605 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
69074 static i64 doubleToInt64(double r){
69086 static const i64 maxInt = LARGEST_INT64;
69087 static const i64 minInt = SMALLEST_INT64;
69094 return (i64)r;
69110 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
69120 i64 value = 0;
69158 i64 ix;
69332 static SQLITE_NOINLINE void vdbeReleaseAndSetInt64(Mem *pMem, i64 val){
69342 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
69966 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
72295 p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
72637 i64 offset = 0;
73496 # define MAX_6BYTE ((((i64)0x00008000)<<32)-1)
73497 i64 i = pMem->u.i;
73702 pMem->u.i = *(i64*)&x;
73779 pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
74093 static int sqlite3IntFloatCompare(i64 i, double r){
74100 i64 y;
74104 y = (i64)r;
74212 static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){
74229 return (i64)*(int*)&y;
74233 return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
74239 return (i64)*(i64*)&x;
74323 i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
74324 i64 rhs = pRhs->u.i;
74472 i64 v = pPKey2->aMem[0].u.i;
74473 i64 lhs;
74495 lhs = (i64)*(int*)&y;
74500 lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
74507 lhs = *(i64*)&x;
74663 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
74664 i64 nCellKey = 0;
74746 i64 nCellKey = 0;
74903 i64 iKey1, /* Initial key value */
74907 i64 iKey2;
75322 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75324 SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
76295 return sqlite3_bind_int64(p, i, (i64)iValue);
76846 memset(p->anExec, 0, p->nOp * sizeof(i64));
77303 i64 iValue;
77724 i64 lastRowid = db->lastRowid; /* Saved value of the last insert ROWID */
78548 i64 nByte;
78629 i64 iA; /* Integer value of left operand */
78630 i64 iB; /* Integer value of right operand */
78680 iA = (i64)rA;
78681 iB = (i64)rB;
78879 i64 iA;
78881 i64 iB;
79813 i64 nByte; /* Data space required for this record */
79814 i64 nZero; /* Number of zero bytes at the end of the record */
79959 i64 nEntry;
80854 i64 iKey; /* The rowid we are to seek to */
81283 i64 v; /* The new rowid */
81321 # define MAX_ROWID (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
81590 i64 iKey = sqlite3BtreeIntegerKey(pC->uc.pCursor);
81825 i64 v;
82233 i64 rowid; /* Rowid that P1 current points to */
82736 i64 val;
83290 sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]);
84797 i64 iEof; /* Bytes of data stored in pFd */
84973 i64 iReadOff; /* Current read offset */
84974 i64 iEof; /* 1 byte past EOF for this PmaReader */
85021 i64 iStartOff; /* Offset to start writing file at */
85042 i64 iWriteOff; /* Offset of start of buffer in file */
85133 if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){
85237 if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){
85256 i64 iOff /* Offset in pFile */
85349 i64 iStart, /* Start offset in pFile */
85351 i64 *pnByte /* IN/OUT: Increment this value by PMA size */
85612 i64 mxCache; /* Cache size in bytes*/
85690 i64 t;
85696 i64 t;
85704 i64 t;
85715 i64 t;
85904 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
85905 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
85925 i64 nExtend, /* Attempt to extend file to this size */
85936 i64 max = SQLITE_MAX_MMAP_SIZE;
86084 i64 iStart /* Offset of pFd to begin writing at */
86135 static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){
86183 i64 iSz = pList->szPMA + sqlite3VarintLen(pList->szPMA) + pTask->file.iEof;
86502 i64 iStart = pIncr->iStartOff;
86516 i64 iEof = writer.iWriteOff + writer.iBufEnd;
86925 i64 *piOffset, /* IN/OUT: Readr offset in pTask->file */
86929 i64 iOff = *piOffset;
86937 i64 nDummy = 0;
86963 i64 nDiv = SORTER_MAX_MERGE_COUNT;
86964 while( nDiv < (i64)nPMA ){
87060 i64 iReadOff = 0;
87540 i64 iOff = 0;
90153 i64 i;
91291 const i64 sOne = 1;
91787 i64 value;
94931 i64 iRowid; /* Rowid in main table of the key */
94987 static void sampleSetRowidInt64(sqlite3 *db, Stat4Sample *p, i64 iRowid){
95555 sqlite3_result_int64(context, (i64)aCnt[0]);
96250 i64 nSum100 = 0; /* Number of terms contributing to sumEq */
96251 i64 nDist100; /* Number of distinct values in index */
96255 nDist100 = (i64)100 * pFinal->anDLt[iCol];
96259 nDist100 = ((i64)100 * pIdx->aiRowEst[0]) / pIdx->aiRowEst[iCol+1];
96277 avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
103357 i64 iVal = sqlite3_value_int64(argv[0]);
103488 i64 p1, p2;
103615 static void *contextMalloc(sqlite3_context *context, i64 nByte){
103646 z1 = contextMalloc(context, ((i64)n)+1);
103665 z1 = contextMalloc(context, ((i64)n)+1);
104213 zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4);
104237 z = contextMalloc(context, ((i64)i)+((i64)n)+3);
104333 z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
104353 i64 n;
104383 i64 nOut; /* Maximum size of zOut */
104412 zOut = contextMalloc(context, (i64)nOut);
104491 azChar = contextMalloc(context, ((i64)nChar)*(sizeof(char*)+1));
104654 i64 iSum; /* Integer sum */
104655 i64 cnt; /* Number of elements summed */
104680 i64 v = sqlite3_value_int64(argv[0]);
104724 i64 n;
110831 static void returnSingleInt(Vdbe *v, const char *zLabel, i64 value){
111286 i64 iLimit = -2;
128337 i64 nRow0 = sqlite3LogEstToInt(p->aiRowLogEst[0]);
141609 typedef sqlite3_int64 i64; /* 8-byte signed integer */
141764 i64 iMinDocid; /* Minimum docid to return */
141765 i64 iMaxDocid; /* Maximum docid to return */
141842 i64 iOrDocid;
143290 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
144910 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
152030 i64 nLeafData; /* Number of bytes of leaf data written */
152911 i64 iDocid = sqlite3_column_int64(pSelect, 0);
154294 static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){
154865 i64 *piEndBlock,
154866 i64 *pnByte
154872 i64 iVal = 0;
154886 *pnByte = (iVal * (i64)iMul);
154907 i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1;
154908 i64 nLimit = (nByte*3)/2;
154918 i64 nSize = 0, dummy;
155010 i64 iMaxLevel = 0; /* Max level number for this index/langid */
156597 i64 iAbsLevel, /* First varint to store in hint */
156604 pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], (i64)nInput);
156616 static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){
156662 const i64 nMod = FTS3_SEGDIR_MAXLEVEL * p->nIndex;
156887 i64 iDocid, /* Docid for current row. */
156942 i64 iDocid = 0;
156943 i64 iCol = 0;
156944 i64 iPos = 0;
156948 i64 iVal = 0;
157024 i64 iDocid = sqlite3_column_int64(pStmt, 0);
160058 typedef sqlite3_int64 i64;
160113 i64 nRowEst; /* Estimated number of rows in this table */
160284 i64 iNode; /* The node number */
160298 i64 iRowid; /* Node or entry ID */
160368 static i64 readInt64(u8 *p){
160370 (((i64)p[0]) << 56) +
160371 (((i64)p[1]) << 48) +
160372 (((i64)p[2]) << 40) +
160373 (((i64)p[3]) << 32) +
160374 (((i64)p[4]) << 24) +
160375 (((i64)p[5]) << 16) +
160376 (((i64)p[6]) << 8) +
160377 (((i64)p[7]) << 0)
160402 static int writeInt64(u8 *p, i64 i){
160435 static int nodeHash(i64 iNode){
160443 static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){
160498 i64 iNode, /* Node number to load */
160693 static i64 nodeGetRowid(
161058 i64 iRowid,
161439 i64 iRowid, /* The rowid searching for */
161447 i64 iNode = sqlite3_column_int64(pRtree->pReadRowid, 0);
161534 i64 iRowid = sqlite3_value_int64(argv[0]);
161535 i64 iNode = 0;
161615 static void setEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
161662 i64 nRow; /* Estimated rows returned by this scan */
162196 i64 iRowid,
162312 i64 iRowid = nodeGetRowid(pRtree, pRight, i);
162323 i64 iRowid = nodeGetRowid(pRtree, pLeft, i);
162369 i64 iNode; /* Node number of parent node */
162668 static int newRowid(Rtree *pRtree, i64 *piRowid){
162729 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
163001 i64 nRow = 0;
165129 typedef sqlite3_int64 i64;
165150 i64 iWalCksum;
165152 i64 nProgress;
165154 i64 iOalSz;
165155 i64 nPhaseOneStep;
165307 i64 iOalSz;
165308 i64 nPhaseOneStep;
165320 i64 iWalCksum;
167472 static i64 rbuShmChecksum(sqlite3rbu *p){
167473 i64 iRet = 0;
167479 iRet = ((i64)ptr[10] << 32) + ptr[11];
167566 static int rbuCaptureWalRead(sqlite3rbu *pRbu, i64 iOff, int iAmt){
167585 iFrame = (u32)((iOff-32) / (i64)(iAmt+24)) + 1;
167598 static int rbuCaptureDbWrite(sqlite3rbu *pRbu, i64 iOff){
167611 i64 iOff;
167614 iOff = (i64)(pFrame->iWalFrame-1) * (p->pgsz + 24) + 32 + 24;
167618 iOff = (i64)(pFrame->iDbPage-1) * p->pgsz;
168018 RBU_STATE_COOKIE, (i64)pFd->iCookie,
168684 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
168698 *pnTwo = (int)(MAX_PROGRESS * (i64)p->nStep / (i64)p->nFrame);
169787 i64 iOffset; /* Value of 'pgOffset' column */
170084 pCsr->iOffset = (i64)pCsr->szPage * (pCsr->iPageno - 1);
170786 static unsigned int sessionHashAppendI64(unsigned int h, i64 i){
170848 i64 iVal;
171190 i64 iVal = sessionGetI64(a);
172522 i64 iVal = sessionGetI64(a);
172532 i64 iVal = sessionGetI64(a);
177850 typedef sqlite3_int64 i64;
177865 # define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
177866 # define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
178069 static void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64);
178108 i64 iPos; /* (iCol<<32) + iPos */
178118 i64 iPrev;
178120 static int sqlite3Fts5PoslistWriterAppend(Fts5Buffer*, Fts5PoslistWriter*, i64);
178121 static void sqlite3Fts5PoslistSafeAppend(Fts5Buffer*, i64*, i64);
178126 i64 *piOff /* IN/OUT: Current offset */
178156 i64 iRowid;
178188 i64 iRowid,
178224 static int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch);
178262 i64 iDocid /* Docid to add or remove data from */
178282 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize);
178353 static Fts5Index *sqlite3Fts5IndexFromCsrid(Fts5Global*, i64, Fts5Config **);
178372 i64 iRowid, /* Rowid for this entry */
178426 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**);
178427 static int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*);
178428 static int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64);
178435 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol);
178436 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg);
178437 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow);
178489 static int sqlite3Fts5ExprFirst(Fts5Expr*, Fts5Index *pIdx, i64 iMin, int bDesc);
178490 static int sqlite3Fts5ExprNext(Fts5Expr*, i64 iMax);
178492 static i64 sqlite3Fts5ExprRowid(Fts5Expr*);
178508 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr*, i64);
180470 static void sqlite3Fts5BufferAppendVarint(int *pRc, Fts5Buffer *pBuf, i64 iVal){
180596 i64 *piOff /* IN/OUT: Current offset */
180604 i64 iOff = *piOff;
180609 iOff = ((i64)iVal) << 32;
180649 i64 *piPrev,
180650 i64 iPos
180652 static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32;
180665 i64 iPos
181808 #define FTS5_LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
181849 int (*xNext)(Fts5Expr*, Fts5ExprNode*, int, i64);
181851 i64 iRowid; /* Current rowid */
182082 static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){
182083 i64 iRet = 0;
182091 i64 iRowid = p->pIter->iRowid;
182108 i64 iRowid,
182147 i64 iPrev = -1;
182151 i64 iMin = FTS5_LARGEST_INT64;
182236 i64 iPos = aIter[0].iPos;
182241 i64 iAdj = iPos + i;
182275 i64 iPos; /* Current position */
182276 i64 iLookahead; /* Next position */
182279 #define FTS5_LOOKAHEAD_EOF (((i64)1) << 62)
182365 i64 iMin;
182366 i64 iMax;
182388 i64 iPos = a[i].reader.iPos;
182426 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
182430 i64 iLast = *piLast;
182431 i64 iRowid;
182452 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
182456 i64 iLast = *piLast;
182462 i64 iRowid = p->pIter->iRowid;
182588 i64 iLhs,
182589 i64 iRhs
182668 i64 iLast; /* Lastest rowid any iterator points to */
182696 i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0);
182734 i64 iFrom
182745 i64 iRowid = fts5ExprSynonymRowid(pTerm, pExpr->bDesc, 0);
182751 i64 ii = p->pIter->iRowid;
182827 i64 iFrom
182870 i64 iFrom
182873 i64 iLast = pNode->iRowid;
182900 i64 iLast = pAnd->iRowid;
182948 i64 iFrom
182989 i64 iFrom
183107 static int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){
183135 static int sqlite3Fts5ExprNext(Fts5Expr *p, i64 iLast){
183153 static i64 sqlite3Fts5ExprRowid(Fts5Expr *p){
184264 i64 iOff;
184325 sCtx.iOff = (((i64)iCol) << 32) - 1;
184355 static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){
184399 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){
184511 i64 iRowid; /* Rowid of last value written */
184671 i64 iRowid, /* Rowid for this entry */
185202 ((i64)(segid) << (FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)) + \
185203 ((i64)(dlidx) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B)) + \
185204 ((i64)(height) << (FTS5_DATA_PAGE_B)) + \
185205 ((i64)(pgno)) \
185262 i64 iWriteRowid; /* Rowid for current doc being written */
185278 i64 iStructVersion; /* data_version when pStruct read */
185286 i64 iRowid;
185328 i64 iPrev; /* Previous rowid value written to page */
185334 i64 iPrevRowid; /* Previous rowid written to current leaf */
185430 i64 iRowid; /* Current rowid */
185495 i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */
185522 i64 iRowid; /* First rowid on leaf iLeafPgno */
185607 static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
185703 static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){
185726 static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){
185758 i64 iFirst = FTS5_SEGMENT_ROWID(iSegid, 0);
185759 i64 iLast = FTS5_SEGMENT_ROWID(iSegid+1, 0)-1;
185959 static i64 fts5IndexDataVersion(Fts5Index *p){
185960 i64 iVersion = 0;
186090 fts5BufferSafeAppendVarint(&buf, (i64)pStruct->nWriteCounter);
186246 i64 iVal;
186341 i64 iVal;
186440 i64 iRowid = FTS5_DLIDX_ROWID(iSegid, i, iLeafPg);
186469 static i64 fts5DlidxIterRowid(Fts5DlidxIter *pIter){
186711 i64 iDelta = 0;
186825 i64 iDelta;
186871 i64 iDelta;
187089 i64 iAbs = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno);
187336 i64 val = sqlite3_column_int(pIdxSelect, 0);
187643 i64 iMatch /* Advance iterator at least this far */
187794 i64 iFrom /* Advance at least as far as this */
188453 static i64 fts5MultiIterRowid(Fts5Iter *pIter){
188464 i64 iMatch
188467 i64 iRowid;
188662 sqlite3_bind_int64(p->pIdxWriter, 3, bFlag + ((i64)pWriter->iBtPage<<1));
188708 static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){
188709 i64 iRowid;
188725 i64 iRowid
188731 i64 iVal;
188748 i64 iFirst = fts5DlidxExtractFirstRowid(&pDlidx->buf);
188769 i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno);
188785 i64 iRowid;
188912 i64 iRowid
188959 i64 dummy;
189067 i64 iLeafRowid;
189449 i64 iRowid = 0;
189450 i64 iDelta = 0;
189681 i64 iDelta,
189691 i64 iDelta,
189712 i64 iDelta;
189750 i64 *piLastRowid, /* IN/OUT: Previous rowid written (if any) */
189751 i64 iRowid /* Rowid to append */
189774 static void fts5NextRowid(Fts5Buffer *pBuf, int *piOff, i64 *piRowid){
189796 i64 iRowid1 = 0;
189797 i64 iRowid2 = 0;
189798 i64 iOut = 0;
189842 i64 iLastRowid = 0;
189869 i64 iPos1 = 0;
189870 i64 iPos2 = 0;
189876 i64 iPrev = 0;
189962 void (*xAppend)(Fts5Index*, i64, Fts5Iter*, Fts5Buffer*);
189979 i64 iLastRowid = 0;
190049 static int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){
190373 static int sqlite3Fts5IterNextFrom(Fts5IndexIter *pIndexIter, i64 iMatch){
190407 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){
190412 memset(anSize, 0, sizeof(i64) * nCol);
190490 i64 iRowid,
190528 i64 iRowid = fts5DlidxIterRowid(pDlidx);
190531 cksum1 += iRowid + ((i64)pgno<<32);
190540 i64 iRowid = fts5DlidxIterRowid(pDlidx);
190543 cksum2 += iRowid + ((i64)pgno<<32);
190565 i64 rowid = pIter->iRowid;
190760 i64 iRow; /* Rowid for this leaf */
190816 i64 iKey;
190839 i64 iRowid;
190931 i64 iPos = 0; /* Position read from poslist */
190933 i64 iRowid = fts5MultiIterRowid(pIter);
190977 i64 iRowid, /* Rowid from %_data table */
190983 *piPgno = (int)(iRowid & (((i64)1 << FTS5_DATA_PAGE_B) - 1));
190986 *piHeight = (int)(iRowid & (((i64)1 << FTS5_DATA_HEIGHT_B) - 1));
190992 *piSegid = (int)(iRowid & (((i64)1 << FTS5_DATA_ID_B) - 1));
190995 static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){
191109 i64 iDocid = 0;
191123 i64 iDelta;
191152 i64 iRowid = 0;
191182 i64 iRowid; /* Rowid for record being decoded */
191375 i64 iRowid;
191510 i64 iNextId; /* Used to allocate unique cursor ids */
191575 i64 iRowid; /* Current rowid */
191605 i64 iCsrId; /* Cursor id */
191610 i64 iFirstRowid; /* Return no rowids earlier than this */
191611 i64 iLastRowid; /* Return no rowids later than this */
191616 i64 iSpecial; /* Result of special query */
192220 i64 iRowid = sqlite3Fts5ExprRowid(pCsr->pExpr);
192517 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
192684 static i64 fts5CursorRowid(Fts5Cursor *pCsr){
192860 i64 *piRowid
192957 i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */
192967 i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */
192975 i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
192976 i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
193072 static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){
193309 i64 iRowid = fts5CursorRowid(pCsr);
193603 static Fts5Cursor *fts5CursorFromCsrid(Fts5Global *pGlobal, i64 iCsrId){
193619 i64 iCsrId;
193645 i64 iCsrId, /* Id of cursor to find */
194186 i64 nTotalRow; /* Total number of rows in FTS table */
194187 i64 *aTotalSize; /* Total sizes of each column */
194449 + pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */
194454 p->aTotalSize = (i64*)&p[1];
194553 i64 iDel,
194590 p->aTotalSize[iCol-1] -= (i64)ctx.szCol;
194611 i64 iRowid, /* id value */
194676 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel, sqlite3_value **apVal){
194770 i64 iRowid = sqlite3_column_int64(pScan, 0);
194786 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
194824 static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){
194848 i64 *piRowid
194883 i64 iRowid
194909 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
194927 static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){
194957 i64 iRowid;
195043 i64 *aTotalSize; /* Array of size pConfig->nCol */
195049 aTotalSize = (i64*)sqlite3_malloc(pConfig->nCol * (sizeof(int)+sizeof(i64)));
195052 memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol);
195115 i64 nRow = 0;
195120 i64 nRow = 0;
195202 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol){
195228 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnToken){
195246 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){
197312 i64 *aCnt;
197313 i64 *aDoc;
197316 i64 rowid; /* This table's current rowid value */
197562 i64 iId = sqlite3_column_int64(pStmt, 0);
197578 int nByte = pConfig->nCol * sizeof(i64) * 2 + sizeof(Fts5VocabCursor);
197586 pCsr->aCnt = (i64*)&pCsr[1];
197654 memset(pCsr->aCnt, 0, nCol * sizeof(i64));
197655 memset(pCsr->aDoc, 0, nCol * sizeof(i64));
197661 i64 iPos = 0; /* 64-bit position read from poslist */
197813 i64 iVal = 0;