Lines Matching refs:Offset
1225 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1513 ** between 0 and this upper bound as its "offset" argument.
5437 ** from the open BLOB, starting at offset iOffset.)^
5439 ** ^If offset iOffset is less than N bytes from the end of the BLOB,
5465 ** into the open BLOB, starting at offset iOffset.
5473 ** ^If offset iOffset is less than N bytes from the end of the BLOB,
7539 ** to constants so that the offset of the corresponding field in an
7542 ** offset = 36 + (idx * 4)
7544 ** For example, the free-page-count field is located at byte offset 36 of
7546 ** byte offset 64 (== 36+4*7).
7586 SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*);
7590 SQLITE_PRIVATE int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
7597 SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
8671 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
8672 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
9408 int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */
10137 ** limit and nOffset to the value of the offset (or 0 if there is not
10138 ** offset). But later on, nLimit and nOffset become the memory locations
10139 ** in the VDBE that record the limit and offset counters.
10165 Expr *pOffset; /* OFFSET expression. NULL means not used. */
10166 int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
12680 int tz; /* Timezone offset in minutes */
13760 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
13762 return id->pMethods->xRead(id, pBuf, amt, offset);
13764 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
13766 return id->pMethods->xWrite(id, pBuf, amt, offset);
13800 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
13801 return id->pMethods->xShmLock(id, offset, n, flags);
16010 int iOffset; /* An offset into mem5.aCtrl[] */
18321 etByte charset; /* Offset into aDigits[] of the digits string */
18322 etByte prefix; /* Offset into aPrefix[] of the prefix string */
21764 sqlite3_int64 offset /* Begin reading at this offset */
21772 if( DosSetFilePtr(pFile->h, offset, FILE_BEGIN, &fileLocation) != NO_ERROR ){
21795 sqlite3_int64 offset /* Offset into the file to begin writing at */
21805 if( DosSetFilePtr(pFile->h, offset, FILE_BEGIN, &fileLocation) != NO_ERROR ){
22714 SHORT minute; /* needs to be able to cope with negative timezone offset */
24043 ** range', a range of 510 bytes at a well known offset.
25195 unsigned long long offset; /* offset to first byte to lock */
25214 unsigned long long offset, /* First byte to be locked */
25223 pb.offset = offset;
25229 offset, length));
25678 ** Seek to the offset passed as the second argument, then read cnt
25690 static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){
25697 do{ got = pread(id->h, pBuf, cnt, offset); }while( got<0 && errno==EINTR );
25700 do{ got = pread64(id->h, pBuf, cnt, offset); }while( got<0 && errno==EINTR );
25703 newOffset = lseek(id->h, offset, SEEK_SET);
25705 if( newOffset!=offset ){
25719 OSTRACE(("READ %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED));
25732 sqlite3_int64 offset
25742 || offset>=PENDING_BYTE+512
25743 || offset+amt<=PENDING_BYTE
25747 got = seekAndRead(pFile, offset, pBuf, amt);
25762 ** Seek to the offset in id->offset then read cnt bytes into pBuf.
25763 ** Return the number of bytes actually read. Update the offset.
25768 static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
25775 do{ got = pwrite(id->h, pBuf, cnt, offset); }while( got<0 && errno==EINTR );
25777 do{ got = pwrite64(id->h, pBuf, cnt, offset); }while( got<0 && errno==EINTR );
25779 newOffset = lseek(id->h, offset, SEEK_SET);
25780 if( newOffset!=offset ){
25795 OSTRACE(("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED));
25808 sqlite3_int64 offset
25819 || offset>=PENDING_BYTE+512
25820 || offset+amt<=PENDING_BYTE
25833 if( offset<=24 && offset+amt>=27 ){
25839 if( rc!=4 || memcmp(oldCntr, &((char*)pBuf)[24-offset], 4)!=0 ){
25846 while( amt>0 && (wrote = seekAndWrite(pFile, offset, pBuf, amt))>0 ){
25848 offset += wrote;
26167 i64 iWrite; /* Next offset to write to */
30236 if (lpOverlapped->Offset == (DWORD)SHARED_FIRST &&
30262 ** argument to offset iOffset within the file. If successful, return 0.
30266 LONG upperBits; /* Most sig. 32 bits of new offset */
30267 LONG lowerBits; /* Least sig. 32 bits of new offset */
30274 ** containing the lower 32-bits of the new file-offset. Or, if it fails,
30276 ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine
30340 sqlite3_int64 offset /* Begin reading at this offset */
30349 if( seekWinFile(pFile, offset) ){
30373 sqlite3_int64 offset /* Offset into the file to begin writing at */
30385 rc = seekWinFile(pFile, offset);
30538 ovlp.Offset = SHARED_FIRST;
30967 int ofst, /* Offset to first byte to be locked/unlocked */
30982 ovlp.Offset = ofst;
31433 OSTRACE(("SHM-MAP pid-%d map region=%d offset=%d size=%d %s\n",
35243 ** the savepoint is active, then iHdrOffset is set to the byte offset
35250 i64 iOffset; /* Starting offset in main journal */
35287 ** (the 4-byte header field at byte offset 24 of the database file) is
35360 ** larger than the size of the database (the value stored at offset
35456 i64 journalOff; /* Current write offset in the journal file */
35457 i64 journalHdr; /* Byte offset to previous journal header */
35823 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
35825 int rc = sqlite3OsRead(fd, ac, sizeof(ac), offset);
35842 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
35845 return sqlite3OsWrite(fd, ac, 4, offset);
36046 ** Return the offset of the sector boundary at or immediately
36061 i64 offset = 0;
36064 offset = ((c-1)/JOURNAL_HDR_SZ(pPager) + 1) * JOURNAL_HDR_SZ(pPager);
36066 assert( offset%JOURNAL_HDR_SZ(pPager)==0 );
36067 assert( offset>=c );
36068 assert( (offset-c)<JOURNAL_HDR_SZ(pPager) );
36069 return offset;
36269 i64 iHdrOff; /* Offset of journal header being read */
36388 i64 iHdrOff; /* Offset of header in journal file */
36826 ** of the page data, starting with byte offset (pPager->pageSize%200).
36866 ** The page begins at offset *pOffset into the file. The *pOffset
36902 i64 *pOffset, /* Offset of record to playback */
37725 ** the header and the sqlite version number at offset 96.
37942 ** offset PagerSavepoint.iOffset and continuing to
38055 i64 offset = pSavepoint->iSubRec*(4+pPager->pageSize);
38061 assert( offset==ii*(4+pPager->pageSize) );
38062 rc = pager_playback_one_page(pPager, &offset, pDone, 0, 1);
38662 ** Variable iNextHdrOffset is set to the offset at which this
38808 i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */
38818 rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize, offset);
38901 i64 offset = pPager->nSubRec*(4+pPager->pageSize);
38906 rc = write32bits(pPager->sjfd, offset, pPg->pgno);
38908 rc = sqlite3OsWrite(pPager->sjfd, pData2, pPager->pageSize, offset+4);
39619 ** at offset 24 into the file. The first 4 of these 16 bytes are
40333 ** byte offset 24 of the pager file. The secondary change counter at
40334 ** 92 is also updated, as is the SQLite version number at offset 96.
41908 ** to avoid having to offset aReadMark[] indexs by one. Readers holding
41974 ** Return the offset of frame iFrame in the write-ahead log file,
41975 ** assuming a database page size of szPage bytes. The offset returned
42622 int iLock; /* Lock offset to lock for checkpoint */
42656 i64 iOffset; /* Next offset to read from log file */
44116 i64 iOffset; /* Write offset in log file */
44427 ** OFFSET SIZE DESCRIPTION
44497 ** OFFSET SIZE DESCRIPTION
44499 ** 1 2 byte offset to the first freeblock
44522 ** freeblocks. Each freeblock is at least 4 bytes in size. The byte offset
44528 ** in the page header at offset 7.
44531 offset of the next freeblock
44654 u16 maskPage; /* Mask for page offset */
44824 u16 iOverflow; /* Offset to overflow page number. Zero if no overflow */
44920 ** the offset of the requested map entry.
45396 ** This routine is used to extract the "offset to cell content area" value
45398 ** is empty, the offset should be 65536, but the 2-byte value stores zero.
46123 int offset; /* Offset in pointer map page */
46143 offset = PTRMAP_PTROFFSET(iPtrmap, key);
46144 if( offset<0 ){
46150 if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
46154 pPtrmap[offset] = eType;
46155 put4byte(&pPtrmap[offset+1], parent);
46174 int offset; /* Offset of entry in pointer map */
46186 offset = PTRMAP_PTROFFSET(iPtrmap, key);
46188 *pEType = pPtrmap[offset];
46189 if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
46420 int hdr; /* Offset to the page header */
46423 int cellOffset; /* Offset to the cell pointer array */
46424 int cbrk; /* Offset to the cell content area */
46608 int iLast; /* Largest possible freeblock offset */
46743 u8 hdr; /* Offset to beginning of page header */
46747 u16 cellOffset; /* Offset from start of page to first cell pointer */
46750 int iCellFirst; /* First allowable cell or freeblock offset */
46751 int iCellLast; /* Last possible cell or freeblock offset */
46823 /* At this point, nFree contains the sum of the offset to the start
46827 ** serves to verify that the offset to the start of the cell-content
48744 /* The database size was written into the offset 28 of the header
48745 ** when the transaction started, so we know that the value at offset
49151 ** A total of "amt" bytes are read or written beginning at "offset".
49161 ** cache to make seeking to the supplied offset more efficient.
49174 u32 offset, /* Begin reading this far into payload */
49195 if( NEVER(offset+amt > nKey+pCur->info.nData)
49203 if( offset<pCur->info.nLocal ){
49205 if( a+offset>pCur->info.nLocal ){
49206 a = pCur->info.nLocal - offset;
49208 rc = copyPayload(&aPayload[offset], pBuf, a, eOp, pPage->pDbPage);
49209 offset = 0;
49213 offset -= pCur->info.nLocal;
49244 if( pCur->aOverflow && pCur->aOverflow[offset/ovflSize] ){
49245 iIdx = (offset/ovflSize);
49247 offset = (offset%ovflSize);
49261 if( offset>=ovflSize ){
49274 offset -= ovflSize;
49285 offset > ovflSize ){
49286 a = ovflSize - offset;
49288 rc = copyPayload(&aPayload[offset+4], pBuf, a, eOp, pDbPage);
49290 offset = 0;
49307 ** begins at "offset".
49313 ** wrong. An error is returned if "offset+amt" is larger than
49316 SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
49321 return accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
49327 ** begins at "offset".
49330 ** wrong. An error is returned if "offset+amt" is larger than
49333 SQLITE_PRIVATE int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
49348 rc = accessPayload(pCur, offset, amt, pBuf, 0);
50743 u32 pc; /* Offset to cell content of cell being deleted */
50893 const int hdr = pPage->hdrOffset; /* Offset of header on pPage */
53412 SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
53442 return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1);
53464 ** Set both the "read version" (single byte at byte offset 18) and
53465 ** "write version" (single byte at byte offset 19) fields in the database
53735 ** page. For each iteration, variable iOff is set to the byte offset
55046 ** to. offset and amt determine what portion of the data or key to retrieve.
55058 int offset, /* Offset from the start of data to return bytes from. */
55079 if( offset+amt<=available && (pMem->flags&MEM_Dyn)==0 ){
55081 pMem->z = &zData[offset];
55088 rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
55090 rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
57033 i64 offset = 0;
57076 rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset);
57077 offset += sqlite3Strlen30(zFile)+1;
58173 int d1; /* Offset into aKey[] of next data element */
58174 u32 idx1; /* Offset into aKey[] of next header element */
60653 u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
60662 u32 offset; /* Offset into the data */
62491 u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
62500 u32 offset; /* Offset into the data */
62624 u.am.szHdr = getVarint32((u8*)u.am.zData, u.am.offset);
62635 if( u.am.offset > 98307 ){
62641 ** to get u.am.nField type values. u.am.offset is an upper bound on this. But
62643 ** in the table, and in that case, 5*u.am.nField+3 might be smaller than u.am.offset.
62645 ** allocation, especially if a corrupt database file has caused u.am.offset
62646 ** to be oversized. Offset is limited to 98307 above. But 98307 might
62654 if( u.am.len > (int)u.am.offset ) u.am.len = (int)u.am.offset;
62676 ** column and u.am.aOffset[u.am.i] will contain the u.am.offset from the beginning
62681 u.am.aOffset[u.am.i] = u.am.offset;
62684 u.am.offset += u.am.szField;
62685 if( u.am.offset<u.am.szField ){ /* True if u.am.offset overflows */
62692 ** table. Set the u.am.offset for any extra columns not present in
62708 if( (u.am.zIdx > u.am.zEndHdr) || (u.am.offset > u.am.payloadSize)
62709 || (u.am.zIdx==u.am.zEndHdr && u.am.offset!=u.am.payloadSize) ){
62842 ** hdr-size field is also a varint which is the offset from the beginning
66520 int iOffset; /* Byte offset of blob in cursor data */
66786 ** and offset cache without causing any IO.
67045 sqlite_int64 iOfst /* Begin reading at this offset */
67066 sqlite_int64 iOfst /* Begin writing at this offset into the file */
67252 sqlite3_int64 iOffset; /* Offset from the beginning of the file */
67275 sqlite_int64 iOfst /* Begin reading at this offset */
67320 sqlite_int64 iOfst /* Begin writing at this offset into the file */
68561 /* Resolve the expressions in the LIMIT and OFFSET clauses. These
70159 assert( p->pOffset==0 ); /* No LIMIT means no OFFSET */
76150 ** parameter is a pointer to an integer that contains the offset at
76153 ** to the specified offset in the buffer and updates *pIdx to refer
79114 ** and LIMIT/OFFSET portion of DELETE and UPDATE statements.
79126 Expr *pOffset, /* The OFFSET clause. May be null */
79145 ** is a limit/offset term to enforce.
79153 /* Generate a select expression tree to enforce the limit/offset
79155 ** DELETE FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
79158 ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
87900 Expr *pOffset /* OFFSET value. NULL means no offset */
87906 assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */
88289 ** Add code to implement the OFFSET
88301 VdbeComment((v, "skip OFFSET records"));
89237 ** that appear in the original SQL statement after the LIMIT and OFFSET
89240 ** the limit and offset. If there is no limit and/or offset, then
89244 ** a limit or offset is defined by pLimit and pOffset. iLimit and
89249 ** the reuse of the same limit and offset registers across multiple
89287 pParse->nMem++; /* Allocate an extra register for limit+offset */
89290 VdbeComment((v, "OFFSET counter"));
89295 VdbeComment((v, "LIMIT+OFFSET"));
89768 /* Suppress the the first OFFSET entries if there is an OFFSET clause
90460 ** (14) The subquery does not use OFFSET.
90480 ** LIMIT and OFFSET clauses.
90540 /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants,
90541 ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET
90542 ** because they could be computed at compile-time. But when LIMIT and OFFSET
90645 ** followed by any ORDER BY, LIMIT and/or OFFSET clauses. This block
90647 ** OFFSET clauses and joins them to the left-hand-side of the original
90854 ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y;
95303 ** called is identified by the second argument, "offset", which is
95304 ** the offset of the method to call in the sqlite3_module structure.
95308 static void callFinaliser(sqlite3 *db, int offset){
95316 x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset);
100235 Expr *pOffset; /* The OFFSET expression. NULL if there is none */
100479 ** yy_shift_ofst[] For each state, the offset into yy_action for
100481 ** yy_reduce_ofst[] For each state, the offset into yy_action for
101020 26, /* OFFSET => ID */
101123 "KEY", "OF", "OFFSET", "PRAGMA",
101345 /* 165 */ "limit_opt ::= LIMIT expr OFFSET expr",
102738 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
103878 testcase( i==40 ); /* OFFSET */
108192 int *piStartOffset, /* OUT: Byte offset of token in input buffer */
108193 int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */
113771 int *piStartOffset, /* OUT: Starting offset of token */
113772 int *piEndOffset, /* OUT: Ending offset of token */
114484 int *piStartOffset, /* OUT: Starting offset of token */
114485 int *piEndOffset, /* OUT: Ending offset of token */
115574 ** *ppOffsetList is set to point to the first column-offset list
115576 ** *pnOffsetList is set to the length of the set of column-offset
115587 /* Pointer p currently points at the first byte of an offset list. The
115589 ** the same offset list.
115595 ** size of the previous offset-list.
115604 ** Fts3SegReader.pOffsetList to point to the next offset list before
117782 ** candidate always starts at offset 0 (even if this candidate has a
117787 /* Advance the 'head' iterator of each phrase to the first offset that
118129 int iEnd = 0; /* Byte offset of end of current token */
118157 int iBegin; /* Offset in zDoc of start of token */
118158 int iFin; /* Offset in zDoc of end of token */
118868 int iOff; /* Offset of this term from read positions */
118943 /* Loop through the table columns, appending offset information to
123029 int *piStartOffset, /* OUT: Starting offset of token */
123030 int *piEndOffset, /* OUT: Ending offset of token */