Lines Matching defs:size

773 #define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
939 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
940 ** mean that writes of blocks that are nnn bytes in size and
944 ** first then the size of the file is extended, never the other
1100 ** The xSectorSize() method returns the sector size of the
1101 ** device that underlies the file. The sector size is the
1126 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
1127 ** mean that writes of blocks that are nnn bytes in size and
1131 ** first then the size of the file is extended, never the other
1148 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1196 ** implements [sqlite3_deserialize()] to set an upper bound on the size
1200 ** of the integer pointed to and the current database size. The integer
1205 ** extends and truncates the database file in chunks of a size specified
1207 ** point to an integer (type int) containing the new chunk-size to use
1624 ** The szOsFile field is the size of the subclassed [sqlite3_file]
1736 ** output buffer xFullPathname. The exact size of the output buffer
2037 ** xSize should return the allocated size of a memory allocation
2038 ** previously obtained from xMalloc or xRealloc. The allocated size
2039 ** is always at least as big as the requested size but may be larger.
2041 ** The xRoundup method returns what would be the allocated size of
2042 ** a memory allocation given a particular requested size. Most memory
2075 int (*xSize)(void*); /* Return the size of an allocation */
2076 int (*xRoundup)(int); /* Round up request size to allocation size */
2194 ** 8-byte aligned memory (pMem), the size of each page cache line (sz),
2196 ** The sz argument should be the size of the largest database page
2226 ** the number of bytes in the memory buffer, and the minimum allocation size.
2234 ** The minimum allocation size is capped at 2**12. Reasonable values
2235 ** for the minimum allocation size are 2**5 through 2**8.</dd>
2264 ** the default size of lookaside memory on each [database connection].
2266 ** size of each lookaside buffer slot and the second is the number of
2268 ** sets the <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
2356 ** that are the default mmap size limit (the default setting for
2357 ** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
2360 ** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size
2362 ** compile-time maximum mmap size set by the
2372 ** that specifies the maximum size of the created heap.
2390 ** to be sorted exceeds the page size times the minimum of the
2397 ** [Statement journals] are held in memory until their size (in bytes)
2410 ** of type (int) - the new value of the sorter-reference size threshold.
2415 ** than the configured sorter-reference size threshold - then a reference
2426 ** [sqlite3_int64] parameter which is the default maximum size for an in-memory
2428 ** size can be adjusted up or down for individual databases using the
2488 ** size of each lookaside buffer slot. ^The third argument is the number of
2489 ** slots. The size of the buffer in the first argument must be greater than
3215 ** buffer supplied as the second parameter whose size is given by
3226 ** ^As long as the buffer size is greater than zero, sqlite3_snprintf()
3228 ** parameter "n" is the total size of the buffer, including space for
3280 ** of at least N bytes in size or NULL if insufficient memory is available.
3281 ** ^If M is the size of the prior allocation, then min(N,M) bytes
3293 ** sqlite3_msize(X) returns the size of that memory allocation in bytes.
3437 ** and limiting database size using the [max_page_count] [PRAGMA]
4261 ** ^(This interface allows the size of various constructs to be limited
4265 ** class of constructs to be size limited. The third parameter is the
4291 ** interface to further control untrusted SQL. The size of the database
4310 ** <dd>The maximum size of any string or BLOB or table row, in bytes.<dd>)^
4579 ** ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of
4843 ** (just an integer to hold its size) while it is being processed.
4870 ** ^[SQLITE_TOOBIG] might be returned if the size of a string or BLOB
5308 ** or sqlite3_column_bytes16() interfaces can be used to determine the size
5421 ** sqlite3_column_bytes16() to find the size of the result. Do not mix calls
5824 ** These routines extract type, size, and content information from
6145 ** a BLOB containing all zero bytes and N bytes in size.
6875 ** the size of the database file in pages, the number of free pages,
7087 ** sqlite3_hard_heap_limit64() is the size of
7091 ** size of heap limits can be determined by invoking
7789 ** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes.
7860 ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of
7861 ** the opened blob. ^The size of a blob may not be changed by this
7862 ** interface. Use the [UPDATE] SQL command to change the size of a
7938 ** ^Returns the size in bytes of the BLOB accessible via the
7941 ** blob content; they cannot change the size of a blob.
7961 ** ^The size of the blob (and hence the maximum value of N+iOffset)
7998 ** not possible to increase the size of a BLOB using this API.
8000 ** [SQLITE_ERROR] is returned and no data is written. The size of the
8596 ** [SQLITE_TOOBIG] if the size of the dynamic string exceeds
8784 ** memory requested being larger than the lookaside slot size.
8858 ** inefficiencies that can be resolved by increasing the cache size.
8990 ** its size or internal structure and never deals with the
9069 ** first parameter, szPage, is the size in bytes of the pages that must
9090 ** suggested maximum cache-size (number of pages stored by) the cache
9374 ** changes the size of the source database or the number of pages remaining,
10717 ** If P is not a NULL pointer, then the size of the database in bytes
10737 ** The size of the database is written into *P even if the
10751 sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */
10777 ** in P. The serialized database P is N bytes in size. M is the size of
10781 ** size does not exceed M bytes.
10786 ** SQLite will try to increase the buffer size using sqlite3_realloc64()
10809 sqlite3_int64 szBuf, /* Total size of buffer pData[] */
10826 ** grow the size of the database using calls to [sqlite3_realloc64()]. This
10828 ** Without this flag, the deserialized database cannot increase in size beyond
11223 ** and *pnChangeset to the size of the changeset in bytes before returning
11336 ** When enabled, this function returns an upper limit, in bytes, for the size
11338 ** called. The final changeset size might be equal to or smaller than the
11339 ** size in bytes returned by this function.
11791 ** is stored in *ppOut, the size of the same buffer is stored in *pnOut, and
11893 ** Add all changes within the changeset (or patchset) in buffer pData (size
11987 ** is returned and the output variables are set to the size of and a
12149 ** is set to the size of the buffer in bytes. It is the responsibility of the
12431 ** to the conflict resolutions described by buffer pRebase (size nRebase
12445 ** in size. This function allocates and populates a buffer with a copy
12449 ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
12514 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
12549 ** points to a buffer nData bytes in size containing the chunk of output
12558 ** no guarantees are made as to the size of the chunks of data returned.
12668 ** chunk size for both input and output. Before returning, the (int) value
12670 ** chunk size.
12785 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
13065 ** size of the token in bytes. The 4th and 5th arguments are the byte offsets
13307 ** limits the size of a row in a table or index.
13310 ** to count the size: 2^31-1 or 2147483647.
13389 ** IMPLEMENTATION-OF: R-30185-15359 The default suggested cache size is -2000,
13390 ** which means the cache size is limited to 2048000 bytes of memory.
13391 ** IMPLEMENTATION-OF: R-48205-43578 The default suggested cache size can be
13427 /* Maximum page size. The upper bound on this value is 65536. This a limit
13434 ** with a page-size of 65536 bytes crashes, then an instance of SQLite
13435 ** compiled with the default page-size limit will not be able to rollback
13445 ** The default size of a database page.
13457 ** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain
13458 ** device characteristics (sector-size and atomic write() support),
14526 ** pointers in size, and so it is a no-op on systems where the pointer
14527 ** size is 8.
14565 ** Default maximum size of memory used by memory-mapped I/O in the VFS
14586 ** not exceed the maximum mmap size.
14811 ** tables in a join to 32 instead of 64. But it also reduces the size
14987 ** The default size of a disk sector
15083 ** that all locks will fit on a single page even at the minimum page size.
15116 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
15188 ** Default maximum size for persistent journal files. A negative
16562 /* Modify the page-size after the cache has been created. */
16565 /* Return the size in bytes of a PCache object. Used to preallocate
16626 /* Set and get the suggested cache-size for the specified pager-cache.
16637 /* Set or get the suggested spill-size for the specified pager-cache.
16639 ** The spill-size is the minimum number of pages in cache before the cache
16658 /* Return the header size */
16662 /* Number of dirty pages as a percentage of the configured cache size */
16857 ** Lookaside malloc is a set of fixed-size buffers that can be used
16889 ** Enhancement on 2019-12-12: Two-size-lookaside
16893 ** The two-size-lookaside enhancement breaks up the lookaside allocation
16894 ** into two pools: One of 128-byte slots and the other of the default size
16896 ** failing over to the full-size pool if that does not work. Thus more
16907 u32 anStat[3]; /* 0: hits. 1: size misses. 2: full misses */
16913 void *pMiddle; /* First byte past end of full-size buffers and
16928 /* Size of the smaller allocations in two-size lookside */
17046 int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
17112 int nVTrans; /* Allocated size of aVTrans */
17579 u8 szEst; /* Est size of value in this column. sizeof(INT)==1 */
17765 LogEst szTabRow; /* Estimated size of each table row in bytes */
18098 LogEst szIdxRow; /* Estimated average row size in bytes */
18456 #define EXPR_FULLSIZE sizeof(Expr) /* Full size */
18464 #define EXPRDUP_REDUCE 0x0001 /* Used reduced-size Expr nodes */
19480 int szLookaside; /* Default lookaside buffer size */
19496 u32 szPma; /* Maximum Sorter PMA size */
19520 sqlite3_int64 mxMemdbSize; /* Default max memdb size */
19528 u32 szSorterRef; /* Min size in bytes to use sorter-refs */
22178 /* The minimum PMA size is set to this value multiplied by the database
22179 ** page size in bytes.
22185 /* Statement journals spill to disk when their size exceeds the following
22205 ** With the two-size-lookaside enhancement, less lookaside is required.
22208 ** using the older 1200,100 configuration without two-size-lookaside.
22219 /* The default maximum size of an in-memory database created using
23615 ** spec into a max size: a b c d e f */
24959 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
24960 return id->pMethods->xTruncate(id, size);
25533 (_sqliteZone_ ? _sqliteZone_->size(_sqliteZone_,x) : malloc_size(x))
25567 ** The memory size function can always be overridden manually by defining
25586 ** Like malloc(), but remember the size of the allocation
25639 ** Report the allocated size of a prior return from xMalloc()
25695 ** Round up a request size to the next valid allocation size.
25810 ** MemBlockHdr tells us the size of the allocation and the number of
25831 ** Number of malloc size increments to track.
25967 ** Round up a request size to the next valid allocation size.
26094 ** Change the size of an existing memory allocation.
26328 ** Maximum size (in Mem3Blocks) of a "small" chunk.
26345 ** size of the allocation in blocks if the allocation is free.
26349 ** previous chunk is free. The u.hdr.prevSize field is the size of
26375 u32 size4x; /* 4x the size of current chunk in Mem3Block elements */
26392 ** Memory available for allocation. nPool is the size of the array
26415 ** occur off of this chunk. szKeyBlk is the size (in Mem3Blocks)
26423 ** Array of lists of free blocks according to the block size
26424 ** for smaller chunks, or a hash on the block size for larger
26458 u32 size, hash;
26462 size = mem3.aPool[i-1].u.hdr.size4x/4;
26463 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
26464 assert( size>=2 );
26465 if( size <= MX_SMALL ){
26466 memsys3UnlinkFromList(i, &mem3.aiSmall[size-2]);
26468 hash = size % N_HASH;
26492 u32 size, hash;
26496 size = mem3.aPool[i-1].u.hdr.size4x/4;
26497 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
26498 assert( size>=2 );
26499 if( size <= MX_SMALL ){
26500 memsys3LinkIntoList(i, &mem3.aiSmall[size-2]);
26502 hash = size % N_HASH;
26539 ** size parameters for check-out and return a pointer to the
26590 ** *pRoot is the head of a list of free chunks of the same size
26591 ** or same size hash. In other words, *pRoot is an entry in either
26606 u32 iNext, prev, size, i, x;
26611 size = mem3.aPool[i-1].u.hdr.size4x;
26612 assert( (size&1)==0 );
26613 if( (size&2)==0 ){
26621 size = i + size/4 - prev;
26623 mem3.aPool[prev-1].u.hdr.size4x = size*4 | x;
26624 mem3.aPool[prev+size-1].u.hdr.prevSize = size;
26628 size /= 4;
26630 if( size>mem3.szKeyBlk ){
26632 mem3.szKeyBlk = size;
26638 ** Return a block of memory of at least nBytes in size.
26659 ** Look for an entry of the correct size in either the small
26729 u32 size, x;
26734 size = mem3.aPool[i-1].u.hdr.size4x/4;
26735 assert( i+size<=mem3.nPool+1 );
26737 mem3.aPool[i+size-1].u.hdr.prevSize = size;
26738 mem3.aPool[i+size-1].u.hdr.size4x &= ~2;
26744 size = mem3.aPool[mem3.iKeyBlk-1].u.hdr.prevSize;
26745 mem3.iKeyBlk -= size;
26746 mem3.szKeyBlk += size;
26763 ** Return the size of an outstanding allocation, in bytes. The
26764 ** size returned omits the 8-byte header overhead. This only
26776 ** Round up a request size to the next valid allocation size.
26809 ** Change the size of an existing memory allocation
26883 u32 size;
26896 for(i=1; i<=mem3.nPool; i+=size/4){
26897 size = mem3.aPool[i-1].u.hdr.size4x;
26898 if( size/4<=1 ){
26899 fprintf(out, "%p size error\n", &mem3.aPool[i]);
26903 if( (size&1)==0 && mem3.aPool[i+size/4-1].u.hdr.prevSize!=size/4 ){
26904 fprintf(out, "%p tail size does not match\n", &mem3.aPool[i]);
26908 if( ((mem3.aPool[i+size/4-1].u.hdr.size4x&2)>>1)!=(size&1) ){
26913 if( size&1 ){
26914 fprintf(out, "%p %6d bytes checked out\n", &mem3.aPool[i], (size/4)*8-8);
26916 fprintf(out, "%p %6d bytes free%s\n", &mem3.aPool[i], (size/4)*8-8,
27019 ** Let n be the size of the largest allocation divided by the minimum
27020 ** allocation size (after rounding all sizes up to a power of 2.) Let M
27042 ** size of the array is a power of 2.
27044 ** The size of this object must be a power of two. That fact is
27054 ** Maximum size of any allocation is ((1<<LOGMAX)*mem5.szAtom). Since
27101 ** size mem5.szAtom. aiFreelist[1] holds blocks of size szAtom*2.
27102 ** aiFreelist[2] holds free blocks of size szAtom*4. And so forth.
27107 ** Space for tracking which blocks are checked out and the size
27178 ** Return the size of an outstanding allocation, in bytes.
27191 ** Return a block of memory of at least nBytes in size.
27226 ** two in order to create a new free block of size iLogsize.
27271 u32 size, iLogsize;
27285 size = 1<<iLogsize;
27286 assert( iBlock+size-1<(u32)mem5.nBlock );
27289 mem5.aCtrl[iBlock+size-1] |= CTRL_FREE;
27293 assert( mem5.currentOut>=(size*mem5.szAtom) );
27295 mem5.currentOut -= size*mem5.szAtom;
27304 iBuddy = iBlock - size;
27307 iBuddy = iBlock + size;
27321 size *= 2;
27327 memset(&mem5.zPool[iBlock*mem5.szAtom], 0x55, size);
27360 ** Change the size of an existing memory allocation.
27393 ** Round up a request size to the next valid allocation size. If
27443 int nMinLog; /* Log base 2 of minimum allocation size in bytes */
27451 /* The size of a Mem5Link object must be a power of two. Verify that
27527 fprintf(out, "freelist items of size %d: %d\n", mem5.szAtom << i, n);
29126 ** Set the soft heap-size limit for the library. An argument of
29167 ** Set the hard heap-size limit for the library. An argument of zero
29315 ** Maximum size of any single memory allocation.
29318 ** a limit on the size parameter to sqlite3_malloc() and sqlite3_realloc().
29323 ** Parnoid applications might want to reduce the maximum allocation size
29325 ** or even smaller would be reasonable upper bounds on the size of a memory
29332 # error Maximum size for SQLITE_MAX_ALLOCATION_SIZE is 2147483391
29384 ** Return the size of a memory allocation previously obtained from
29450 ** Add the size of memory allocation "p" to the count in
29544 ** Change the size of an existing memory allocation
30113 ** If the requested size of the temp buffer is larger than the size
30115 ** Do the size check before the memory allocation to prevent rogue
30134 ** On machines with a small stack size, you can redefine the
30928 /* Force exponential buffer size growth as long as it does not overflow,
30988 ** size of the memory allocation for StrAccum if necessary.
34236 ** The caller must ensure that zOut[] is at least 21 bytes in size.
34808 /* A 32-bit varint is used to store size information in btrees.
34810 ** A 3-byte varint is sufficient, for example, to record the size
35228 ** value for the pair and the size of the name/number pair, respectively.
35420 ** if the new size is the same as the prior size.
35555 unsigned int h; /* the hash of the key modulo hash table size */
35848 int szPage; /* Last known page size */
35849 sqlite3_int64 szDb; /* Database file size. -1 means unknown */
35860 static int kvvfsTruncateDb(sqlite3_file*, sqlite3_int64 size);
35861 static int kvvfsTruncateJrnl(sqlite3_file*, sqlite3_int64 size);
36031 ** If nBuf<=0 then this routine simply returns the size of the data without
36266 ** Read or write the "sz" element, containing the database file size.
36444 static int kvvfsTruncateJrnl(sqlite3_file *pProtoFile, sqlite_int64 size){
36446 SQLITE_KV_LOG(("xTruncate('%s-journal',%lld)\n", pFile->zClass, size));
36447 assert( size==0 );
36454 static int kvvfsTruncateDb(sqlite3_file *pProtoFile, sqlite_int64 size){
36456 if( pFile->szDb>size
36458 && (size % pFile->szPage)==0
36462 SQLITE_KV_LOG(("xTruncate('%s-db',%lld)\n", pFile->zClass, size));
36463 pgno = 1 + size/pFile->szPage;
36470 pFile->szDb = size;
36471 return kvvfsWriteFileSize(pFile, size) ? SQLITE_IOERR : SQLITE_OK;
36508 ** Return the current file-size of an kvvfs-file.
36585 ** Return the sector-size in bytes for an kvvfs-file.
37004 sqlite3_int64 mmapSize; /* Usable size of mapping at pMapRegion */
37005 sqlite3_int64 mmapSizeActual; /* Actual size of mapping at pMapRegion */
37009 int sectorSize; /* Device sector size */
37038 /* In test mode, increase the size of this structure a bit so that
37661 ** truncate a file to any size larger than 2GiB. Silently ignore any
38209 ** incorrectly for zero-size files. See ticket #3260. To work
38211 ** we always increase the file size to 1 by writing a single byte
40443 ** SQLite sets the dataOnly flag if the size of the file is unchanged.
40445 ** to disk, not the inode. We only set dataOnly if the file size is
40446 ** unchanged since the file size is part of the inode. However,
40448 ** file size has changed. The only real difference between fdatasync()
40451 ** We only care about the file size, not the other file attributes, so
40510 /* fdatasync() on HFS+ doesn't yet flush the file size if it changed correctly
40578 ** size, access time, etc) are synced. If dataOnly!=0 then only the
40637 ** Truncate an open file to a specified size
40645 /* If the user has configured a chunk-size for this file, truncate the
40647 ** actual file size after the operation may be larger than the requested
40648 ** size).
40673 /* If the file was just truncated to a size smaller than the currently
40674 ** mapped region, reduce the effective mapping size as well. SQLite will
40687 ** Determine the current size of a file in bytes
40701 /* When opening a zero-size database, the findInodeInfo() procedure
40704 ** layers, we need to report this file size as zero even though it is
40723 ** file-control operation. Enlarge the database to nBytes in size
40724 ** (rounded up to the next chunk-size). If the database is already
40729 i64 nSize; /* Required file size */
40762 ** at offset (nSize-1), to set the size of the file correctly.
40766 int nBlk = buf.st_blksize; /* File-system block size */
41034 /* etfs cluster size writes are atomic */
41053 /* full bitset of atomics from max sector size and smaller */
41061 /* full bitset of atomics from max sector size and smaller */
41074 /* Last chance verification. If the sector size isn't a multiple of 512
41084 ** Return the sector size in bytes of the underlying block device for
41090 ** a database and its journal file) that the sector size will be the
41121 ** Return the system page size.
41336 ** current system page-size.
41343 int shmsz = 32*1024; /* SHM region size */
41344 int pgsz = osGetpagesize(); /* System page size */
41345 assert( ((pgsz-1)&pgsz)==0 ); /* Page size must be a power of 2 */
41401 ** DMS byte and truncate the *-shm file to zero bytes in size. Then
41426 ** -shm header size) rather than 0 as a system debugging aid, to
41606 ** bytes in size.
41659 int nByte = nReqRegion*szRegion; /* Minimum required file size */
42031 ** Attempt to set the size of the memory mapping maintained by file
42047 i64 nNew /* Required mapping size */
42127 ** If parameter nByte is non-negative, then it is the requested size of
42129 ** requested size is the size of the file on disk. The actual size of the
42130 ** created mapping is either the requested size or the value configured
43363 int nOut /* Allocated size of buffer zOut */
44595 ** is a string buffer at least MAXPATHLEN+1 characters in size.
45348 int szChunk; /* Chunk size configured by FCNTL_CHUNK_SIZE */
45384 * The size of the buffer used by sqlite3_win32_write_debug().
45415 * This is the maximum possible initial size of the Win32-specific heap, in
45423 * This is the extra space for the initial size of the Win32-specific heap,
45431 * Calculate the maximum legal cache size, in pages, based on the maximum
45432 * possible initial heap size and the default page size, setting aside the
45442 * This is cache size used in the calculation of the initial size of the
45454 * Make sure that the calculated cache size, in pages, cannot cause the
45455 * initial size of the Win32-specific heap to exceed the maximum amount
45464 * The initial size of the Win32-specific heap. This value may be zero.
45473 * The maximum size of the Win32-specific heap. This value may be zero.
46321 ** "pnLargest" argument, if non-zero, will be used to return the size of the
46584 ** Change the size of an existing memory allocation
46612 ** Return the size of an outstanding allocation, in bytes.
46636 ** Round up a request size to the next valid allocation size.
47980 ** Truncate an open file to a specified size
48012 OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, size=%lld, lock=%d\n",
48015 /* If the user has configured a chunk-size for this file, truncate the
48017 ** actual file size after the operation may be larger than the requested
48018 ** size).
48154 ** Determine the current size of a file in bytes
48717 ** Return the sector size in bytes of the underlying block device for
48723 ** a database and its journal file) that the sector size will be the
48742 ** on allocation size granularity boundaries.
48744 ** to get the granularity size.
48877 OSTRACE(("SHM-LOCK file=%p, lock=%d, offset=%d, size=%d\n",
49270 ** bytes in size.
49317 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
49318 sqlite3_int64 sz; /* Current size of wal-index file */
49381 OSTRACE(("SHM-MAP-CREATE pid=%lu, region=%d, size=%d, rc=%s\n",
49396 OSTRACE(("SHM-MAP-MAP pid=%lu, region=%d, offset=%d, size=%d, rc=%s\n",
49478 ** If parameter nByte is non-negative, then it is the requested size of
49480 ** requested size is the size of the file on disk. The actual size of the
49481 ** created mapping is either the requested size or the value configured
49493 OSTRACE(("MAP-FILE pid=%lu, pFile=%p, size=%lld\n",
50652 ** bytes in size.
51344 sqlite3_int64 szMax; /* Maximum allowed size of the file */
51379 static int memdbTruncate(sqlite3_file*, sqlite3_int64 size);
51600 ** the size of a file, never to increase the size.
51602 static int memdbTruncate(sqlite3_file *pFile, sqlite_int64 size){
51606 if( size>p->sz ){
51610 p->sz = size;
51626 ** Return the current file-size of an memdb-file.
51762 ** Return the sector-size in bytes for an memdb-file.
51947 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
52024 sqlite3_int64 *piSize, /* Write size here, if not NULL */
52107 sqlite3_int64 szBuf, /* Total size of buffer pData[] */
52219 ** The size of the bitmap is fixed when the object is created.
52227 ** sometimes grow into tens of thousands or larger. The size of the
52237 /* Round the union size down to the nearest pointer boundary, since that's how
52244 ** Setting this to the "natural word" size of your CPU may improve
52654 int szCache; /* Configured cache size */
52766 ** Another example is when the database page size is smaller than the
52767 ** disk sector size. When any page of a sector is journalled, all pages
52871 ** cache size requested by the "PRAGMA cache_size" statement.
52876 ** suggested cache size is set to N. */
52883 ** page size. */
52913 ** Return the size in bytes of a PCache object.
52952 ** Change the page size for PCache object. The caller must ensure that there
52989 ** and without exceeding the cache size limit.
53033 ** size limit has been reached, then this routine can be invoked to
53448 ** Get the suggested cache-size value.
53456 ** Set the suggested cache-size value.
53467 ** argument is zero. Return the effective cache-spill size, which will
53493 ** Return the size of the header added by this middleware layer
53500 ** of the configured cache size.
53570 ** The size of the extension (MemPage+PgHdr+PgHdr1) can be determined at
53571 ** runtime using sqlite3_config(SQLITE_CONFIG_PCACHE_HDRSZ, &size). The
53573 ** size can vary according to architecture, compile-time options, and
53600 ** that is allocated when the page cache is created. The size of the local
53710 /* Cache configuration parameters. Page size (szPage) and the purgeable
53720 int szAlloc; /* Total size of one pcache line */
53760 int nInitPage; /* Initial bulk allocation size */
53839 /* Do not bother with a bulk allocation if the cache size very small */
53947 ** Return the size of a pcache allocation
54526 ** size, return the recycled buffer. Otherwise, free the buffer and
54748 ** Return the size of the header on each page of this PCACHE implementation.
54799 int *pnMax, /* OUT: Global maximum cache size */
54856 ** upper bound on the size of allocated memory. No memory is freed
54885 ** Target size for allocation chunks.
55407 /* Set the limiting size of a WAL file. */
55424 /* If the WAL is not empty, return the size of the database. */
55487 ** stored in each frame (i.e. the db page-size when the WAL was created).
55544 ** (3) Writes to the database file are an integer multiple of the page size
55548 ** an integer multiple of the page size in length or are taken from the
55569 ** is called to restore the database file to the same size it was at
55656 ** state - the file may or may not be locked and the database size is
55668 ** open. The database size is known in this state.
55766 ** db size etc.) are consistent with the contents of the file-system.
55905 ** The maximum allowed sector size. 64KiB. If the xSectorsize() method
56028 ** This flag is set by sqlite3PagerWrite() when the file-system sector-size
56029 ** is larger than the database page-size in order to prevent a journal sync
56047 ** dbSize is set based on the size of the database file, which may be
56048 ** larger than the size of the database (the value stored at offset
56049 ** 28 of the database header by the btree). If the size of the file
56050 ** is not an integer multiple of the page-size, the value stored in
56051 ** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2).
56052 ** Except, any file that is greater than 0 bytes in size is considered
56053 ** to have at least one page. (i.e. a 1KB file with 2K page-size leads
56067 ** Throughout a write-transaction, dbFileSize contains the size of
56092 ** size-hint passed to the method call. See pager_write_pagelist() for
56168 sqlite3_int64 szMmap; /* Desired maximum mmap size */
56177 u32 sectorSize; /* Assumed sector size during rollback */
56178 Pgno mxPgno; /* Maximum allowed size of the database */
56194 void (*xCodecSizeChng)(void*,int,int); /* Notify of page size changes */
56260 ** The size of the of each page record in the journal is given by
56266 ** The journal header size for this pager. This is usually the same
56267 ** size as a single disk sector. See also setSectorSize().
56693 ** to the page size.
56695 ** If it can be used, then the value returned is the size of the journal
56812 i64 szJ; /* Total size in bytes of journal file pJrnl */
56853 ** size of pPager->sectorSize bytes.
56855 ** i.e for a sector size of 512:
56884 ** set to 0, then truncate the journal file to zero bytes in size. Otherwise,
56890 ** following the truncation or zeroing described above the size of the
56917 ** is still held on the file. If there is a size limit configured for
56943 ** - 4 bytes: Sector size used by the process that wrote this journal.
56944 ** - 4 bytes: Database page size.
57006 /* The initial database size */
57008 /* The assumed sector size for this process */
57011 /* The page size */
57034 ** The loop is required here in case the sector-size is larger than the
57035 ** database page size. Since the zHeader buffer is only Pager.pageSize
57036 ** bytes in size, more than one call to sqlite3OsWrite() may be required
57057 ** page records following this header and *pDbSize is set to the size of the
57071 u32 *pDbSize /* OUT: Value of original database size field */
57105 ** field, the checksum-initializer and the database size at the start
57116 u32 iPageSize; /* Page-size field of journal header */
57117 u32 iSectorSize; /* Sector-size field of journal header */
57119 /* Read the page-size and sector-size journal header fields. */
57126 /* Versions of SQLite prior to 3.5.8 set the page-size field of the
57128 ** variable is already set to the correct page size.
57134 /* Check that the values read from the page-size and sector-size fields
57143 /* If the either the page-size or sector-size in the journal-header is
57151 /* Update the page-size to match the value read from the journal.
57158 /* Update the assumed sector-size to match the value used by
57246 ** file to the required size.
57457 ** cache size.
57491 ** Journal file is truncated to zero bytes in size.
57559 /* Make sure the new file size is written into the inode right away.
57628 ** required size. */
57711 ** Report the current page size and number of reserved bytes back
58045 ** size.
58146 ** This function is used to change the actual size of the database
58151 ** DBMOD or OPEN state, this function is a no-op. Otherwise, the size
58158 ** you try to truncate a file to some size that is larger than it
58199 ** Return a sanitized version of the sector-size of OS file pFile. The
58216 ** of the open database file. The sector size will be used
58217 ** to determine the size and alignment of journal header and
58220 ** For temporary files the effective sector size is always 512 bytes.
58222 ** Otherwise, for non-temporary files, the effective sector size is
58228 ** the effective sector size to its minimum value (512). The purpose of
58233 ** size. For backwards compatibility of the rollback journal file format,
58234 ** we cannot reduce the effective sector size below 512.
58243 /* Sector size doesn't matter for temporary files. Also, the file
58261 ** number of page records from the journal size.
58266 ** (5) 4 byte big-endian integer which is the sector size. The header
58267 ** is this many bytes in size.
58268 ** (6) 4 byte big-endian integer which is the page size.
58269 ** (7) zero padding out to the next sector size.
58280 ** value of nRec from the size of the journal file. But if a power
58282 ** case that the size of the journal file had already been increased but
58284 ** the value of nRec computed from the file size would be too large. For
58288 ** from the file size. This value is used when the user selects the
58386 ** size of the file.
58394 ** should be computed based on the journal file size.
58402 ** database file back to its original size.
58509 ** back a journal created by a process with a different sector size
58560 ** zero or the size of the database in page. Bytes 32..35 and 35..39
58692 Pgno nTruncate, /* Database size after this commit */
58782 ** to PAGER_READER state to determine the size of the database file
58783 ** in pages (assuming the page size currently stored in Pager.pageSize).
58785 ** If no error occurs, SQLITE_OK is returned and the size of the database
58792 /* Query the WAL sub-system for the database size. The WalDbsize()
58794 ** if the database size is not available. The database size is not
58805 ** WAL sub-system, determine the page count based on the size of
58806 ** the database file. If the size of the database file is not an
58807 ** integer multiple of the page-size, round up the result.
58917 i64 szJ; /* Effective size of the main journal */
58933 /* Set the database size back to the value it was before the savepoint
58943 /* Use pPager->journalOff as the effective size of the main rollback
58954 ** greater than the current database size (pPager->dbSize) but those
59057 ** Change the maximum size of any memory mapping made of the database file.
59237 ** Change the page size used by the Pager object. The new page size
59246 ** * the new page size (value of *pPageSize) is valid (a power
59254 ** then the pager object page size is set to *pPageSize.
59256 ** If the page size is changed, then this function uses sqlite3PagerMalloc()
59258 ** fails, SQLITE_NOMEM is returned and the page size remains unchanged.
59261 ** If the page size is not changed, either because one of the enumerated
59264 ** then *pPageSize is set to the old, retained page size before returning.
59342 ** maximum page count below the current size of the database.
59387 ** opened on a file less than N bytes in size, the output buffer is
59421 ** However, if the file is between 1 and <page-size> bytes in size, then
59468 ** a) The page number is less than or equal to the size of the
59536 ** size of the journal file so that the pager_playback() routine knows
59949 ** file size will be.
60268 u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */
60468 ** choose a default page size in case we have to create the
60469 ** database file. The default page size is the maximum of:
60473 ** + The largest page size that can be written atomically.
60510 ** In this case we accept the default page size and delay actually
60634 ** * The database file itself is greater than 0 bytes in size, and
60637 ** If the current size of the database file is 0 but a journal file
60692 /* If the database is zero pages in size, that means that either (1) the
60945 ** to its original size while this process was not holding a lock.
60947 ** to be the right size but is not actually valid. Avoid this
61629 /* Update the database size and return. */
61637 ** This is a variant of sqlite3PagerWrite() that runs when the sector size
61638 ** is larger than the page size. SQLite makes the (reasonable) assumption that
61643 ** Usually, the sector size is less than or equal to the page size, in which
61645 ** exceptional case where the page size is smaller than the sector size.
61665 /* This trick assumes that both the page-size and sector-size are
62047 ** blocks of size page-size, and
63006 ** Get/set the size-limit used for persistent journal files.
63008 ** Setting the size limit to -1 means no limit is enforced.
63057 /* This only happens when a database file is zero bytes in size opened and
63348 ** frames, return the size in bytes of the page images stored within the
63395 ** The WAL header is 32 bytes in size and consists of the following eight
63400 ** 8: Database page size. Example: 1024
63408 ** frame consists of a 24-byte frame-header followed by a <page-size> bytes
63413 ** 4: For commit records, the size of the database image in pages
63524 ** first index block are the same size as all other index blocks in the
63543 ** allocated size of the page-mapping array - the page-mapping array merely
63676 ** the total header size is 136 bytes.
63688 u16 szPage; /* Database page size in bytes. 1==64K */
63856 ** assuming a database page size of szPage bytes. The offset returned
63872 i64 mxWalSize; /* Truncate WAL to this size upon reset */
63876 u32 szPage; /* Database page size */
63979 ** If the wal-index is currently smaller the iPage pages then the size
64176 ** 4: For commit records, the size of the database image in pages
64186 u32 nTruncate, /* New db size (or 0 for non-commit frames) */
64217 u32 *pnTruncate, /* OUT: New db size (or 0 if not commit) */
64256 ** and the new database size.
64620 int szPage; /* Page size according to the log */
64633 /* If the database page size is not a power of two, or is greater than
64839 i64 mxWalSize, /* Truncate WAL to this size on reset */
64935 ** Change the size to which the WAL file is trucated on each reset.
65326 ** Return the page-size in bytes used by the database.
65408 int szPage; /* Database page-size */
65469 ** about the eventual size of the db file to the VFS layer.
65473 i64 nSize; /* Current size of database file */
65478 /* If the size of the final database is larger than the current
65480 ** maximum size of the pending-byte page (65536 bytes), then
65583 ** If the WAL file is currently larger than nMax bytes in size, truncate
65596 sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName);
65783 /* page0 can be NULL if the SHM is zero bytes in size and pWal->writeLock
66605 ** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
66626 ** Return the size of the database in pages (or zero, if unknown).
66933 const int szPage = pWal->szPage;/* Database page size */
66983 int szPage, /* Database page-size in bytes */
66985 Pgno nTruncate, /* Database size after this commit */
66994 int szFrame; /* The size of a single frame */
67163 ** journal size limit, if possible.
67529 ** read-lock. This function returns the database page-size if it is known,
67609 ** information such as the size of key and data.
67615 ** "no such page". The page size can be any power of 2 between 512 and 65536.
67625 ** 16 2 Page size in bytes. (1 means 65536)
67659 ** is to limit the maximum cell size so that at least 4 cells will fit
67665 ** the cell size drop below the min embedded payload fraction.
67705 ** which is stored in the key size entry of the cell header rather than in
67719 ** freeblocks. Each freeblock is at least 4 bytes in size. The byte offset
67721 ** increasing order. Because a freeblock must be at least 4 bytes in size,
67785 /* The following value is the maximum cell size assuming a maximum page
67786 ** size give above.
67791 ** assumes a minimum cell size of 6 bytes (4 bytes for the cell itself
68032 #define BTS_PAGESIZE_FIXED 0x0002 /* Page size can no longer be changed */
68057 ** maximum database size of 2^31 pages a minimum fanout of 2 for a
68634 ** from the header of a btree page. If the page size is 65536 and the page
69281 ** set to point to a malloced buffer pCur->nKey bytes in size containing
69297 ** up to the size of 1 varint plus 1 8-byte value when the cursor
70117 int size; /* Size of a cell */
70205 size = pPage->xCellSize(pPage, &src[pc]);
70206 cbrk -= size;
70207 if( cbrk<iCellStart || pc+size>usableSize ){
70210 assert( cbrk+size<=usableSize && cbrk>=iCellStart );
70211 testcase( cbrk+size==usableSize );
70212 testcase( pc+size==usableSize );
70214 memcpy(&data[cbrk], &src[pc], size);
70235 ** size. If one can be found, return a pointer to the space and remove it
70253 int x; /* Excess size of the slot */
70255 int size; /* Size of the free slot */
70260 ** freeblock form a big-endian integer which is the size of the freeblock
70263 size = get2byte(pTmp);
70264 if( (x = size - nByte)>=0 ){
70282 /* The slot remains on the free-list. Reduce its size to account
70330 assert( nByte>=0 ); /* Minimum cell size is 4 */
70338 /* EVIDENCE-OF: R-29356-02391 If the database uses a 65536-byte page size
70407 ** and the size of the block is iSize bytes.
70420 u8 hdr; /* Page header size. 0 or 100 */
70433 assert( iSize>=4 ); /* Minimum cell size is 4 */
70638 u32 next, size;
70651 size = get2byte(&data[pc+2]);
70652 nFree = nFree + size;
70653 if( next<=pc+size+3 ) break;
70660 if( pc+size>(unsigned int)usableSize ){
70668 ** the cell-content area. If this is greater than the usable-size
70761 ** offset to the cell content area will equal the page size minus the
70872 ** Return the size of the database file in pages. If there is any kind of
71203 ** the right size. This is to guard against size changes that result
71239 /* EVIDENCE-OF: R-51873-39618 The page size for a database file is
71260 /* EVIDENCE-OF: R-37497-42412 The size of the reserved region is
71341 /* If the B-Tree was successfully opened, set the pager-cache size to the
71343 ** do not change the pager-cache size.
71423 ** a cell is less than 4 bytes in size, it is rounded up to 4 bytes
71517 ** pages in the cache exceeds this soft limit. But the size of the
71536 ** The value returned is the current spill size. If zero is passed
71537 ** as an argument, no changes are made to the spill size setting, so
71538 ** using mxPage of 0 is a way to query the current spill size.
71588 ** Change the default pages size and the number of reserved bytes per page.
71589 ** Or, if the page size has already been fixed, return SQLITE_READONLY
71592 ** The page size must be a power of 2 between 512 and 65536. If the page
71593 ** size supplied does not meet this constraint then the page size is not
71604 ** If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
71637 ** Return the currently defined page size
71666 ** The value returned is the larger of the current reserve size and
71667 ** the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
71898 /* EVIDENCE-OF: R-51873-39618 The page size for a database file is
71902 /* EVIDENCE-OF: R-25008-21688 The size of a page is a power of two
71912 /* EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte
71916 ** EVIDENCE-OF: R-37497-42412 The size of the reserved region is
71921 /* After reading the first page of the database assuming a page size
71922 ** of BtShared.pageSize, we have discovered that the page-size is
71925 ** again with the correct page-size.
71943 /* EVIDENCE-OF: R-28312-64704 However, the usable size is not allowed to
71944 ** be less than 480. In other words, if the page size is 512, then the
71945 ** reserved space size cannot exceed 32. */
72208 ** reading page 1 it discovers that the page-size of the database
72210 ** pBt->pageSize to the page-size of the file on disk.
72266 /* If the db-size header field is incorrect (as it may be if an old
72268 ** this sooner rather than later means the database size can safely
72269 ** re-read the database size from page 1 if a savepoint or transaction
72608 ** nOrig pages in size containing nFree free pages. Return the expected
72609 ** size of the database in pages following an auto-vacuum operation.
72694 Pgno nOrig; /* Database size before freeing */
73256 ** Return the size of a BtCursor object in bytes.
73411 ** of data. For index btrees, this will be the size of the key.
73425 ** Return an upper bound on the size of any record for the table
73434 ** The current implementation merely returns the size of the underlying
74374 /* This branch runs if the record-size field of the cell is a
74382 /* The record-size field is a 2 byte varint and the record
74533 /* The maximum supported page-size is 65536 bytes. This means that
74543 /* This branch runs if the record-size field of the cell is a
74551 /* The record-size field is a 2 byte varint and the record
74570 testcase( nCell<0 ); /* True if key size is 2^32 or more */
74571 testcase( nCell==0 ); /* Invalid key size: 0x80 0x80 0x00 */
74572 testcase( nCell==1 ); /* Invalid key size: 0x80 0x80 0x01 */
74573 testcase( nCell==2 ); /* Minimum legal index key size */
74892 Pgno mxPage; /* Total size of the database file */
75412 /* Call xParseCell to compute the size of a cell. If the cell contains
75443 int *pnSize /* Write cell size here */
75513 ** nPayload Total payload size in bytes
75811 ** cell and the size of each cell. Some of the apCell[] pointers might refer
75815 ** A szCell[] of zero means the size of that cell has not yet been computed.
75867 u16 *szCell; /* Local size of all cells in apCell[] */
75892 ** Return the size of the Nth element of the cell array
75908 ** szCell[] array contains the size in bytes of each cell. This function
75999 ** content area on page pPg. If the size of the content area is extended,
76260 ** least 13 bytes in size.
76329 ** record-length (a variable length integer at most 32-bits in size)
76492 ** size of a cell stored within an internal node is always less than 1/4
76493 ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large
76502 u8 *aOvflSpace, /* page-size bytes of space for parent ovfl */
76507 int nMaxCells = 0; /* Allocated size of apCell, szCell, aFrom. */
76526 int szNew[NB+2]; /* Combined size of cells placed on i-th page */
76779 ** size of all cells on the i-th page and cntNew[] which is the index
77105 ** previously stored on a leaf node, and its reported size was 4
77107 ** (see btreeParseCellPtr(), 4 bytes is the minimum size of
77108 ** any cell). But it is important to pass the correct size to
77724 /* New entry is the same size as the old. Do an overwrite */
77842 /* Overwrite the old cell with the new if they are the same size.
77936 ** for the destination database. The size of the cell, in bytes, is left
78955 isFreeList ? "size" : "overflow list length",
79050 u32 usableSize; /* Usable size of the page */
79130 /* Check cell size */
79205 u32 size;
79207 size = pPage->xCellSize(pPage, &data[pc]);
79208 btreeHeapInsert(heap, (pc<<16)|(pc+size-1));
79219 int size, j;
79221 size = get2byte(&data[i+2]);
79222 assert( (u32)(i+size)<=usableSize ); /* due to btreeComputeFreeSpace() */
79223 btreeHeapInsert(heap, (((u32)i)<<16)|(i+size-1));
79231 assert( j==0 || j>i+size ); /* Enforced by btreeComputeFreeSpace() */
79711 ** Return the size of the header added to each page by this module.
79855 ** Attempt to set the page size of the destination to match the page size
80006 /* Backup is not possible if the page size of the destination is changing
80094 int pgszSrc = 0; /* Source page size */
80095 int pgszDest = 0; /* Destination page size */
80134 ** try to set its page size to the same as the source database. This
80136 ** not possible to create a database file that uses one page size by
80211 ** size may be different to the source page size.
80213 ** If the source page size is smaller than the destination page size,
80215 ** fix the size of the file. However it is important to call
80235 /* If the source page-size is smaller than the destination page-size,
80488 ** The size of file pTo may be reduced by this operation. If anything
80624 /* The szMalloc field holds the correct memory allocation size */
80838 ** If pMem->zMalloc already meets or exceeds the requested size, this
80867 ** terminate a UTF16 string, even if the initial size of the buffer
81550 ** too large - whose size exceeds SQLITE_MAX_LENGTH.
81673 ** size limit) then no memory allocation occurs. If the string can be
81693 int iLimit; /* Maximum allowed string or blob size */
82690 ** than its current size. nOp is guaranteed to be less than or equal
82706 ** by the minimum* amount required until the size reaches 512. Normal
82708 ** size of the op array or add 1KB of space, whichever is smaller. */
82718 /* Ensure that the size of a VDBE does not grow too large */
84690 ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms
86765 const KeyInfo *pKeyInfo /* Compare size with this KeyInfo */
87284 ** size-of-header varint at the start of (pKey1/nKey1) fits in a single
87288 ** on schemas where the maximum valid header size is 63 bytes or less.
87382 ** uses the collation sequence BINARY and (c) that the size-of-header varint
87457 ** that the size-of-header varint that occurs at the start of each record
87460 ** maximum possible legal header size plus 8 bytes. Because there is
87463 ** limit the size of the header to 64 bytes in cases where the first field
87468 ** header size is (12*5 + 1 + 1) bytes. */
87517 /* Get the size of the index entry. Only indices entries of less
87533 /* The index entry must begin with a header size */
89770 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
90344 ** The next global variable records the size of the largest MEM_Blob
90381 ** Test a register to see if it exceeds the current maximum blob size.
90382 ** If it does, record the new maximum blob size.
92004 i64 nByte; /* Total size of the output string or blob */
93240 assert( pC->szRow<=65536 ); /* Maximum page size is 64KiB */
93333 ** (1) the bytes of the header extend past the declared header size
93656 ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 |
93664 ** hdr-size field is also a varint which is the offset from the beginning
93837 ** value is the size of the header in bytes including the size varint
93891 /* EVIDENCE-OF: R-06529-47362 Following the size varint are one or more
94364 ** P3==3 is the recommended pager cache size, and so forth. P1==0 is
94396 ** size, and so forth. P1==0 is the main database file and P1==1 is the
99722 ** Query a blob handle for the size of the data.
99978 ** actually N elements in size, where N is the smallest power of 2 greater
99982 ** The aTree[] array is also N elements in size. The value of N is stored in
100033 int nTree; /* Used size of aTree/aReadr (power of 2) */
100090 ** this variable is updated so as to be set to the size on disk of the
100094 int mnPmaSize; /* Minimum PMA size, in bytes */
100095 int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */
100097 int pgsz; /* Main database page size */
100151 ** size. When the IncrMerger is initialized, it reads enough data from
100186 ** size. But I/O is more efficient if it occurs in page-sized blocks where
100188 ** the PMA so that aligned, page-size blocks are written.
100505 i64 *pnByte /* IN/OUT: Increment this value by PMA size */
100548 ** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2,
100549 ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences
100709 int pgsz; /* Page size of main database */
100770 i64 mxCache; /* Cache size in bytes*/
100776 /* A negative cache-size value C indicates that the cache is abs(C)
100777 ** KiB in size. */
101055 ** is guaranteed to be nByte bytes or smaller in size. This function
101056 ** attempts to extend the file to nByte bytes in size and to ensure that
101083 i64 nExtend, /* Attempt to extend file to this size */
101232 int nBuf, /* Buffer size */
101330 /* Set iSz to the expected size of file pTask->file after writing the PMA.
101579 ** than (page-size * cache-size), or
101582 ** than (page-size * 10) and sqlite3HeapNearlyFull() returns true.
103008 ** The zChunk array is always at least 8 bytes in size - usually much more.
103009 ** Its actual size is stored in the MemJournal.nChunkSize variable.
103022 ** For chunk size nChunkSize, return the number of bytes that should
103042 int nChunkSize; /* In-memory chunk-size */
103154 static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size);
103232 static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
103235 if( size<p->endpoint.iOffset ){
103237 if( size==0 ){
103242 for(pIter=p->pFirst; ALWAYS(pIter) && iOff<size; pIter=pIter->pNext){
103252 p->endpoint.iOffset = size;
103280 ** Query the size of the file in bytes.
103322 ** flushed to disk either when it grows larger than nSpill bytes in size,
104619 ** lookupName() for a size reduction and performance increase.
105627 ** size of an AS clause in the result-set of a SELECT. The Z expression
107137 ** (2) the EP_xxx flags that indicate what the structure size should be.
107144 ** The size of the structure can be found by masking the return value
107148 ** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
107250 /* Set nNewSize to the size allocated for the structure pointed to
107690 ** the size of the RHS and LHS match. But if the RHS is a SELECT,
107692 ** we can do the size check, so defer the size check until code generation.
107722 /* Remember the size of the LHS in iTable so that we can check that
109185 ** a sub-query, that the LHS is a vector of size 1.
115087 ** only the pointer (the 2nd parameter) matters. The size of the object
118065 ** db->aDb[] structure to a smaller size, if possible.
119050 ** 'BLOB' with a default size of 4 bytes. */
119164 /* If pCol is not NULL, store an estimate of the field size. The
119165 ** estimate is scaled so that the size of an integer is 1. */
119167 int v = 0; /* default size is approx 4 bytes */
119688 ** Estimate the average size of a row for an index.
120234 /* Estimate the average row size for the table and for all implied indices */
121308 ** Increase the allocation size to provide an extra nExtra bytes
122097 ** array is szEntry bytes in size. This routine uses sqlite3DbRealloc()
122100 ** When this function is called, *pnEntry contains the current size of
122106 ** reflect the new size of the array and a pointer to the new allocation
122194 ** Maximum size of a SrcList object.
125344 ** character is exactly one byte in size. Also, provde the Utf8Read()
125943 ** The zeroblob(N) function returns a zero-filled blob of size N bytes.
125980 i64 nOut; /* Maximum size of zOut */
126032 /* Grow the size of the output buffer only on substitutions
127279 ** Otherwise, it is set to point to an allocated array of size N, where
128244 ** to an array of size N, where N is the number of columns in table pTab.
134751 ** page cache size. The value returned is the maximum number of
134753 ** page cache size value and the persistent page cache size value
134756 ** Older versions of SQLite would set the default cache size to a
134759 ** size. But continue to take the absolute value of the default cache
134760 ** size of historical compatibility.
134786 int size = sqlite3AbsInt32(sqlite3Atoi(zRight));
134788 sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, size);
134790 pDb->pSchema->cache_size = size;
134803 ** database page size in bytes. The second form sets the
134804 ** database page size value. The value can only be set if
134811 int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0;
134812 returnSingleInt(v, size);
134814 /* Malloc may fail when setting the page-size, as there is an internal
134987 ** Get or set the size limit on rollback journal files.
135085 ** page cache size. The second form sets the local
135086 ** page cache size value. If N is positive then that is the
135096 int size = sqlite3Atoi(zRight);
135097 pDb->pSchema->cache_size = size;
135109 ** page cache spill size. The second form turns cache spill on
135110 ** or off. When turnning cache spill on, the size is set to the
135111 ** current cache_size. The third form sets a spill size that
135112 ** may be different form the cache size.
135132 int size = 1;
135133 if( sqlite3GetInt32(zRight, &size) ){
135134 sqlite3BtreeSetSpillSize(pDb->pBt, size);
135136 if( sqlite3GetBoolean(zRight, size!=0) ){
135149 ** Used to set mapping size limit. The mapping size limit is
135150 ** used to limit the aggregate size of all memory mapped regions of the
136582 int iTabCur; /* Cursor for a table whose size needs checking */
137345 int size;
137467 size = sqlite3AbsInt32(meta[BTREE_DEFAULT_CACHE_SIZE-1]);
137468 if( size==0 ){ size = SQLITE_DEFAULT_CACHE_SIZE; }
137469 pDb->pSchema->cache_size = size;
140557 /* pCol->szEst = ... // Column size est for SELECT tables never used */
141406 ** size result sets.
142203 ** existing cursor numbers in pSrc. aCsrMap[0] is the array size.
149597 ** equal to the size of the original database. The copy operation of
149599 ** to the size of the original database for the rollback journal.
149600 ** Hence, temporary disk space that is approximately 2x the size of the
149770 ** to ensure that we do not try to change the page-size on a WAL database.
149777 /* Do not attempt to change the page size for a WAL database */
149864 BTREE_DEFAULT_CACHE_SIZE, 0, /* Preserve the default page cache size */
149926 /* This both clears the schemas and reduces the size of the db->aDb[]
151300 ** size of where.c and make it easier to edit. This file contains the routines
154746 ** This routine will increase the size of the pWC->a[] array as necessary.
154877 Expr *pRight, *pLeft; /* Right and left size of LIKE operator */
157636 ** estimated size of the table is larger. We could actually
157637 ** measure the size of the table at run-time using OP_Count with
157639 ** testing complicated. By basing the blob size on the value in the
158046 ** appears that it should be 1 field in size. However, that would make it
159357 LogEst rLogSize; /* Logarithm of table size */
159903 ** estimated average size of the index and table records.
161520 /* Increase the size of the aTo set by one */
161969 ** (4) The size of the table being searched is known by ANALYZE.
164306 Expr *pStart, /* Start window size if TK_PRECEDING or FOLLOWING */
164308 Expr *pEnd, /* End window size if TK_FOLLOWING or PRECEDING */
165165 ** regOld and regNew are each the first register in an array of size
166278 ** has access to the the size of the yyParser object and so the parser
168464 ** Try to increase the size of the parser stack. Return the number
171837 ** But by using this automatically generated code, the size of the code
173623 ** size at compile-time using -DSQLITE_PTRSIZE=n compile-time option */
173924 ** the size of each page cache line (sz), and the number of cache lines
173980 ** number of bytes in the memory buffer, and the minimum allocation size.
173989 /* cap min request size at 2^12 */
174073 ** integer (sqlite3_int64) values that are the default mmap size limit
174075 ** mmap size limit. */
174081 ** EVIDENCE-OF: R-34993-45031 The maximum allowed mmap size will be
174083 ** compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE
174099 ** unsigned integer value that specifies the maximum size of the created
174158 int nBig; /* Number of full-size slots */
174171 /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger
177505 ** sqlite3_test_control(BITVEC_TEST, size, program)
177507 ** Run a test against a Bitvec object of size. The program argument
179534 int nNodeSize; /* Soft limit for node size */
179540 int nPgsz; /* Page size for host database */
179621 int nRowAvg; /* Average size of database rows, in pages */
179715 ** points to a malloced buffer, size nDoclist bytes, containing the results
179721 ** matchinfo data. If it is not NULL, it points to an array of size nCol*3,
179836 i64 nBuffer; /* Allocated size of aBuffer[] in bytes */
180376 "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);",
180388 ** Store the current database page-size in bytes in p->nPgsz.
180671 int *pnIndex, /* OUT: size of *apIndex[] array */
181158 /* Figure out the page-size for the database. This is required in order to
181543 int nBuffer = 0; /* Total term size */
181570 ** the size of zBuffer if required. */
181634 ** The buffer pointed to by argument zNode (size nNode bytes) contains an
181635 ** interior node of a b-tree segment. The zTerm buffer (size nTerm bytes)
182396 ** Argument pList points to a position list nList bytes in size. This
182523 ** required (since the size of [doclistA AND doclistB] is always less
182524 ** than or equal to the size of [doclistA] in that case). But this is
182854 ** in buffer aList[], size nList bytes.
183319 ** If the value passed as the third argument is a blob of size
184566 ** Determine the average document (row) size in pages. If successful,
184570 ** The average document size in pages is calculated by first calculating
184571 ** determining the average size in bytes, B. If B is less than the amount
184574 ** the number of overflow pages consumed by a record B bytes in size.
184579 /* The average document size, which is required to calculate the cost
187947 int h; /* the hash of the key modulo hash table size */
188049 int nInput; /* size of the input */
188322 ** size of the output word (exclusive of the '\0' terminator) into *pnOut.
189232 int nBytes; /* size of the input */
189920 ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer
190048 int nTermAlloc; /* Allocated size of zTerm buffer */
190209 /* 21 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?",
190367 sqlite3_int64 iDocid, /* Docid to read size data for */
190432 ** document terms, and each configured prefix size (configured the FTS
190764 ** we ordered the doclists by size and flushed the largest until the
191067 ** to the size of the blob in bytes before returning.
191414 ** size of the previous offset-list.
191887 ** Return the size of the common prefix (if any) shared by zPrev and
191925 int nData = pTree->nData; /* Current size of node in bytes */
192172 nReq = sqlite3Fts3VarintLen(nPrefix) + /* varint containing prefix size */
192173 sqlite3Fts3VarintLen(nSuffix) + /* varint containing suffix size */
192208 nReq = 1 + /* varint containing prefix size */
192209 sqlite3Fts3VarintLen(nTerm) + /* varint containing suffix size */
192496 ** When this function is called, buffer *ppList (size *pnList bytes) contains
193001 ** A segment of size nByte bytes has just been written to absolute level
193022 ** such segments are smaller than nLimit bytes in size, they will be
193031 ** contain a size value. This happens if it was written by an
193033 ** the size of the segment, and so segment promotion does not
193261 int nBuf /* size of the BLOB */
193285 char *pBlob; /* The BLOB encoding of the document size */
193320 ** Varint 1+nCol: The total size, in bytes, of all text values in all
193581 int nAlloc; /* Allocated size of a[] (nAlloc>=n) */
193606 u8 bNoLeafData; /* If true, store 0 for segment size */
193633 ** bytes in size, extend (realloc) it to be so.
193637 ** to reflect the new size of the pBlob->a[] buffer.
193773 ** bytes in size, write the key here. */
193834 ** If the size of the value in blob pPrev is zero, then this is the first
194066 ** Compare the term in buffer zLhs (size in bytes nLhs) with that in
194067 ** zRhs (size in bytes nRhs) using memcmp. If one term is a prefix of
194426 int nAlloc = 0; /* Allocated size of aIdx[] */
194487 ** The first two arguments are a pointer to and the size of a segment b-tree
195771 SnippetPhrase *aPhrase; /* Array of size nPhrase */
195807 ** (nElem * sizeof(u32)) bytes in size. See the MatchinfoBuffer code below
195828 int nAlloc; /* Allocated size of buffer z in bytes */
197158 ** size that contains at least one instance of all phrases in the query
197895 ** the size of the range (always at least 1). In other words, the value
198949 u32 n, /* Content size or sub-node count */
198976 u32 n, /* Content size or sub-node count */
200985 ** table must be the same size as the root node. The content of each node
201206 ** The smallest possible node-size is (512-64)==448 bytes. And the largest
201207 ** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates).
203048 ** of the objects size in each dimension.
203262 ** Arguments aIdx, aDistance and aSpare all point to arrays of size
203334 ** Arguments aIdx, aCell and aSpare all point to arrays of size
204603 ** determine the node-size used by the rtree table being created or connected
204608 ** table already exists. In this case the node-size is determined by inspecting
204611 ** Otherwise, for an xCreate(), use 64 bytes less than the database page-size.
204613 ** database page-size is so large that more than RTREE_MAXCELLS entries
204614 ** would fit in a single node, use a smaller node-size.
204773 /* Figure out the node size to use. */
204975 ** is set to the size of the buffer in bytes.
205458 ** warnings coming from some compiler (notably, clang). In reality, the size
205460 ** GeoPoly.a[] array at the end is the appropriate size.
205469 /* The size of a memory allocation needed for a GeoPoly object sufficient
206631 /* Figure out the node size to use. */
208971 ** Valid if STAGE==1. The size in bytes of the *-oal file.
209062 ** it points to an array of flags nTblCol elements in size. The flag is
209214 int nFrameAlloc; /* Allocated size of aFrame[] array */
209219 i64 szTemp; /* Current size of all temp files in use */
209220 i64 szTempLimit; /* Total size limit for temp files */
209249 ** "sz" is set to the current size of the database file.
209362 ** routine will determine this size for you.
209369 ** This function returns the size of the output file in bytes (excluding
209392 /* ERROR: size integer not terminated by "\n" */
209410 /* ERROR: copy exceeds output file size */
209429 /* ERROR: insert count exceeds size of delta */
209448 /* ERROR: generated size does not match predicted size */
209464 int size;
209465 size = rbuDeltaGetInt(&zDelta, &lenDelta);
209467 /* ERROR: size integer not terminated by "\n" */
209470 return size;
209506 /* Figure out the size of the output */
212554 ** However, if the sector-size is larger than the page-size, and the
213484 rbuPutU32(&aBuf[28], 1); /* size of db file in pages */
213553 static int rbuVfsTruncate(sqlite3_file *pFile, sqlite_int64 size){
213556 int rc = rbuUpdateTempSize(p, size);
213559 return p->pReal->pMethods->xTruncate(p->pReal, size);
213577 ** Return the current file-size of an rbuVfs-file.
213692 ** Return the sector-size in bytes for an rbuVfs-file.
214008 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
214165 ** Configure the aggregate temp file size limit for this RBU handle.
214261 " mx_payload INTEGER," /* 7 Largest payload size of all cells */
214555 int nTotal /* Total record (payload) size */
214699 /* If connected to a ZIPVFS backend, find the page size and
214708 /* Not ZIPVFS: The default page size and offset */
215117 ** value must be a BLOB which is the correct page size, otherwise the
215533 ** Minimum chunk size used by streaming versions of functions.
215813 int nMaxSize; /* Max size of eventual changeset record */
215955 ** Allocate and return a pointer to a buffer nByte bytes in size. If
217524 ** of sqlite3_realloc64(). Allocations greater than this size in bytes
218094 int nRewind = buf.nBuf; /* Initial size of write buffer */
218318 ** Return the maximum size of sqlite3session_changeset() output.
218640 ** If successful, SQLITE_OK is returned and *pnByte is set to the size of
218740 int *pnRec, /* If non-NULL, store size of record here */
218889 int *pnRec, /* If non-NULL, store size of record here */
219655 ** to an array nCol elements in size. In this case only those values for
220777 ** this case (*pnOut) is set to the size of the output buffer in bytes. It
220850 ** Add the changeset currently stored in buffer pData, size nData bytes,
220984 ** fields in size. This function appends an nCol sessions module
221097 ** before this function returns. In this case (*pnOut) is set to the size of
221446 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
221726 ** size of the token in bytes. The 4th and 5th arguments are the byte offsets
222132 int pgsz; /* Approximate page size used in %_data */
222336 ** size. Return the number of bytes in the nChar character prefix of the
222558 int *pnDoclist /* OUT: size of doclist in bytes */
223264 ** Try to increase the size of the parser stack. Return the number
224537 int nFirstAlloc; /* Allocated size of aFirst[] */
224676 int nColSize = 0; /* Total size of iBestCol in tokens */
224950 /* Figure out the total size of the current row in tokens. */
225431 /* Maximum allowed page size */
227075 ** buffer and buffer size to the lookaside-reader init function, zero
229241 ** in size, as phrase matches are not supported without detail=full.
229507 int nAlloc; /* Total size of allocation */
229508 int iSzPoslist; /* Offset of space for 4-byte poslist size */
229760 ** + 4 byte reserved for the "poslist size" varint.
229782 /* If this is a new rowid, append the 4-byte size field for the previous
229989 int *pnDoclist /* OUT: size of doclist in bytes */
230034 ** * all segment b-tree leaf data is stored in fixed size page records
230113 ** varint : size of first term
230134 ** varint: size of poslist in bytes multiplied by 2, not including
230159 ** footer is 0 bytes in size, then this field is the same as the
230160 ** size of the leaf page in bytes.
230181 ** varint : size of first term
230373 int nDlidx; /* Allocated size of aDlidx[] array */
230399 ** position list data (one byte passed the position-list size field).
230400 ** rowid field of the current entry. Usually this is the size field of the
230428 ** start of the "position-list-size" field within the page.
230454 int nRowidOffset; /* Allocated size of aRowidOffset[] array */
230570 ** Allocate and return a buffer at least nByte bytes in size.
231295 int szPromote = 0; /* Promote anything this size or smaller */
231621 ** position list size field. Read the varint and return the number of bytes
231637 ** position-list size field. Read the value of the field and store it
231799 ** the position-list size field for the first relevant rowid on the page.
232178 ** points to the start of the position-list size field. */
232217 ** pIter->iLeafOffset is already set to point to the position-list size
233171 ** buffer pBuf. It does not make a copy of the position-list size
233208 ** Parameter pPos points to a buffer containing a position list, size nPos.
233660 ** array is 63 elements, or 252 bytes, in size. */
233718 ** Return the size of the prefix, in bytes, that buffer
233755 ** Grow the pWriter->aDlidx[] array to at least nLvl elements in size.
234068 ** Append a rowid and position-list size field to the writers output.
234185 /* Grow the two buffers to pgsz + padding bytes in size. */
234360 int nPos; /* position-list size field value */
234554 ** in a 32-bit integer. Return the size of the largest prefix of this
234555 ** list nMax bytes or less in size.
234899 /* Read position list size */
235093 /* The maximum size of the output is equal to the sum of the
235470 ** size. Return the number of bytes in the nChar character prefix of the
235497 ** pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of
235712 ** Parameter anSize must point to an array of size nCol, where nCol is
235899 ** Check if buffer z[], size n bytes, contains as series of valid utf-8
239237 ** The first varint (if it exists) contains the size of the position list
239238 ** for phrase 0. The second (same disclaimer) contains the size of position
239239 ** list 1. And so on. There is no size field for the final position list,
239240 ** as it can be derived from the total size of the blob.
240646 int *aColSize; /* Array of size pConfig->nCol */
240647 i64 *aTotalSize; /* Array of size pConfig->nCol */
243184 /* A 32-bit varint is used to store size information in btrees.
243186 ** A 3-byte varint is sufficient, for example, to record the size
245299 CODEC_STATIC int sqlite3CodecSetCipherPageSize(CodecContext *ctx, int size){
245300 if(!((size != 0) && ((size & (size - 1)) == 0)) || size < 512 || size > 65536) {
245301 sqlite3_log(SQLITE_ERROR, "codec: cipher_page_size not a power of 2 and between 512 and 65536 inclusive(%d).", size);
245307 ctx->readCtx->codecConst.cipherPageSize = size;
245308 ctx->writeCtx->codecConst.cipherPageSize = size;
245310 ctx->buffer = (unsigned char *)sqlite3Malloc(size);
245312 sqlite3_log(SQLITE_NOMEM, "codec: alloc mem failed when set cipher page size(%d).", size);