Lines Matching defs:i64

13874 #define IS_BIG_INT(X)  (((X)&~(i64)0xffffffff)!=0)
14379 typedef sqlite_int64 i64; /* 8-byte signed integer */
14515 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
14517 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
15114 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
15115 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
15116 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
15118 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
15133 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
15134 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
15312 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64);
15548 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, i64*);
15674 i64 intKey,
15743 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor*);
15747 SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor*);
15756 SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor*);
15780 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
15791 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64);
15893 i64 *pI64; /* Used when p4type is P4_INT64 */
17019 i64 lastRowid; /* ROWID of most recent insert (see above) */
17020 i64 szMmap; /* Default mmap_size setting */
17043 i64 nChange; /* Value returned by sqlite3_changes() */
17044 i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
17127 i64 nDeferredCons; /* Net deferred constraints this transaction. */
17128 i64 nDeferredImmCons; /* Net deferred immediate constraints */
17521 i64 nDeferredCons; /* Number of deferred fk violations */
17522 i64 nDeferredImmCons; /* Number of deferred imm fk. */
18027 i64 i; /* Cache of aMem[0].u.i for vdbeRecordCompareInt() */
20153 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet*, i64);
20154 SQLITE_PRIVATE int sqlite3RowSetTest(RowSet*, int iBatch, i64);
20155 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet*, i64*);
20420 SQLITE_PRIVATE i64 sqlite3RealToI64(double);
20421 SQLITE_PRIVATE void sqlite3Int64ToText(i64,char*);
20472 SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8);
20473 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*);
20506 SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, i64);
20507 SQLITE_PRIVATE int sqlite3AddInt64(i64*,i64);
20508 SQLITE_PRIVATE int sqlite3SubInt64(i64*,i64);
20509 SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64);
22503 i64 seqCount; /* Sequence counter */
22530 i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
22582 i64 *anExec; /* Event counters from parent frame */
22587 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
22598 i64 nChange; /* Statement changes (Vdbe.nChange) */
22599 i64 nDbChange; /* Value of db->nChange */
22619 i64 i; /* Integer value used when MEM_Int is set in flags */
22839 i64 nChange; /* Number of db changes made since last reset */
22841 i64 iCurrentTime; /* Value of julianday('now') for this statement */
22842 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
22843 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
22844 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
22861 i64 startTime; /* Time when query started - used for profiling */
22894 i64 *anExec; /* Number of times each op has been executed */
22929 i64 iKey1; /* First key value passed to hook */
22930 i64 iKey2; /* Second key value passed to hook */
22984 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
23003 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, i64, u8, void(*)(void*));
23004 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
23024 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
23025 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem*);
23055 Vdbe*,VdbeCursor*,int,const char*,Table*,i64,int,int);
23908 #define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff)
24080 if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */
24081 || p->iJD>2130141456*(i64)100000 /* 2038-01-18 */
24094 t = (time_t)(x.iJD/1000 - 21086676*(i64)10000);
24097 t = (time_t)(p->iJD/1000 - 21086676*(i64)10000);
24187 }else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */
24188 && p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */
24252 i64 iOrigJD; /* Original localtime */
24253 i64 iGuess; /* Guess at the corresponding utc time */
24510 sqlite3_result_int64(context, x.iJD/1000 - 21086676*(i64)10000);
24717 i64 iS = (i64)(x.iJD/1000 - 21086676*(i64)10000);
24951 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
24955 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
24959 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
24966 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
25056 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
25060 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
25065 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
25069 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
25815 i64 iSize; /* Size of this allocation */
27413 if( (iFullSz/2)>=(i64)n ) return iFullSz/2;
30353 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
30362 i64 v;
30367 v = va_arg(ap,i64) ;
30545 i64 szBufNeeded; /* Size of a temporary buffer needed */
30546 szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;
30745 i64 i, j, k, n;
30914 assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
30925 i64 szNew = p->nChar;
30963 testcase( p->nChar + (i64)N > 0x7fffffff );
30964 if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
34045 i64 s = 0; /* significand */
34238 SQLITE_PRIVATE void sqlite3Int64ToText(i64 v, char *zOut){
34304 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
34350 *pNum = -(i64)u;
34352 *pNum = (i64)u;
34407 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
35035 SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
35039 i64 iA = *pA;
35055 SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
35070 SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
35074 i64 iA = *pA;
38903 static int unixMapfile(unixFile *pFd, i64 nByte);
40121 i64 newOffset;
40250 i64 iOff, /* File offset to begin writing at */
40269 i64 iSeek = lseek(fd, iOff, SEEK_SET);
40294 static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
40639 static int unixTruncate(sqlite3_file *id, i64 nByte){
40689 static int unixFileSize(sqlite3_file *id, i64 *pSize){
40727 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
40729 i64 nSize; /* Required file size */
40737 if( nSize>(i64)buf.st_size ){
40768 i64 iWrite; /* Next offset to write to */
40884 rc = fcntlSizeHint(pFile, *(i64 *)pArg);
40922 i64 newLimit = *(i64*)pArg;
40935 *(i64*)pArg = pFile->mmapSizeMax;
41723 MAP_SHARED, pShmNode->hShm, szRegion*(i64)pShmNode->nRegion
42047 i64 nNew /* Required mapping size */
42052 i64 nOrig = pFd->mmapSizeActual; /* Size of pOrig region in bytes */
42069 i64 nReuse = pFd->mmapSize;
42072 i64 nReuse = (pFd->mmapSize & ~(szSyspage-1));
42137 static int unixMapfile(unixFile *pFd, i64 nMap){
42174 static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
42205 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
48686 i64 newLimit = *(i64*)pArg;
48699 *(i64*)pArg = pFile->mmapSizeMax;
49586 static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
49628 static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
52879 i64 n;
52884 n = ((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
53475 mxPage = (int)((-1024*(i64)mxPage)/(p->szPage+p->szExtra));
53507 return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
53836 i64 szBulk;
53843 szBulk = pCache->szAlloc * (i64)pcache1.nInitPage;
53845 szBulk = -1024 * (i64)pcache1.nInitPage;
53847 if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){
53848 szBulk = pCache->szAlloc*(i64)pCache->nMax;
54904 i64 v; /* ROWID value for this entry */
55027 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){
55225 SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){
55404 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
55408 SQLITE_PRIVATE void sqlite3WalLimit(Wal*, i64);
55928 i64 iOffset; /* Starting offset in main journal */
55929 i64 iHdrOffset; /* See above */
56159 i64 journalOff; /* Current write offset in the journal file */
56160 i64 journalHdr; /* Byte offset to previous journal header */
56180 i64 pageSize; /* Number of bytes in a page */
56181 i64 journalSizeLimit; /* Size limit for persistent journal files */
56609 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
56628 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
56812 i64 szJ; /* Total size in bytes of journal file pJrnl */
56865 static i64 journalHdrOffset(Pager *pPager){
56866 i64 offset = 0;
56867 i64 c = pPager->journalOff;
56903 const i64 iLimit = pPager->journalSizeLimit; /* Local cache of jsl */
56923 i64 sz;
57069 i64 journalSize, /* Size of the open journal file in bytes */
57075 i64 iHdrOff; /* Offset of journal header being read */
57194 i64 iHdrOff; /* Offset of header in journal file */
57195 i64 jrnlSize; /* Size of journal file on disk */
57778 i64 *pOffset, /* Offset of record to playback */
57914 i64 ofst = (pgno-1)*(i64)pPager->pageSize;
58053 i64 nSuperJournal; /* Size of super-journal file */
58173 i64 currentSize, newSize;
58178 newSize = szPage*(i64)nPage;
58311 i64 szJ; /* Size of the journal file in bytes */
58548 i64 iOffset = (pPg->pgno-1)*(i64)pPager->pageSize;
58810 i64 n = 0; /* Size of db file in bytes */
58917 i64 szJ; /* Effective size of the main journal */
58918 i64 iHdrOff; /* End of first segment of main-journal records */
59004 i64 offset = (i64)pSavepoint->iSubRec*(4+pPager->pageSize);
59010 assert( offset==(i64)ii*(4+pPager->pageSize) );
59286 i64 nByte = 0;
59586 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pData);
59620 sqlite3OsUnfetch(pPager->fd, (i64)(pPg->pgno-1)*pPager->pageSize, pPg->pData);
59828 i64 iNextHdrOffset;
59973 i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */
60067 i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize);
61204 (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData
61213 sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1)*pPager->pageSize, pData);
61503 i64 iOff = pPager->journalOff;
62538 i64 sz = (pPager->pageSize+4)*(i64)pRel->iSubRec;
63011 SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 iLimit){
63860 WAL_HDRSIZE + ((iFrame)-1)*(i64)((szPage)+WAL_FRAME_HDRSIZE) \
63872 i64 mxWalSize; /* Truncate WAL to this size upon reset */
64585 i64 nSize; /* Size of log file */
64694 i64 iOffset = walFrameOffset(iFrame, szPage);
64839 i64 mxWalSize, /* Truncate WAL to this size on reset */
64937 SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){
65472 i64 nReq = ((i64)mxPage * szPage);
65473 i64 nSize; /* Current size of database file */
65477 if( (nSize+65536+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
65492 i64 iOffset;
65505 iOffset = (iDbpage-1)*(i64)szPage;
65517 i64 szDb = pWal->hdr.nPage*(i64)szPage;
65586 static void walLimitSize(Wal *pWal, i64 nMax){
65587 i64 sz;
65879 i64 szWal; /* Size of wal file on disk in bytes */
65880 i64 iOffset; /* Current offset when reading wal file */
66317 i64 szDb; /* Size of db file in bytes */
66330 i64 iDbOff; /* Offset of db file entry */
66331 i64 iWalOff; /* Offset of wal file entry */
66337 iDbOff = (i64)(pgno-1) * szPage;
66615 i64 iOffset;
66938 i64 iCksumOff;
66961 i64 iOff = walFrameOffset(iRead, szPage);
66995 i64 iOffset; /* Next byte to write in WAL file */
67093 i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
67166 i64 sz = pWal->mxWalSize;
68047 i64 nKey; /* The key for INTKEY tables, or nPayload otherwise */
68108 i64 nKey; /* Size of pKey, or last integer key */
69164 i64 iRow, /* The rowid that might be changing */
69433 i64 nKey, /* Integer key for tables. Size of pKey for indices */
69442 assert( nKey==(i64)(int)nKey );
69766 static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){
69877 pInfo->nKey = *(i64*)&iKey;
71206 assert( sizeof(i64)==8 );
73374 SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
73399 SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor *pCur){
73403 return (i64)pCur->pBt->pageSize*((i64)pCur->pPage->pgno - 1) +
73404 (i64)(pCur->info.pPayload - pCur->pPage->aData);
73731 rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
74205 i64 intKey, /* The table key */
74287 i64 nCellKey;
74659 SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
74660 i64 n;
77942 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
78427 i64 *pnChange /* Add number of Cells freed to this counter */
78490 SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, i64 *pnChange){
78716 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3 *db, BtCursor *pCur, i64 *pnEntry){
78717 i64 nEntry = 0; /* Value to return in *pnEntry */
79030 i64 *piMinKey, /* Write minimum integer primary key here */
79031 i64 maxKey /* Error if integer primary key greater than this */
79401 i64 notUsed;
79982 const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz;
79991 i64 iOff;
80028 for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
80066 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
80067 i64 iCurrent;
80244 const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
80248 i64 iOff;
80249 i64 iEnd;
80253 || (i64)nDestTruncate*(i64)pgszDest >= iSize || (
80502 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
80662 i64 x;
81127 static SQLITE_NOINLINE i64 doubleToInt64(double r){
81139 static const i64 maxInt = LARGEST_INT64;
81140 static const i64 minInt = SMALLEST_INT64;
81147 return (i64)r;
81163 static SQLITE_NOINLINE i64 memIntValue(const Mem *pMem){
81164 i64 value = 0;
81168 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem *pMem){
81231 i64 ix;
81304 SQLITE_PRIVATE i64 sqlite3RealToI64(double r){
81307 return (i64)r;
81461 static SQLITE_NOINLINE void vdbeReleaseAndSetInt64(Mem *pMem, i64 val){
81471 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
81688 i64 n, /* Bytes in string, or negative */
81692 i64 nByte = n; /* New value for pMem->n */
81743 i64 nAlloc = nByte;
82155 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
85101 p->anExec = allocSpace(&x, 0, p->nOp*sizeof(i64));
85112 p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
85129 memset(p->anExec, 0, p->nOp*sizeof(i64));
85410 i64 offset = 0;
86279 # define MAX_6BYTE ((((i64)0x00008000)<<32)-1)
86280 i64 i = pMem->u.i;
86446 pMem->u.i = *(i64*)&x;
86528 pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
86873 ** number. Return negative, zero, or positive if the first (i64) is less than,
86876 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64 i, double r){
86886 i64 y;
86890 y = (i64)r;
87008 static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){
87025 return (i64)*(int*)&y;
87029 return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
87035 return (i64)*(i64*)&x;
87129 i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
87130 i64 rhs = pRhs->u.i;
87299 i64 v;
87300 i64 lhs;
87322 lhs = (i64)*(int*)&y;
87327 lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
87334 lhs = *(i64*)&x;
87509 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
87510 i64 nCellKey = 0;
87594 i64 nCellKey = 0;
87623 SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, i64 nChange){
87803 i64 iKey1, /* Initial key value */
87808 i64 iKey2;
88324 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
88326 SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
89026 ** of type i64, on certain architectures (x86) with certain compiler
89385 i64 nData, /* Number of bytes of data to be bound */
89450 return sqlite3_bind_int64(p, i, (i64)iValue);
90070 memset(p->anExec, 0, p->nOp * sizeof(i64));
90586 static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
90587 i64 iValue;
92004 i64 nByte; /* Total size of the output string or blob */
92106 i64 iA; /* Integer value of left operand */
92107 i64 iB; /* Integer value of right operand */
92242 i64 iA;
92244 i64 iB;
93640 i64 nByte; /* Data space required for this record */
93641 i64 nZero; /* Number of zero bytes at the end of the record */
93761 i64 i = pRec->u.i;
93955 i64 nEntry;
94984 i64 iKey; /* The rowid we are to seek to */
95739 i64 v; /* The new rowid */
95780 # define MAX_ROWID (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
95994 i64 iKey; /* Rowid value to insert with */
96066 i64 iKey = sqlite3BtreeIntegerKey(pC->uc.pCursor);
96294 i64 v;
96435 i64 sz;
96802 i64 rowid; /* Rowid that P1 current points to */
96955 i64 nCellKey = 0;
97069 i64 nChange;
97377 i64 val;
97737 i64 x;
98033 sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]);
99951 i64 iEof; /* Bytes of data stored in pFd */
100127 i64 iReadOff; /* Current read offset */
100128 i64 iEof; /* 1 byte past EOF for this PmaReader */
100175 i64 iStartOff; /* Offset to start writing file at */
100196 i64 iWriteOff; /* Offset of start of buffer in file */
100287 if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){
100391 if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){
100410 i64 iOff /* Offset in pFile */
100503 i64 iStart, /* Start offset in pFile */
100505 i64 *pnByte /* IN/OUT: Increment this value by PMA size */
100770 i64 mxCache; /* Cache size in bytes*/
100847 i64 t;
100853 i64 t = 0;
100862 i64 t;
100873 i64 t;
101062 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
101063 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
101083 i64 nExtend, /* Attempt to extend file to this size */
101094 i64 max = SQLITE_MAX_MMAP_SIZE;
101233 i64 iStart /* Offset of pFd to begin writing at */
101284 static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){
101332 i64 iSz = pList->szPMA + sqlite3VarintLen(pList->szPMA) + pTask->file.iEof;
101658 i64 iStart = pIncr->iStartOff;
101672 i64 iEof = writer.iWriteOff + writer.iBufEnd;
102087 i64 *piOffset, /* IN/OUT: Readr offset in pTask->file */
102091 i64 iOff = *piOffset;
102099 i64 nDummy = 0;
102125 i64 nDiv = SORTER_MAX_MERGE_COUNT;
102126 while( nDiv < (i64)nPMA ){
102222 i64 iReadOff = 0;
103126 i64 iOff = 0;
103241 i64 iOff = p->nChunkSize;
106980 i64 i;
108707 i64 mask = (1<<nExpr)-1;
109513 i64 value;
111853 i64 nExclude; /* Number of tables to exclude from the search */
111868 i64 i, j;
113513 i64 nNew = sqlite3Strlen30(zNew);
113514 i64 nSql = sqlite3Strlen30(zSql);
113519 i64 nQuot = 0;
114878 i64 iRowid; /* Rowid in main table of the key */
114940 static void sampleSetRowidInt64(sqlite3 *db, StatSample *p, i64 iRowid){
116250 i64 nSum100 = 0; /* Number of terms contributing to sumEq */
116251 i64 nDist100; /* Number of distinct values in index */
116255 nDist100 = (i64)100 * pFinal->anDLt[iCol];
116259 nDist100 = ((i64)100 * pIdx->aiRowEst[0]) / pIdx->aiRowEst[iCol+1];
116277 avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
118196 i64 nColl;
118197 i64 n;
119022 z = sqlite3DbMallocRaw(db, (i64)sName.n + 1 + (i64)sType.n + (sType.n>0) );
119036 aNew = sqlite3DbRealloc(db,p->aCol,((i64)p->nCol+1)*sizeof(p->aCol[0]));
121063 i64 nByte;
124879 i64 iVal = sqlite3_value_int64(argv[0]);
125036 i64 p1, p2;
125163 static void *contextMalloc(sqlite3_context *context, i64 nByte){
125194 z1 = contextMalloc(context, ((i64)n)+1);
125213 z1 = contextMalloc(context, ((i64)n)+1);
125930 z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
125950 i64 n;
125980 i64 nOut; /* Maximum size of zOut */
126011 zOut = contextMalloc(context, (i64)nOut);
126098 ((i64)nChar)*(sizeof(char*)+sizeof(unsigned)));
126261 i64 iSum; /* Integer sum */
126262 i64 cnt; /* Number of elements summed */
126287 i64 v = sqlite3_value_int64(argv[0]);
126313 i64 v = sqlite3_value_int64(argv[0]);
126357 i64 n;
134427 static void returnSingleInt(Vdbe *v, i64 value){
134874 i64 x = 0;
134991 i64 iLimit = -2;
140553 i64 n, m;
142642 aCsrMap = sqlite3DbMallocZero(db, ((i64)pParse->nTab+1)*sizeof(int));
149664 i64 saved_nChange; /* Saved value of db->nChange */
149665 i64 saved_nTotalChange; /* Saved value of db->nTotalChange */
149739 i64 sz = 0;
158603 i64 nRow0 = sqlite3LogEstToInt(p->aiRowLogEst[0]);
163278 i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p));
163284 i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p));
163293 i64 nValue;
163294 i64 nStep;
163295 i64 nTotal;
163333 i64 nStep;
163344 i64 iVal;
163351 if( ((i64)fVal)!=fVal ) goto error_out;
163352 iVal = (i64)fVal;
163537 i64 nTotal; /* Total rows in partition */
163538 i64 nParam; /* Parameter passed to ntile(N) */
163539 i64 iRow; /* Current row */
163587 i64 nLarge = p->nTotal - p->nParam*nSize;
163588 i64 iSmall = nLarge*(nSize+1);
163589 i64 iRow = p->iRow;
179450 typedef sqlite3_int64 i64; /* 8-byte signed integer */
179475 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
179476 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
179623 i64 iMinDocid; /* Minimum docid to return */
179624 i64 iMaxDocid; /* Maximum docid to return */
179701 i64 iOrDocid;
179836 i64 nBuffer; /* Allocated size of aBuffer[] in bytes */
179899 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(i64 nByte);
181223 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
181540 i64 nAlloc = 0; /* Size of allocated buffer */
181586 if( (i64)nPrefix+nSuffix>nAlloc ){
181588 nAlloc = ((i64)nPrefix+nSuffix) * 2;
181612 *piFirst = (i64)iChild;
181617 *piLast = (i64)iChild;
181624 if( piFirst ) *piFirst = (i64)iChild;
181625 if( piLast ) *piLast = (i64)iChild;
182159 *pVal = (i64)((u64)*pVal - iVal);
182161 *pVal = (i64)((u64)*pVal + iVal);
182213 /* #define DOCID_CMP(i1, i2) ((bDescDoclist?-1:1) * (i64)((u64)i1-i2)) */
182280 aOut = sqlite3_malloc64((i64)n1+n2+FTS3_VARINT_MAX-1+FTS3_BUFFER_PADDING);
182532 pTS->aaOutput[0] = sqlite3_malloc64((i64)nDoclist + FTS3_VARINT_MAX + 1);
182913 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
183184 i64 iLastRowid = sqlite3_last_insert_rowid(p->db);
184389 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
190083 i64 nLeafData; /* Number of bytes of leaf data written */
190548 i64 nNew = p->nSpace * 2;
190968 i64 iDocid = sqlite3_column_int64(pSelect, 0);
191112 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
191229 pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2);
191290 ** overflow - hence the (i64) casts. */
191291 if( (i64)nPrefix+nSuffix>(i64)pReader->nTermAlloc ){
191292 i64 nNew = ((i64)nPrefix+nSuffix)*2;
191437 pReader->iDocid = (i64)((u64)pReader->iDocid - iDelta);
191439 pReader->iDocid = (i64)((u64)pReader->iDocid + iDelta);
191968 char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2);
192132 i64 nReq; /* Number of bytes required on leaf page */
192247 char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2);
192390 static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){
192555 i64 nList
192616 rc = fts3MsrBufferData(pMsr, pList, (i64)nList+1);
192753 static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, i64 nReq){
192849 (i64)pCsr->nDoclist);
192894 iDelta = (i64)((u64)iPrev - (u64)iDocid);
192897 iDelta = (i64)((u64)iDocid - (u64)iPrev);
192903 (i64)nByte+nDoclist+FTS3_NODE_PADDING);
192929 rc = fts3GrowSegReaderBuffer(pCsr, (i64)nDoclist+FTS3_NODE_PADDING);
192974 i64 *piEndBlock,
192975 i64 *pnByte
192985 *piEndBlock = (i64)iVal;
192995 *pnByte = ((i64)iVal * (i64)iMul);
193016 i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1;
193017 i64 nLimit = (nByte*3)/2;
193027 i64 nSize = 0, dummy;
193119 i64 iMaxLevel = 0; /* Max level number for this index/langid */
194751 i64 iAbsLevel, /* First varint to store in hint */
194758 pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], (i64)nInput);
194770 static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){
194820 const i64 nMod = FTS3_SEGDIR_MAXLEVEL * p->nIndex;
195069 i64 iDocid, /* Docid for current row. */
195124 i64 iDocid = 0;
195125 i64 iCol = 0;
195141 iDocid = (i64)((u64)iDocid - iVal);
195143 iDocid = (i64)((u64)iDocid + iVal);
195210 i64 iDocid = sqlite3_column_int64(pStmt, 0);
195725 typedef sqlite3_int64 i64;
195778 i64 iHead; /* Next value in position list */
195780 i64 iTail; /* Next value in trailing position list */
195944 static void fts3GetDeltaPosition(char **pp, i64 *piPos){
196053 static void fts3SnippetAdvance(char **ppIter, i64 *piIter, int iNext){
196056 i64 iIter = *piIter;
196139 i64 iCsr = pPhrase->iTail;
196185 i64 iFirst = 0;
197249 i64 iPos; /* Position just read from pList */
197250 i64 iOff; /* Offset of this term from read positions */
197269 i64 iPos = 0; /* First position in position-list */
201019 typedef sqlite3_int64 i64;
201111 i64 nRowEst; /* Estimated number of rows in this table */
201307 i64 iNode; /* The node number */
201321 i64 iRowid; /* Node or entry ID */
201466 static i64 readInt64(u8 *p){
201470 return (i64)_byteswap_uint64(x);
201474 return (i64)__builtin_bswap64(x);
201476 i64 x;
201480 return (i64)(
201525 static int writeInt64(u8 *p, i64 i){
201527 i = (i64)__builtin_bswap64((u64)i);
201530 i = (i64)_byteswap_uint64((u64)i);
201569 static unsigned int nodeHash(i64 iNode){
201577 static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){
201644 i64 iNode, /* Node number to load */
201867 static i64 nodeGetRowid(
202306 i64 iRowid,
202724 i64 iRowid, /* The rowid searching for */
202732 i64 iNode = sqlite3_column_int64(pRtree->pReadRowid, 0);
202800 i64 iRowid = sqlite3_value_int64(argv[0]);
202801 i64 iNode = 0;
202936 i64 nRow; /* Estimated rows returned by this scan */
203036 case 5: area = (i64)p->aCoord[9].i - (i64)p->aCoord[8].i;
203037 case 4: area *= (i64)p->aCoord[7].i - (i64)p->aCoord[6].i;
203038 case 3: area *= (i64)p->aCoord[5].i - (i64)p->aCoord[4].i;
203039 case 2: area *= (i64)p->aCoord[3].i - (i64)p->aCoord[2].i;
203040 default: area *= (i64)p->aCoord[1].i - (i64)p->aCoord[0].i;
203503 i64 iRowid,
203625 i64 iRowid = nodeGetRowid(pRtree, pRight, i);
203636 i64 iRowid = nodeGetRowid(pRtree, pLeft, i);
203682 i64 iNode; /* Node number of parent node */
203985 static int rtreeNewRowid(Rtree *pRtree, i64 *piRowid){
204050 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
204386 i64 nRow = RTREE_MIN_ROWEST;
204981 static u8 *rtreeCheckGetNode(RtreeCheck *pCheck, i64 iNode, int *pnNode){
205028 i64 iKey, /* Key for mapping */
205029 i64 iVal /* Expected value for mapping */
205054 i64 ii = sqlite3_column_int64(pStmt, 0);
205079 i64 iNode, /* Node id to use in error messages */
205127 i64 iNode /* Node to check */
205161 i64 iVal = readInt64(pCell);
205186 static void rtreeCheckCount(RtreeCheck *pCheck, const char *zTbl, i64 nExpect){
205194 i64 nActual = sqlite3_column_int64(pCount, 0);
206713 i64 iRowid = sqlite3_value_int64(argv[0]);
206714 i64 iNode = 0;
206939 i64 oldRowid; /* The old rowid */
206941 i64 newRowid; /* The new rowid */
209010 typedef sqlite3_int64 i64;
209032 i64 iWalCksum;
209034 i64 nProgress;
209036 i64 iOalSz;
209037 i64 nPhaseOneStep;
209203 i64 iOalSz;
209204 i64 nPhaseOneStep;
209218 i64 iWalCksum;
209219 i64 szTemp; /* Current size of all temp files in use */
209220 i64 szTempLimit; /* Total size limit for temp files */
209256 i64 sz; /* Size of file in bytes (temp only) */
211784 static i64 rbuShmChecksum(sqlite3rbu *p){
211785 i64 iRet = 0;
211791 iRet = ((i64)ptr[10] << 32) + ptr[11];
211897 static int rbuCaptureWalRead(sqlite3rbu *pRbu, i64 iOff, int iAmt){
211916 iFrame = (u32)((iOff-32) / (i64)(iAmt+24)) + 1;
211929 static int rbuCaptureDbWrite(sqlite3rbu *pRbu, i64 iOff){
211942 i64 iOff;
211945 iOff = (i64)(pFrame->iWalFrame-1) * (p->pgsz + 24) + 32 + 24;
211949 iOff = (i64)(pFrame->iDbPage-1) * p->pgsz;
212355 RBU_STATE_COOKIE, (i64)pFd->iCookie,
213094 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
213108 *pnTwo = (int)(MAX_PROGRESS * (i64)p->nStep / (i64)p->nFrame);
213311 i64 nDiff = nNew - pFd->sz;
213531 i64 szNew = iAmt+iOfst;
214320 i64 nUnused; /* Value of 'unused' column */
214321 i64 nPayload; /* Value of 'payload' column */
214322 i64 iOffset; /* Value of 'pgOffset' column */
214323 i64 szPage; /* Value of 'pgSize' column */
214710 pCsr->iOffset = (i64)pCsr->szPage * (pCsr->iPageno - 1);
215567 i64 nMalloc; /* Number of bytes of data allocated */
215568 i64 nMaxChangesetSize;
215959 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
215996 static unsigned int sessionHashAppendI64(unsigned int h, i64 i){
216058 i64 iVal;
216401 i64 iVal = sessionGetI64(a);
216715 i64 nNew = 2;
217512 static int sessionBufferGrow(SessionBuffer *p, i64 nByte, int *pRc){
217514 i64 nReq = p->nBuf + nByte;
217517 i64 nNew = p->nAlloc ? p->nAlloc : 128;
217982 i64 iVal = sessionGetI64(a);
217992 i64 iVal = sessionGetI64(a);
221959 typedef sqlite3_int64 i64;
221988 # define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
221989 # define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
222207 static void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64);
222218 #define fts5BufferAppendVarint(a,b,c) sqlite3Fts5BufferAppendVarint(a,b,(i64)c)
222246 i64 iPos; /* (iCol<<32) + iPos */
222256 i64 iPrev;
222258 static int sqlite3Fts5PoslistWriterAppend(Fts5Buffer*, Fts5PoslistWriter*, i64);
222259 static void sqlite3Fts5PoslistSafeAppend(Fts5Buffer*, i64*, i64);
222264 i64 *piOff /* IN/OUT: Current offset */
222294 i64 iRowid;
222326 i64 iRowid,
222362 static int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch);
222408 i64 iDocid /* Docid to add or remove data from */
222428 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize);
222508 static Fts5Table *sqlite3Fts5TableFromCsrid(Fts5Global*, i64);
222529 i64 iRowid, /* Rowid for this entry */
222584 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**);
222585 static int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*);
222586 static int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64);
222593 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol);
222594 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnAvg);
222595 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow);
222653 ** i64 iRowid = sqlite3Fts5ExprRowid(pExpr);
222656 static int sqlite3Fts5ExprFirst(Fts5Expr*, Fts5Index *pIdx, i64 iMin, int bDesc);
222657 static int sqlite3Fts5ExprNext(Fts5Expr*, i64 iMax);
222659 static i64 sqlite3Fts5ExprRowid(Fts5Expr*);
222676 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr*, i64);
225039 static void sqlite3Fts5BufferAppendVarint(int *pRc, Fts5Buffer *pBuf, i64 iVal){
225166 i64 *piOff /* IN/OUT: Current offset */
225174 i64 iOff = *piOff;
225183 iOff = ((i64)iVal) << 32;
225193 *piOff = (iOff & (i64)0x7FFFFFFF<<32)+((iOff + (iVal-2)) & 0x7FFFFFFF);
225232 i64 *piPrev,
225233 i64 iPos
225236 static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32;
225250 i64 iPos
226397 #define FTS5_LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
226439 int (*xNext)(Fts5Expr*, Fts5ExprNode*, int, i64);
226441 i64 iRowid; /* Current rowid */
226675 i64 nText = strlen(zText);
226804 static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){
226805 i64 iRet = 0;
226814 i64 iRowid = p->pIter->iRowid;
226831 i64 iRowid,
226870 i64 iPrev = -1;
226874 i64 iMin = FTS5_LARGEST_INT64;
226960 i64 iPos = aIter[0].iPos;
226965 i64 iAdj = iPos + i;
227001 i64 iPos; /* Current position */
227002 i64 iLookahead; /* Next position */
227005 #define FTS5_LOOKAHEAD_EOF (((i64)1) << 62)
227091 i64 iMin;
227092 i64 iMax;
227114 i64 iPos = a[i].reader.iPos;
227152 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
227156 i64 iLast = *piLast;
227157 i64 iRowid;
227178 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
227182 i64 iLast = *piLast;
227188 i64 iRowid = p->pIter->iRowid;
227328 i64 iLhs,
227329 i64 iRhs
227408 i64 iLast; /* Lastest rowid any iterator points to */
227437 i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0);
227475 i64 iFrom
227486 i64 iRowid = fts5ExprSynonymRowid(pTerm, pExpr->bDesc, 0);
227492 i64 ii = p->pIter->iRowid;
227568 i64 iFrom
227611 i64 iFrom
227614 i64 iLast = pNode->iRowid;
227644 i64 iLast = pAnd->iRowid;
227695 i64 iFrom
227738 i64 iFrom
227859 static int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){
227890 static int sqlite3Fts5ExprNext(Fts5Expr *p, i64 iLast){
227908 static i64 sqlite3Fts5ExprRowid(Fts5Expr *p){
229268 i64 iOff;
229329 sCtx.iOff = (((i64)iCol) << 32) - 1;
229359 static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){
229403 static void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){
229515 i64 iRowid; /* Rowid of last value written */
229687 i64 iRowid, /* Rowid for this entry */
230238 ((i64)(segid) << (FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)) + \
230239 ((i64)(dlidx) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B)) + \
230240 ((i64)(height) << (FTS5_DATA_PAGE_B)) + \
230241 ((i64)(pgno)) \
230293 i64 iWriteRowid; /* Rowid for current doc being written */
230309 i64 iStructVersion; /* data_version when pStruct read */
230317 i64 iRowid;
230359 i64 iPrev; /* Previous rowid value written to page */
230365 i64 iPrevRowid; /* Previous rowid written to current leaf */
230439 i64 iLeafOffset; /* Byte offset within current leaf */
230461 i64 iRowid; /* Current rowid */
230525 i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */
230552 i64 iRowid; /* First rowid on leaf iLeafPgno */
230639 static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
230717 static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){
230751 static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){
230775 static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){
230797 i64 iFirst = FTS5_SEGMENT_ROWID(iSegid, 0);
230798 i64 iLast = FTS5_SEGMENT_ROWID(iSegid+1, 0)-1;
230858 i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel);
231067 static i64 fts5IndexDataVersion(Fts5Index *p){
231068 i64 iVersion = 0;
231198 fts5BufferSafeAppendVarint(&buf, (i64)pStruct->nWriteCounter);
231354 i64 iVal;
231449 i64 iVal;
231548 i64 iRowid = FTS5_DLIDX_ROWID(iSegid, i, iLeafPg);
231577 static i64 fts5DlidxIterRowid(Fts5DlidxIter *pIter){
231677 i64 iOff = pIter->iLeafOffset;
231710 i64 iOff = pIter->iLeafOffset; /* Offset to read at */
231985 i64 iDelta;
232198 i64 iAbs = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno);
232374 if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){
232389 if( (i64)iOff+nNew>n || nNew<1 ){
232456 i64 val = sqlite3_column_int(pIdxSelect, 0);
232773 i64 iMatch /* Advance iterator at least this far */
232923 i64 iFrom /* Advance at least as far as this */
233610 static i64 fts5MultiIterRowid(Fts5Iter *pIter){
233621 i64 iMatch
233624 i64 iRowid;
233820 sqlite3_bind_int64(p->pIdxWriter, 3, bFlag + ((i64)pWriter->iBtPage<<1));
233869 static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){
233870 i64 iRowid;
233886 i64 iRowid
233892 i64 iVal;
233909 i64 iFirst = fts5DlidxExtractFirstRowid(&pDlidx->buf);
233930 i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno);
233946 i64 iRowid;
234073 i64 iRowid
234122 i64 dummy;
234230 i64 iLeafRowid;
234628 i64 iRowid = 0;
234894 i64 iDelta;
234937 i64 *piLastRowid, /* IN/OUT: Previous rowid written (if any) */
234938 i64 iRowid /* Rowid to append */
234961 static void fts5NextRowid(Fts5Buffer *pBuf, int *piOff, i64 *piRowid){
234984 i64 iRowid1 = 0;
234985 i64 iRowid2 = 0;
234986 i64 iOut = 0;
235022 i64 iPos; /* For iterating through a position list */
235076 i64 iLastRowid = 0;
235112 i64 iPrev = 0;
235239 i64 iLastRowid = 0;
235342 static int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){
235680 static int sqlite3Fts5IterNextFrom(Fts5IndexIter *pIndexIter, i64 iMatch){
235715 static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){
235720 memset(anSize, 0, sizeof(i64) * nCol);
235798 i64 iRowid,
235836 i64 iRowid = fts5DlidxIterRowid(pDlidx);
235839 cksum1 += iRowid + ((i64)pgno<<32);
235848 i64 iRowid = fts5DlidxIterRowid(pDlidx);
235851 cksum2 += iRowid + ((i64)pgno<<32);
235873 i64 rowid = pIter->iRowid;
236106 i64 iRow; /* Rowid for this leaf */
236162 i64 iKey;
236185 i64 iRowid;
236279 i64 iPos = 0; /* Position read from poslist */
236281 i64 iRowid = fts5MultiIterRowid(pIter);
236328 i64 iRowid, /* Rowid from %_data table */
236334 *piPgno = (int)(iRowid & (((i64)1 << FTS5_DATA_PAGE_B) - 1));
236337 *piHeight = (int)(iRowid & (((i64)1 << FTS5_DATA_HEIGHT_B) - 1));
236343 *piSegid = (int)(iRowid & (((i64)1 << FTS5_DATA_ID_B) - 1));
236348 static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){
236472 i64 iDocid = 0;
236486 i64 iDelta;
236517 i64 iRowid = 0;
236549 i64 iRowid; /* Rowid for record being decoded */
236766 i64 iRowid;
236909 i64 iNextId; /* Used to allocate unique cursor ids */
236969 i64 iRowid; /* Current rowid */
236999 i64 iCsrId; /* Cursor id */
237004 i64 iFirstRowid; /* Return no rowids earlier than this */
237005 i64 iLastRowid; /* Return no rowids later than this */
237010 i64 iSpecial; /* Result of special query */
237700 i64 iRowid = sqlite3Fts5ExprRowid(pCsr->pExpr);
238012 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
238234 static i64 fts5CursorRowid(Fts5Cursor *pCsr){
238418 i64 *piRowid
238514 i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */
238529 i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */
238537 i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
238538 i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
238635 static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){
238881 i64 iRowid = fts5CursorRowid(pCsr);
239178 static Fts5Cursor *fts5CursorFromCsrid(Fts5Global *pGlobal, i64 iCsrId){
239194 i64 iCsrId;
239217 i64 iCsrId /* Id of cursor to find */
239778 i64 nTotalRow; /* Total number of rows in FTS table */
239779 i64 *aTotalSize; /* Total sizes of each column */
240045 + pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */
240050 p->aTotalSize = (i64*)&p[1];
240149 i64 iDel,
240190 p->aTotalSize[iCol-1] -= (i64)ctx.szCol;
240218 i64 iRowid, /* id value */
240284 static int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel, sqlite3_value **apVal){
240375 i64 iRowid = sqlite3_column_int64(pScan, 0);
240392 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
240432 static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){
240456 i64 *piRowid
240491 i64 iRowid
240518 p->aTotalSize[ctx.iCol] += (i64)ctx.szCol;
240531 static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){
240561 i64 iRowid;
240647 i64 *aTotalSize; /* Array of size pConfig->nCol */
240654 aTotalSize = (i64*)sqlite3_malloc64(pConfig->nCol*(sizeof(int)+sizeof(i64)));
240657 memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol);
240725 i64 nRow = 0;
240730 i64 nRow = 0;
240813 static int sqlite3Fts5StorageDocsize(Fts5Storage *p, i64 iRowid, int *aCol){
240842 static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnToken){
240860 static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){
240879 i64 iLastRowid = sqlite3_last_insert_rowid(p->pConfig->db);
243534 i64 *aCnt;
243535 i64 *aDoc;
243538 i64 rowid; /* This table's current rowid value */
243542 i64 iInstPos;
243820 i64 iId = sqlite3_column_int64(pStmt, 0);
243841 i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
243848 pCsr->aCnt = (i64*)&pCsr[1];
243909 i64 *pp = &pCsr->iInstPos;
243976 memset(pCsr->aCnt, 0, nCol * sizeof(i64));
243977 memset(pCsr->aDoc, 0, nCol * sizeof(i64));
243984 i64 iPos = 0; /* 64-bit position read from poslist */
244152 i64 iVal = 0;