Fossil SCM
Update the built-in SQLite to the latest trunk version.
Commit
cdaec3a4312662501ccc8d16396a34b69694fcbfd6073e48c008b8f0615fc737
Parent
f51e8d36cb436f1…
2 files changed
+60
-37
+30
-28
+60
-37
| --- extsrc/sqlite3.c | ||
| +++ extsrc/sqlite3.c | ||
| @@ -16,11 +16,11 @@ | ||
| 16 | 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | 19 | ** |
| 20 | 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | -** 6a5701e6c7be25cba93e55438f950966e1da with changes in files: | |
| 21 | +** 5508b56fd24016c13981ec280ecdd833007c with changes in files: | |
| 22 | 22 | ** |
| 23 | 23 | ** |
| 24 | 24 | */ |
| 25 | 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | ||
| 465 | 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | 467 | */ |
| 468 | 468 | #define SQLITE_VERSION "3.51.0" |
| 469 | 469 | #define SQLITE_VERSION_NUMBER 3051000 |
| 470 | -#define SQLITE_SOURCE_ID "2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85" | |
| 470 | +#define SQLITE_SOURCE_ID "2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8" | |
| 471 | 471 | |
| 472 | 472 | /* |
| 473 | 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | 475 | ** |
| @@ -6355,11 +6355,11 @@ | ||
| 6355 | 6355 | /* |
| 6356 | 6356 | ** CAPI3REF: Copy And Free SQL Values |
| 6357 | 6357 | ** METHOD: sqlite3_value |
| 6358 | 6358 | ** |
| 6359 | 6359 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6360 | -** object D and returns a pointer to that copy. ^The [sqlite3_value] returned | |
| 6360 | +** object V and returns a pointer to that copy. ^The [sqlite3_value] returned | |
| 6361 | 6361 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6362 | 6362 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6363 | 6363 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6364 | 6364 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6365 | 6365 | ** |
| @@ -6393,11 +6393,11 @@ | ||
| 6393 | 6393 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6394 | 6394 | ** when first called if N is less than or equal to zero or if a memory |
| 6395 | 6395 | ** allocation error occurs. |
| 6396 | 6396 | ** |
| 6397 | 6397 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6398 | -** determined by the N parameter on first successful call. Changing the | |
| 6398 | +** determined by the N parameter on the first successful call. Changing the | |
| 6399 | 6399 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6400 | 6400 | ** the same aggregate function instance will not resize the memory |
| 6401 | 6401 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6402 | 6402 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6403 | 6403 | ** pointless memory allocations occur. |
| @@ -6555,11 +6555,11 @@ | ||
| 6555 | 6555 | ** of as a secret key such that only code that knows the secret key is able |
| 6556 | 6556 | ** to access the associated data. |
| 6557 | 6557 | ** |
| 6558 | 6558 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6559 | 6559 | ** languages or in other circumstances where it might be possible for an |
| 6560 | -** an attacker to invoke them. Any agent that can invoke these interfaces | |
| 6560 | +** attacker to invoke them. Any agent that can invoke these interfaces | |
| 6561 | 6561 | ** can probably also take control of the process. |
| 6562 | 6562 | ** |
| 6563 | 6563 | ** Database connection client data is only available for SQLite |
| 6564 | 6564 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6565 | 6565 | ** |
| @@ -6669,11 +6669,11 @@ | ||
| 6669 | 6669 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6670 | 6670 | ** is non-negative, then as many bytes (not characters) of the text |
| 6671 | 6671 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6672 | 6672 | ** function result. If the 3rd parameter is non-negative, then it |
| 6673 | 6673 | ** must be the byte offset into the string where the NUL terminator would |
| 6674 | -** appear if the string where NUL terminated. If any NUL characters occur | |
| 6674 | +** appear if the string were NUL terminated. If any NUL characters occur | |
| 6675 | 6675 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6676 | 6676 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6677 | 6677 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6678 | 6678 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6679 | 6679 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6727,11 +6727,11 @@ | ||
| 6727 | 6727 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6728 | 6728 | ** when SQLite is finished with P. The T parameter should be a static |
| 6729 | 6729 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6730 | 6730 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6731 | 6731 | ** |
| 6732 | -** If these routines are called from within the different thread | |
| 6732 | +** If these routines are called from within a different thread | |
| 6733 | 6733 | ** than the one containing the application-defined function that received |
| 6734 | 6734 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6735 | 6735 | */ |
| 6736 | 6736 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6737 | 6737 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -7133,11 +7133,11 @@ | ||
| 7133 | 7133 | /* |
| 7134 | 7134 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 7135 | 7135 | ** METHOD: sqlite3 |
| 7136 | 7136 | ** |
| 7137 | 7137 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 7138 | -** for the N-th database on database connection D, or a NULL pointer of N is | |
| 7138 | +** for the N-th database on database connection D, or a NULL pointer if N is | |
| 7139 | 7139 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 7140 | 7140 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 7141 | 7141 | ** databases. |
| 7142 | 7142 | ** |
| 7143 | 7143 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -7228,20 +7228,20 @@ | ||
| 7228 | 7228 | ** |
| 7229 | 7229 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 7230 | 7230 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 7231 | 7231 | ** in a read transaction. Content has been read from the database file |
| 7232 | 7232 | ** but nothing in the database file has changed. The transaction state |
| 7233 | -** will advanced to SQLITE_TXN_WRITE if any changes occur and there are | |
| 7233 | +** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are | |
| 7234 | 7234 | ** no other conflicting concurrent write transactions. The transaction |
| 7235 | 7235 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 7236 | 7236 | ** [COMMIT].</dd> |
| 7237 | 7237 | ** |
| 7238 | 7238 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 7239 | 7239 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 7240 | 7240 | ** in a write transaction. Content has been written to the database file |
| 7241 | 7241 | ** but has not yet committed. The transaction state will change to |
| 7242 | -** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> | |
| 7242 | +** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> | |
| 7243 | 7243 | */ |
| 7244 | 7244 | #define SQLITE_TXN_NONE 0 |
| 7245 | 7245 | #define SQLITE_TXN_READ 1 |
| 7246 | 7246 | #define SQLITE_TXN_WRITE 2 |
| 7247 | 7247 | |
| @@ -7518,11 +7518,11 @@ | ||
| 7518 | 7518 | |
| 7519 | 7519 | /* |
| 7520 | 7520 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7521 | 7521 | ** |
| 7522 | 7522 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7523 | -** by all database connections within a single process. | |
| 7523 | +** used by all database connections within a single process. | |
| 7524 | 7524 | ** |
| 7525 | 7525 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7526 | 7526 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7527 | 7527 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7528 | 7528 | ** limit by reducing the number of pages held in the page cache |
| @@ -7576,11 +7576,11 @@ | ||
| 7576 | 7576 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7577 | 7577 | ** from the heap. |
| 7578 | 7578 | ** </ul>)^ |
| 7579 | 7579 | ** |
| 7580 | 7580 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7581 | -** changes in future releases of SQLite. | |
| 7581 | +** change in future releases of SQLite. | |
| 7582 | 7582 | */ |
| 7583 | 7583 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7584 | 7584 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7585 | 7585 | |
| 7586 | 7586 | /* |
| @@ -7691,12 +7691,12 @@ | ||
| 7691 | 7691 | ** be tried also. |
| 7692 | 7692 | ** |
| 7693 | 7693 | ** ^The entry point is zProc. |
| 7694 | 7694 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7695 | 7695 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7696 | -** If that does not work, it constructs a name "sqlite3_X_init" where the | |
| 7697 | -** X is consists of the lower-case equivalent of all ASCII alphabetic | |
| 7696 | +** If that does not work, it constructs a name "sqlite3_X_init" where | |
| 7697 | +** X consists of the lower-case equivalent of all ASCII alphabetic | |
| 7698 | 7698 | ** characters in the filename from the last "/" to the first following |
| 7699 | 7699 | ** "." and omitting any initial "lib".)^ |
| 7700 | 7700 | ** ^The sqlite3_load_extension() interface returns |
| 7701 | 7701 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7702 | 7702 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7927,11 +7927,11 @@ | ||
| 7927 | 7927 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7928 | 7928 | ** is true, then the constraint is assumed to be fully handled by the |
| 7929 | 7929 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7930 | 7930 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7931 | 7931 | ** is left in its default setting of false, the constraint will always be |
| 7932 | -** checked separately in byte code. If the omit flag is change to true, then | |
| 7932 | +** checked separately in byte code. If the omit flag is changed to true, then | |
| 7933 | 7933 | ** the constraint may or may not be checked in byte code. In other words, |
| 7934 | 7934 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7935 | 7935 | ** not be checked again using byte code.)^ |
| 7936 | 7936 | ** |
| 7937 | 7937 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7953,11 +7953,11 @@ | ||
| 7953 | 7953 | ** will be returned by the strategy. |
| 7954 | 7954 | ** |
| 7955 | 7955 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7956 | 7956 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7957 | 7957 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7958 | -** output to show the idxNum has hex instead of as decimal. Another flag is | |
| 7958 | +** output to show the idxNum as hex instead of as decimal. Another flag is | |
| 7959 | 7959 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7960 | 7960 | ** return at most one row. |
| 7961 | 7961 | ** |
| 7962 | 7962 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7963 | 7963 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8529,11 +8529,11 @@ | ||
| 8529 | 8529 | ** function that calls sqlite3_initialize(). |
| 8530 | 8530 | ** |
| 8531 | 8531 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8532 | 8532 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8533 | 8533 | ** routine returns NULL if it is unable to allocate the requested |
| 8534 | -** mutex. The argument to sqlite3_mutex_alloc() must one of these | |
| 8534 | +** mutex. The argument to sqlite3_mutex_alloc() must be one of these | |
| 8535 | 8535 | ** integer constants: |
| 8536 | 8536 | ** |
| 8537 | 8537 | ** <ul> |
| 8538 | 8538 | ** <li> SQLITE_MUTEX_FAST |
| 8539 | 8539 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8762,11 +8762,11 @@ | ||
| 8762 | 8762 | |
| 8763 | 8763 | /* |
| 8764 | 8764 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8765 | 8765 | ** METHOD: sqlite3 |
| 8766 | 8766 | ** |
| 8767 | -** ^This interface returns a pointer the [sqlite3_mutex] object that | |
| 8767 | +** ^This interface returns a pointer to the [sqlite3_mutex] object that | |
| 8768 | 8768 | ** serializes access to the [database connection] given in the argument |
| 8769 | 8769 | ** when the [threading mode] is Serialized. |
| 8770 | 8770 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8771 | 8771 | ** routine returns a NULL pointer. |
| 8772 | 8772 | */ |
| @@ -8885,11 +8885,11 @@ | ||
| 8885 | 8885 | |
| 8886 | 8886 | /* |
| 8887 | 8887 | ** CAPI3REF: SQL Keyword Checking |
| 8888 | 8888 | ** |
| 8889 | 8889 | ** These routines provide access to the set of SQL language keywords |
| 8890 | -** recognized by SQLite. Applications can uses these routines to determine | |
| 8890 | +** recognized by SQLite. Applications can use these routines to determine | |
| 8891 | 8891 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8892 | 8892 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8893 | 8893 | ** |
| 8894 | 8894 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8895 | 8895 | ** keywords understood by SQLite. |
| @@ -9053,11 +9053,11 @@ | ||
| 9053 | 9053 | ** |
| 9054 | 9054 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 9055 | 9055 | ** content of the dynamic string under construction in X. The value |
| 9056 | 9056 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 9057 | 9057 | ** and might be freed or altered by any subsequent method on the same |
| 9058 | -** [sqlite3_str] object. Applications must not used the pointer returned | |
| 9058 | +** [sqlite3_str] object. Applications must not use the pointer returned by | |
| 9059 | 9059 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 9060 | 9060 | ** object. ^Applications may change the content of the string returned |
| 9061 | 9061 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 9062 | 9062 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 9063 | 9063 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -9139,11 +9139,11 @@ | ||
| 9139 | 9139 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 9140 | 9140 | ** <dd>This parameter returns the number of bytes of page cache |
| 9141 | 9141 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 9142 | 9142 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 9143 | 9143 | ** returned value includes allocations that overflowed because they |
| 9144 | -** where too large (they were larger than the "sz" parameter to | |
| 9144 | +** were too large (they were larger than the "sz" parameter to | |
| 9145 | 9145 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 9146 | 9146 | ** no space was left in the page cache.</dd>)^ |
| 9147 | 9147 | ** |
| 9148 | 9148 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 9149 | 9149 | ** <dd>This parameter records the largest memory allocation request |
| @@ -9223,53 +9223,55 @@ | ||
| 9223 | 9223 | ** checked out.</dd>)^ |
| 9224 | 9224 | ** |
| 9225 | 9225 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 9226 | 9226 | ** <dd>This parameter returns the number of malloc attempts that were |
| 9227 | 9227 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 9228 | -** the current value is always zero.)^ | |
| 9228 | +** the current value is always zero.</dd>)^ | |
| 9229 | 9229 | ** |
| 9230 | 9230 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 9231 | 9231 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 9232 | -** <dd>This parameter returns the number malloc attempts that might have | |
| 9232 | +** <dd>This parameter returns the number of malloc attempts that might have | |
| 9233 | 9233 | ** been satisfied using lookaside memory but failed due to the amount of |
| 9234 | 9234 | ** memory requested being larger than the lookaside slot size. |
| 9235 | 9235 | ** Only the high-water value is meaningful; |
| 9236 | -** the current value is always zero.)^ | |
| 9236 | +** the current value is always zero.</dd>)^ | |
| 9237 | 9237 | ** |
| 9238 | 9238 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 9239 | 9239 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 9240 | -** <dd>This parameter returns the number malloc attempts that might have | |
| 9240 | +** <dd>This parameter returns the number of malloc attempts that might have | |
| 9241 | 9241 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 9242 | 9242 | ** memory already being in use. |
| 9243 | 9243 | ** Only the high-water value is meaningful; |
| 9244 | -** the current value is always zero.)^ | |
| 9244 | +** the current value is always zero.</dd>)^ | |
| 9245 | 9245 | ** |
| 9246 | 9246 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 9247 | 9247 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9248 | 9248 | ** memory used by all pager caches associated with the database connection.)^ |
| 9249 | 9249 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 9250 | +** </dd> | |
| 9250 | 9251 | ** |
| 9251 | 9252 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 9252 | 9253 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 9253 | 9254 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 9254 | 9255 | ** pager cache is shared between two or more connections the bytes of heap |
| 9255 | 9256 | ** memory used by that pager cache is divided evenly between the attached |
| 9256 | 9257 | ** connections.)^ In other words, if none of the pager caches associated |
| 9257 | 9258 | ** with the database connection are shared, this request returns the same |
| 9258 | -** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are | |
| 9259 | +** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are | |
| 9259 | 9260 | ** shared, the value returned by this call will be smaller than that returned |
| 9260 | 9261 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 9261 | -** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. | |
| 9262 | +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</dd> | |
| 9262 | 9263 | ** |
| 9263 | 9264 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 9264 | 9265 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9265 | 9266 | ** memory used to store the schema for all databases associated |
| 9266 | 9267 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 9267 | 9268 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 9268 | 9269 | ** schema memory is shared with other database connections due to |
| 9269 | 9270 | ** [shared cache mode] being enabled. |
| 9270 | 9271 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 9272 | +** </dd> | |
| 9271 | 9273 | ** |
| 9272 | 9274 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 9273 | 9275 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9274 | 9276 | ** and lookaside memory used by all prepared statements associated with |
| 9275 | 9277 | ** the database connection.)^ |
| @@ -9302,11 +9304,11 @@ | ||
| 9302 | 9304 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 9303 | 9305 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 9304 | 9306 | ** been written to disk in the middle of a transaction due to the page |
| 9305 | 9307 | ** cache overflowing. Transactions are more efficient if they are written |
| 9306 | 9308 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 9307 | -** additional overhead. This parameter can be used help identify | |
| 9309 | +** additional overhead. This parameter can be used to help identify | |
| 9308 | 9310 | ** inefficiencies that can be resolved by increasing the cache size. |
| 9309 | 9311 | ** </dd> |
| 9310 | 9312 | ** |
| 9311 | 9313 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 9312 | 9314 | ** <dd>This parameter returns zero for the current value if and only if |
| @@ -15440,12 +15442,12 @@ | ||
| 15440 | 15442 | /* |
| 15441 | 15443 | ** Macro SMXV(n) return the maximum value that can be held in variable n, |
| 15442 | 15444 | ** assuming n is a signed integer type. UMXV(n) is similar for unsigned |
| 15443 | 15445 | ** integer types. |
| 15444 | 15446 | */ |
| 15445 | -#define SMXV(n) ((((i64)1)<<(sizeof(n)-1))-1) | |
| 15446 | -#define UMXV(n) ((((i64)1)<<(sizeof(n)))-1) | |
| 15447 | +#define SMXV(n) ((((i64)1)<<(sizeof(n)*8-1))-1) | |
| 15448 | +#define UMXV(n) ((((i64)1)<<(sizeof(n)*8))-1) | |
| 15447 | 15449 | |
| 15448 | 15450 | /* |
| 15449 | 15451 | ** Round up a number to the next larger multiple of 8. This is used |
| 15450 | 15452 | ** to force 8-byte alignment on 64-bit architectures. |
| 15451 | 15453 | ** |
| @@ -19268,21 +19270,21 @@ | ||
| 19268 | 19270 | struct AggInfo { |
| 19269 | 19271 | u8 directMode; /* Direct rendering mode means take data directly |
| 19270 | 19272 | ** from source tables rather than from accumulators */ |
| 19271 | 19273 | u8 useSortingIdx; /* In direct mode, reference the sorting index rather |
| 19272 | 19274 | ** than the source table */ |
| 19273 | - u16 nSortingColumn; /* Number of columns in the sorting index */ | |
| 19275 | + u32 nSortingColumn; /* Number of columns in the sorting index */ | |
| 19274 | 19276 | int sortingIdx; /* Cursor number of the sorting index */ |
| 19275 | 19277 | int sortingIdxPTab; /* Cursor number of pseudo-table */ |
| 19276 | 19278 | int iFirstReg; /* First register in range for aCol[] and aFunc[] */ |
| 19277 | 19279 | ExprList *pGroupBy; /* The group by clause */ |
| 19278 | 19280 | struct AggInfo_col { /* For each column used in source tables */ |
| 19279 | 19281 | Table *pTab; /* Source table */ |
| 19280 | 19282 | Expr *pCExpr; /* The original expression */ |
| 19281 | 19283 | int iTable; /* Cursor number of the source table */ |
| 19282 | - i16 iColumn; /* Column number within the source table */ | |
| 19283 | - i16 iSorterColumn; /* Column number in the sorting index */ | |
| 19284 | + int iColumn; /* Column number within the source table */ | |
| 19285 | + int iSorterColumn; /* Column number in the sorting index */ | |
| 19284 | 19286 | } *aCol; |
| 19285 | 19287 | int nColumn; /* Number of used entries in aCol[] */ |
| 19286 | 19288 | int nAccumulator; /* Number of columns that show through to the output. |
| 19287 | 19289 | ** Additional columns are used only as parameters to |
| 19288 | 19290 | ** aggregate functions */ |
| @@ -80351,11 +80353,16 @@ | ||
| 80351 | 80353 | |
| 80352 | 80354 | /* If the sibling pages are not leaves, ensure that the right-child pointer |
| 80353 | 80355 | ** of the right-most new sibling page is set to the value that was |
| 80354 | 80356 | ** originally in the same field of the right-most old sibling page. */ |
| 80355 | 80357 | if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
| 80356 | - MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; | |
| 80358 | + MemPage *pOld; | |
| 80359 | + if( nNew>nOld ){ | |
| 80360 | + pOld = apNew[nOld-1]; | |
| 80361 | + }else{ | |
| 80362 | + pOld = apOld[nOld-1]; | |
| 80363 | + } | |
| 80357 | 80364 | memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4); |
| 80358 | 80365 | } |
| 80359 | 80366 | |
| 80360 | 80367 | /* Make any required updates to pointer map entries associated with |
| 80361 | 80368 | ** cells stored on sibling pages following the balance operation. Pointer |
| @@ -93911,10 +93918,12 @@ | ||
| 93911 | 93918 | rc = SQLITE_MISUSE_BKPT; |
| 93912 | 93919 | goto preupdate_new_out; |
| 93913 | 93920 | } |
| 93914 | 93921 | if( p->pPk && p->op!=SQLITE_UPDATE ){ |
| 93915 | 93922 | iStore = sqlite3TableColumnToIndex(p->pPk, iIdx); |
| 93923 | + }else if( iIdx >= p->pTab->nCol ){ | |
| 93924 | + return SQLITE_MISUSE_BKPT; | |
| 93916 | 93925 | }else{ |
| 93917 | 93926 | iStore = sqlite3TableColumnToStorage(p->pTab, iIdx); |
| 93918 | 93927 | } |
| 93919 | 93928 | |
| 93920 | 93929 | if( iStore>=p->pCsr->nField || iStore<0 ){ |
| @@ -117522,11 +117531,13 @@ | ||
| 117522 | 117531 | AggInfo *pAggInfo, /* The AggInfo object to search and/or modify */ |
| 117523 | 117532 | Expr *pExpr /* Expr describing the column to find or insert */ |
| 117524 | 117533 | ){ |
| 117525 | 117534 | struct AggInfo_col *pCol; |
| 117526 | 117535 | int k; |
| 117536 | + int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; | |
| 117527 | 117537 | |
| 117538 | + assert( mxTerm <= SMXV(i16) ); | |
| 117528 | 117539 | assert( pAggInfo->iFirstReg==0 ); |
| 117529 | 117540 | pCol = pAggInfo->aCol; |
| 117530 | 117541 | for(k=0; k<pAggInfo->nColumn; k++, pCol++){ |
| 117531 | 117542 | if( pCol->pCExpr==pExpr ) return; |
| 117532 | 117543 | if( pCol->iTable==pExpr->iTable |
| @@ -117539,10 +117550,14 @@ | ||
| 117539 | 117550 | k = addAggInfoColumn(pParse->db, pAggInfo); |
| 117540 | 117551 | if( k<0 ){ |
| 117541 | 117552 | /* OOM on resize */ |
| 117542 | 117553 | assert( pParse->db->mallocFailed ); |
| 117543 | 117554 | return; |
| 117555 | + } | |
| 117556 | + if( k>mxTerm ){ | |
| 117557 | + sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); | |
| 117558 | + k = mxTerm; | |
| 117544 | 117559 | } |
| 117545 | 117560 | pCol = &pAggInfo->aCol[k]; |
| 117546 | 117561 | assert( ExprUseYTab(pExpr) ); |
| 117547 | 117562 | pCol->pTab = pExpr->y.pTab; |
| 117548 | 117563 | pCol->iTable = pExpr->iTable; |
| @@ -117573,10 +117588,11 @@ | ||
| 117573 | 117588 | assert( pExpr->pAggInfo==0 || pExpr->pAggInfo==pAggInfo ); |
| 117574 | 117589 | pExpr->pAggInfo = pAggInfo; |
| 117575 | 117590 | if( pExpr->op==TK_COLUMN ){ |
| 117576 | 117591 | pExpr->op = TK_AGG_COLUMN; |
| 117577 | 117592 | } |
| 117593 | + assert( k <= SMXV(pExpr->iAgg) ); | |
| 117578 | 117594 | pExpr->iAgg = (i16)k; |
| 117579 | 117595 | } |
| 117580 | 117596 | |
| 117581 | 117597 | /* |
| 117582 | 117598 | ** This is the xExprCallback for a tree walker. It is used to |
| @@ -117657,17 +117673,23 @@ | ||
| 117657 | 117673 | ){ |
| 117658 | 117674 | /* Check to see if pExpr is a duplicate of another aggregate |
| 117659 | 117675 | ** function that is already in the pAggInfo structure |
| 117660 | 117676 | */ |
| 117661 | 117677 | struct AggInfo_func *pItem = pAggInfo->aFunc; |
| 117678 | + int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; | |
| 117679 | + assert( mxTerm <= SMXV(i16) ); | |
| 117662 | 117680 | for(i=0; i<pAggInfo->nFunc; i++, pItem++){ |
| 117663 | 117681 | if( NEVER(pItem->pFExpr==pExpr) ) break; |
| 117664 | 117682 | if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){ |
| 117665 | 117683 | break; |
| 117666 | 117684 | } |
| 117667 | 117685 | } |
| 117668 | - if( i>=pAggInfo->nFunc ){ | |
| 117686 | + if( i>mxTerm ){ | |
| 117687 | + sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); | |
| 117688 | + i = mxTerm; | |
| 117689 | + assert( i<pAggInfo->nFunc ); | |
| 117690 | + }else if( i>=pAggInfo->nFunc ){ | |
| 117669 | 117691 | /* pExpr is original. Make a new entry in pAggInfo->aFunc[] |
| 117670 | 117692 | */ |
| 117671 | 117693 | u8 enc = ENC(pParse->db); |
| 117672 | 117694 | i = addAggInfoFunc(pParse->db, pAggInfo); |
| 117673 | 117695 | if( i>=0 ){ |
| @@ -117717,10 +117739,11 @@ | ||
| 117717 | 117739 | } |
| 117718 | 117740 | /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry |
| 117719 | 117741 | */ |
| 117720 | 117742 | assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); |
| 117721 | 117743 | ExprSetVVAProperty(pExpr, EP_NoReduce); |
| 117744 | + assert( i <= SMXV(pExpr->iAgg) ); | |
| 117722 | 117745 | pExpr->iAgg = (i16)i; |
| 117723 | 117746 | pExpr->pAggInfo = pAggInfo; |
| 117724 | 117747 | return WRC_Prune; |
| 117725 | 117748 | }else{ |
| 117726 | 117749 | return WRC_Continue; |
| @@ -257480,11 +257503,11 @@ | ||
| 257480 | 257503 | int nArg, /* Number of args */ |
| 257481 | 257504 | sqlite3_value **apUnused /* Function arguments */ |
| 257482 | 257505 | ){ |
| 257483 | 257506 | assert( nArg==0 ); |
| 257484 | 257507 | UNUSED_PARAM2(nArg, apUnused); |
| 257485 | - sqlite3_result_text(pCtx, "fts5: 2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85", -1, SQLITE_TRANSIENT); | |
| 257508 | + sqlite3_result_text(pCtx, "fts5: 2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8", -1, SQLITE_TRANSIENT); | |
| 257486 | 257509 | } |
| 257487 | 257510 | |
| 257488 | 257511 | /* |
| 257489 | 257512 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 257490 | 257513 | ** |
| 257491 | 257514 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** 6a5701e6c7be25cba93e55438f950966e1da with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.51.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3051000 |
| 470 | #define SQLITE_SOURCE_ID "2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -6355,11 +6355,11 @@ | |
| 6355 | /* |
| 6356 | ** CAPI3REF: Copy And Free SQL Values |
| 6357 | ** METHOD: sqlite3_value |
| 6358 | ** |
| 6359 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6360 | ** object D and returns a pointer to that copy. ^The [sqlite3_value] returned |
| 6361 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6362 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6363 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6364 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6365 | ** |
| @@ -6393,11 +6393,11 @@ | |
| 6393 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6394 | ** when first called if N is less than or equal to zero or if a memory |
| 6395 | ** allocation error occurs. |
| 6396 | ** |
| 6397 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6398 | ** determined by the N parameter on first successful call. Changing the |
| 6399 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6400 | ** the same aggregate function instance will not resize the memory |
| 6401 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6402 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6403 | ** pointless memory allocations occur. |
| @@ -6555,11 +6555,11 @@ | |
| 6555 | ** of as a secret key such that only code that knows the secret key is able |
| 6556 | ** to access the associated data. |
| 6557 | ** |
| 6558 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6559 | ** languages or in other circumstances where it might be possible for an |
| 6560 | ** an attacker to invoke them. Any agent that can invoke these interfaces |
| 6561 | ** can probably also take control of the process. |
| 6562 | ** |
| 6563 | ** Database connection client data is only available for SQLite |
| 6564 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6565 | ** |
| @@ -6669,11 +6669,11 @@ | |
| 6669 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6670 | ** is non-negative, then as many bytes (not characters) of the text |
| 6671 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6672 | ** function result. If the 3rd parameter is non-negative, then it |
| 6673 | ** must be the byte offset into the string where the NUL terminator would |
| 6674 | ** appear if the string where NUL terminated. If any NUL characters occur |
| 6675 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6676 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6677 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6678 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6679 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6727,11 +6727,11 @@ | |
| 6727 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6728 | ** when SQLite is finished with P. The T parameter should be a static |
| 6729 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6730 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6731 | ** |
| 6732 | ** If these routines are called from within the different thread |
| 6733 | ** than the one containing the application-defined function that received |
| 6734 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6735 | */ |
| 6736 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6737 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -7133,11 +7133,11 @@ | |
| 7133 | /* |
| 7134 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 7135 | ** METHOD: sqlite3 |
| 7136 | ** |
| 7137 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 7138 | ** for the N-th database on database connection D, or a NULL pointer of N is |
| 7139 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 7140 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 7141 | ** databases. |
| 7142 | ** |
| 7143 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -7228,20 +7228,20 @@ | |
| 7228 | ** |
| 7229 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 7230 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 7231 | ** in a read transaction. Content has been read from the database file |
| 7232 | ** but nothing in the database file has changed. The transaction state |
| 7233 | ** will advanced to SQLITE_TXN_WRITE if any changes occur and there are |
| 7234 | ** no other conflicting concurrent write transactions. The transaction |
| 7235 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 7236 | ** [COMMIT].</dd> |
| 7237 | ** |
| 7238 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 7239 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 7240 | ** in a write transaction. Content has been written to the database file |
| 7241 | ** but has not yet committed. The transaction state will change to |
| 7242 | ** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> |
| 7243 | */ |
| 7244 | #define SQLITE_TXN_NONE 0 |
| 7245 | #define SQLITE_TXN_READ 1 |
| 7246 | #define SQLITE_TXN_WRITE 2 |
| 7247 | |
| @@ -7518,11 +7518,11 @@ | |
| 7518 | |
| 7519 | /* |
| 7520 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7521 | ** |
| 7522 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7523 | ** by all database connections within a single process. |
| 7524 | ** |
| 7525 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7526 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7527 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7528 | ** limit by reducing the number of pages held in the page cache |
| @@ -7576,11 +7576,11 @@ | |
| 7576 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7577 | ** from the heap. |
| 7578 | ** </ul>)^ |
| 7579 | ** |
| 7580 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7581 | ** changes in future releases of SQLite. |
| 7582 | */ |
| 7583 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7584 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7585 | |
| 7586 | /* |
| @@ -7691,12 +7691,12 @@ | |
| 7691 | ** be tried also. |
| 7692 | ** |
| 7693 | ** ^The entry point is zProc. |
| 7694 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7695 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7696 | ** If that does not work, it constructs a name "sqlite3_X_init" where the |
| 7697 | ** X is consists of the lower-case equivalent of all ASCII alphabetic |
| 7698 | ** characters in the filename from the last "/" to the first following |
| 7699 | ** "." and omitting any initial "lib".)^ |
| 7700 | ** ^The sqlite3_load_extension() interface returns |
| 7701 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7702 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7927,11 +7927,11 @@ | |
| 7927 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7928 | ** is true, then the constraint is assumed to be fully handled by the |
| 7929 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7930 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7931 | ** is left in its default setting of false, the constraint will always be |
| 7932 | ** checked separately in byte code. If the omit flag is change to true, then |
| 7933 | ** the constraint may or may not be checked in byte code. In other words, |
| 7934 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7935 | ** not be checked again using byte code.)^ |
| 7936 | ** |
| 7937 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7953,11 +7953,11 @@ | |
| 7953 | ** will be returned by the strategy. |
| 7954 | ** |
| 7955 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7956 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7957 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7958 | ** output to show the idxNum has hex instead of as decimal. Another flag is |
| 7959 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7960 | ** return at most one row. |
| 7961 | ** |
| 7962 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7963 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8529,11 +8529,11 @@ | |
| 8529 | ** function that calls sqlite3_initialize(). |
| 8530 | ** |
| 8531 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8532 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8533 | ** routine returns NULL if it is unable to allocate the requested |
| 8534 | ** mutex. The argument to sqlite3_mutex_alloc() must one of these |
| 8535 | ** integer constants: |
| 8536 | ** |
| 8537 | ** <ul> |
| 8538 | ** <li> SQLITE_MUTEX_FAST |
| 8539 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8762,11 +8762,11 @@ | |
| 8762 | |
| 8763 | /* |
| 8764 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8765 | ** METHOD: sqlite3 |
| 8766 | ** |
| 8767 | ** ^This interface returns a pointer the [sqlite3_mutex] object that |
| 8768 | ** serializes access to the [database connection] given in the argument |
| 8769 | ** when the [threading mode] is Serialized. |
| 8770 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8771 | ** routine returns a NULL pointer. |
| 8772 | */ |
| @@ -8885,11 +8885,11 @@ | |
| 8885 | |
| 8886 | /* |
| 8887 | ** CAPI3REF: SQL Keyword Checking |
| 8888 | ** |
| 8889 | ** These routines provide access to the set of SQL language keywords |
| 8890 | ** recognized by SQLite. Applications can uses these routines to determine |
| 8891 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8892 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8893 | ** |
| 8894 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8895 | ** keywords understood by SQLite. |
| @@ -9053,11 +9053,11 @@ | |
| 9053 | ** |
| 9054 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 9055 | ** content of the dynamic string under construction in X. The value |
| 9056 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 9057 | ** and might be freed or altered by any subsequent method on the same |
| 9058 | ** [sqlite3_str] object. Applications must not used the pointer returned |
| 9059 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 9060 | ** object. ^Applications may change the content of the string returned |
| 9061 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 9062 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 9063 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -9139,11 +9139,11 @@ | |
| 9139 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 9140 | ** <dd>This parameter returns the number of bytes of page cache |
| 9141 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 9142 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 9143 | ** returned value includes allocations that overflowed because they |
| 9144 | ** where too large (they were larger than the "sz" parameter to |
| 9145 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 9146 | ** no space was left in the page cache.</dd>)^ |
| 9147 | ** |
| 9148 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 9149 | ** <dd>This parameter records the largest memory allocation request |
| @@ -9223,53 +9223,55 @@ | |
| 9223 | ** checked out.</dd>)^ |
| 9224 | ** |
| 9225 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 9226 | ** <dd>This parameter returns the number of malloc attempts that were |
| 9227 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 9228 | ** the current value is always zero.)^ |
| 9229 | ** |
| 9230 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 9231 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 9232 | ** <dd>This parameter returns the number malloc attempts that might have |
| 9233 | ** been satisfied using lookaside memory but failed due to the amount of |
| 9234 | ** memory requested being larger than the lookaside slot size. |
| 9235 | ** Only the high-water value is meaningful; |
| 9236 | ** the current value is always zero.)^ |
| 9237 | ** |
| 9238 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 9239 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 9240 | ** <dd>This parameter returns the number malloc attempts that might have |
| 9241 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 9242 | ** memory already being in use. |
| 9243 | ** Only the high-water value is meaningful; |
| 9244 | ** the current value is always zero.)^ |
| 9245 | ** |
| 9246 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 9247 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9248 | ** memory used by all pager caches associated with the database connection.)^ |
| 9249 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 9250 | ** |
| 9251 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 9252 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 9253 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 9254 | ** pager cache is shared between two or more connections the bytes of heap |
| 9255 | ** memory used by that pager cache is divided evenly between the attached |
| 9256 | ** connections.)^ In other words, if none of the pager caches associated |
| 9257 | ** with the database connection are shared, this request returns the same |
| 9258 | ** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are |
| 9259 | ** shared, the value returned by this call will be smaller than that returned |
| 9260 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 9261 | ** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. |
| 9262 | ** |
| 9263 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 9264 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9265 | ** memory used to store the schema for all databases associated |
| 9266 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 9267 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 9268 | ** schema memory is shared with other database connections due to |
| 9269 | ** [shared cache mode] being enabled. |
| 9270 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 9271 | ** |
| 9272 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 9273 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9274 | ** and lookaside memory used by all prepared statements associated with |
| 9275 | ** the database connection.)^ |
| @@ -9302,11 +9304,11 @@ | |
| 9302 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 9303 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 9304 | ** been written to disk in the middle of a transaction due to the page |
| 9305 | ** cache overflowing. Transactions are more efficient if they are written |
| 9306 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 9307 | ** additional overhead. This parameter can be used help identify |
| 9308 | ** inefficiencies that can be resolved by increasing the cache size. |
| 9309 | ** </dd> |
| 9310 | ** |
| 9311 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 9312 | ** <dd>This parameter returns zero for the current value if and only if |
| @@ -15440,12 +15442,12 @@ | |
| 15440 | /* |
| 15441 | ** Macro SMXV(n) return the maximum value that can be held in variable n, |
| 15442 | ** assuming n is a signed integer type. UMXV(n) is similar for unsigned |
| 15443 | ** integer types. |
| 15444 | */ |
| 15445 | #define SMXV(n) ((((i64)1)<<(sizeof(n)-1))-1) |
| 15446 | #define UMXV(n) ((((i64)1)<<(sizeof(n)))-1) |
| 15447 | |
| 15448 | /* |
| 15449 | ** Round up a number to the next larger multiple of 8. This is used |
| 15450 | ** to force 8-byte alignment on 64-bit architectures. |
| 15451 | ** |
| @@ -19268,21 +19270,21 @@ | |
| 19268 | struct AggInfo { |
| 19269 | u8 directMode; /* Direct rendering mode means take data directly |
| 19270 | ** from source tables rather than from accumulators */ |
| 19271 | u8 useSortingIdx; /* In direct mode, reference the sorting index rather |
| 19272 | ** than the source table */ |
| 19273 | u16 nSortingColumn; /* Number of columns in the sorting index */ |
| 19274 | int sortingIdx; /* Cursor number of the sorting index */ |
| 19275 | int sortingIdxPTab; /* Cursor number of pseudo-table */ |
| 19276 | int iFirstReg; /* First register in range for aCol[] and aFunc[] */ |
| 19277 | ExprList *pGroupBy; /* The group by clause */ |
| 19278 | struct AggInfo_col { /* For each column used in source tables */ |
| 19279 | Table *pTab; /* Source table */ |
| 19280 | Expr *pCExpr; /* The original expression */ |
| 19281 | int iTable; /* Cursor number of the source table */ |
| 19282 | i16 iColumn; /* Column number within the source table */ |
| 19283 | i16 iSorterColumn; /* Column number in the sorting index */ |
| 19284 | } *aCol; |
| 19285 | int nColumn; /* Number of used entries in aCol[] */ |
| 19286 | int nAccumulator; /* Number of columns that show through to the output. |
| 19287 | ** Additional columns are used only as parameters to |
| 19288 | ** aggregate functions */ |
| @@ -80351,11 +80353,16 @@ | |
| 80351 | |
| 80352 | /* If the sibling pages are not leaves, ensure that the right-child pointer |
| 80353 | ** of the right-most new sibling page is set to the value that was |
| 80354 | ** originally in the same field of the right-most old sibling page. */ |
| 80355 | if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
| 80356 | MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; |
| 80357 | memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4); |
| 80358 | } |
| 80359 | |
| 80360 | /* Make any required updates to pointer map entries associated with |
| 80361 | ** cells stored on sibling pages following the balance operation. Pointer |
| @@ -93911,10 +93918,12 @@ | |
| 93911 | rc = SQLITE_MISUSE_BKPT; |
| 93912 | goto preupdate_new_out; |
| 93913 | } |
| 93914 | if( p->pPk && p->op!=SQLITE_UPDATE ){ |
| 93915 | iStore = sqlite3TableColumnToIndex(p->pPk, iIdx); |
| 93916 | }else{ |
| 93917 | iStore = sqlite3TableColumnToStorage(p->pTab, iIdx); |
| 93918 | } |
| 93919 | |
| 93920 | if( iStore>=p->pCsr->nField || iStore<0 ){ |
| @@ -117522,11 +117531,13 @@ | |
| 117522 | AggInfo *pAggInfo, /* The AggInfo object to search and/or modify */ |
| 117523 | Expr *pExpr /* Expr describing the column to find or insert */ |
| 117524 | ){ |
| 117525 | struct AggInfo_col *pCol; |
| 117526 | int k; |
| 117527 | |
| 117528 | assert( pAggInfo->iFirstReg==0 ); |
| 117529 | pCol = pAggInfo->aCol; |
| 117530 | for(k=0; k<pAggInfo->nColumn; k++, pCol++){ |
| 117531 | if( pCol->pCExpr==pExpr ) return; |
| 117532 | if( pCol->iTable==pExpr->iTable |
| @@ -117539,10 +117550,14 @@ | |
| 117539 | k = addAggInfoColumn(pParse->db, pAggInfo); |
| 117540 | if( k<0 ){ |
| 117541 | /* OOM on resize */ |
| 117542 | assert( pParse->db->mallocFailed ); |
| 117543 | return; |
| 117544 | } |
| 117545 | pCol = &pAggInfo->aCol[k]; |
| 117546 | assert( ExprUseYTab(pExpr) ); |
| 117547 | pCol->pTab = pExpr->y.pTab; |
| 117548 | pCol->iTable = pExpr->iTable; |
| @@ -117573,10 +117588,11 @@ | |
| 117573 | assert( pExpr->pAggInfo==0 || pExpr->pAggInfo==pAggInfo ); |
| 117574 | pExpr->pAggInfo = pAggInfo; |
| 117575 | if( pExpr->op==TK_COLUMN ){ |
| 117576 | pExpr->op = TK_AGG_COLUMN; |
| 117577 | } |
| 117578 | pExpr->iAgg = (i16)k; |
| 117579 | } |
| 117580 | |
| 117581 | /* |
| 117582 | ** This is the xExprCallback for a tree walker. It is used to |
| @@ -117657,17 +117673,23 @@ | |
| 117657 | ){ |
| 117658 | /* Check to see if pExpr is a duplicate of another aggregate |
| 117659 | ** function that is already in the pAggInfo structure |
| 117660 | */ |
| 117661 | struct AggInfo_func *pItem = pAggInfo->aFunc; |
| 117662 | for(i=0; i<pAggInfo->nFunc; i++, pItem++){ |
| 117663 | if( NEVER(pItem->pFExpr==pExpr) ) break; |
| 117664 | if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){ |
| 117665 | break; |
| 117666 | } |
| 117667 | } |
| 117668 | if( i>=pAggInfo->nFunc ){ |
| 117669 | /* pExpr is original. Make a new entry in pAggInfo->aFunc[] |
| 117670 | */ |
| 117671 | u8 enc = ENC(pParse->db); |
| 117672 | i = addAggInfoFunc(pParse->db, pAggInfo); |
| 117673 | if( i>=0 ){ |
| @@ -117717,10 +117739,11 @@ | |
| 117717 | } |
| 117718 | /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry |
| 117719 | */ |
| 117720 | assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); |
| 117721 | ExprSetVVAProperty(pExpr, EP_NoReduce); |
| 117722 | pExpr->iAgg = (i16)i; |
| 117723 | pExpr->pAggInfo = pAggInfo; |
| 117724 | return WRC_Prune; |
| 117725 | }else{ |
| 117726 | return WRC_Continue; |
| @@ -257480,11 +257503,11 @@ | |
| 257480 | int nArg, /* Number of args */ |
| 257481 | sqlite3_value **apUnused /* Function arguments */ |
| 257482 | ){ |
| 257483 | assert( nArg==0 ); |
| 257484 | UNUSED_PARAM2(nArg, apUnused); |
| 257485 | sqlite3_result_text(pCtx, "fts5: 2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85", -1, SQLITE_TRANSIENT); |
| 257486 | } |
| 257487 | |
| 257488 | /* |
| 257489 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 257490 | ** |
| 257491 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** 5508b56fd24016c13981ec280ecdd833007c with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.51.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3051000 |
| 470 | #define SQLITE_SOURCE_ID "2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -6355,11 +6355,11 @@ | |
| 6355 | /* |
| 6356 | ** CAPI3REF: Copy And Free SQL Values |
| 6357 | ** METHOD: sqlite3_value |
| 6358 | ** |
| 6359 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6360 | ** object V and returns a pointer to that copy. ^The [sqlite3_value] returned |
| 6361 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6362 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6363 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6364 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6365 | ** |
| @@ -6393,11 +6393,11 @@ | |
| 6393 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6394 | ** when first called if N is less than or equal to zero or if a memory |
| 6395 | ** allocation error occurs. |
| 6396 | ** |
| 6397 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6398 | ** determined by the N parameter on the first successful call. Changing the |
| 6399 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6400 | ** the same aggregate function instance will not resize the memory |
| 6401 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6402 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6403 | ** pointless memory allocations occur. |
| @@ -6555,11 +6555,11 @@ | |
| 6555 | ** of as a secret key such that only code that knows the secret key is able |
| 6556 | ** to access the associated data. |
| 6557 | ** |
| 6558 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6559 | ** languages or in other circumstances where it might be possible for an |
| 6560 | ** attacker to invoke them. Any agent that can invoke these interfaces |
| 6561 | ** can probably also take control of the process. |
| 6562 | ** |
| 6563 | ** Database connection client data is only available for SQLite |
| 6564 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6565 | ** |
| @@ -6669,11 +6669,11 @@ | |
| 6669 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6670 | ** is non-negative, then as many bytes (not characters) of the text |
| 6671 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6672 | ** function result. If the 3rd parameter is non-negative, then it |
| 6673 | ** must be the byte offset into the string where the NUL terminator would |
| 6674 | ** appear if the string were NUL terminated. If any NUL characters occur |
| 6675 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6676 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6677 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6678 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6679 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6727,11 +6727,11 @@ | |
| 6727 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6728 | ** when SQLite is finished with P. The T parameter should be a static |
| 6729 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6730 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6731 | ** |
| 6732 | ** If these routines are called from within a different thread |
| 6733 | ** than the one containing the application-defined function that received |
| 6734 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6735 | */ |
| 6736 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6737 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -7133,11 +7133,11 @@ | |
| 7133 | /* |
| 7134 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 7135 | ** METHOD: sqlite3 |
| 7136 | ** |
| 7137 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 7138 | ** for the N-th database on database connection D, or a NULL pointer if N is |
| 7139 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 7140 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 7141 | ** databases. |
| 7142 | ** |
| 7143 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -7228,20 +7228,20 @@ | |
| 7228 | ** |
| 7229 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 7230 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 7231 | ** in a read transaction. Content has been read from the database file |
| 7232 | ** but nothing in the database file has changed. The transaction state |
| 7233 | ** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are |
| 7234 | ** no other conflicting concurrent write transactions. The transaction |
| 7235 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 7236 | ** [COMMIT].</dd> |
| 7237 | ** |
| 7238 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 7239 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 7240 | ** in a write transaction. Content has been written to the database file |
| 7241 | ** but has not yet committed. The transaction state will change to |
| 7242 | ** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> |
| 7243 | */ |
| 7244 | #define SQLITE_TXN_NONE 0 |
| 7245 | #define SQLITE_TXN_READ 1 |
| 7246 | #define SQLITE_TXN_WRITE 2 |
| 7247 | |
| @@ -7518,11 +7518,11 @@ | |
| 7518 | |
| 7519 | /* |
| 7520 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7521 | ** |
| 7522 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7523 | ** used by all database connections within a single process. |
| 7524 | ** |
| 7525 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7526 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7527 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7528 | ** limit by reducing the number of pages held in the page cache |
| @@ -7576,11 +7576,11 @@ | |
| 7576 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7577 | ** from the heap. |
| 7578 | ** </ul>)^ |
| 7579 | ** |
| 7580 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7581 | ** change in future releases of SQLite. |
| 7582 | */ |
| 7583 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7584 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7585 | |
| 7586 | /* |
| @@ -7691,12 +7691,12 @@ | |
| 7691 | ** be tried also. |
| 7692 | ** |
| 7693 | ** ^The entry point is zProc. |
| 7694 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7695 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7696 | ** If that does not work, it constructs a name "sqlite3_X_init" where |
| 7697 | ** X consists of the lower-case equivalent of all ASCII alphabetic |
| 7698 | ** characters in the filename from the last "/" to the first following |
| 7699 | ** "." and omitting any initial "lib".)^ |
| 7700 | ** ^The sqlite3_load_extension() interface returns |
| 7701 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7702 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7927,11 +7927,11 @@ | |
| 7927 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7928 | ** is true, then the constraint is assumed to be fully handled by the |
| 7929 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7930 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7931 | ** is left in its default setting of false, the constraint will always be |
| 7932 | ** checked separately in byte code. If the omit flag is changed to true, then |
| 7933 | ** the constraint may or may not be checked in byte code. In other words, |
| 7934 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7935 | ** not be checked again using byte code.)^ |
| 7936 | ** |
| 7937 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7953,11 +7953,11 @@ | |
| 7953 | ** will be returned by the strategy. |
| 7954 | ** |
| 7955 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7956 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7957 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7958 | ** output to show the idxNum as hex instead of as decimal. Another flag is |
| 7959 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7960 | ** return at most one row. |
| 7961 | ** |
| 7962 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7963 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8529,11 +8529,11 @@ | |
| 8529 | ** function that calls sqlite3_initialize(). |
| 8530 | ** |
| 8531 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8532 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8533 | ** routine returns NULL if it is unable to allocate the requested |
| 8534 | ** mutex. The argument to sqlite3_mutex_alloc() must be one of these |
| 8535 | ** integer constants: |
| 8536 | ** |
| 8537 | ** <ul> |
| 8538 | ** <li> SQLITE_MUTEX_FAST |
| 8539 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8762,11 +8762,11 @@ | |
| 8762 | |
| 8763 | /* |
| 8764 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8765 | ** METHOD: sqlite3 |
| 8766 | ** |
| 8767 | ** ^This interface returns a pointer to the [sqlite3_mutex] object that |
| 8768 | ** serializes access to the [database connection] given in the argument |
| 8769 | ** when the [threading mode] is Serialized. |
| 8770 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8771 | ** routine returns a NULL pointer. |
| 8772 | */ |
| @@ -8885,11 +8885,11 @@ | |
| 8885 | |
| 8886 | /* |
| 8887 | ** CAPI3REF: SQL Keyword Checking |
| 8888 | ** |
| 8889 | ** These routines provide access to the set of SQL language keywords |
| 8890 | ** recognized by SQLite. Applications can use these routines to determine |
| 8891 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8892 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8893 | ** |
| 8894 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8895 | ** keywords understood by SQLite. |
| @@ -9053,11 +9053,11 @@ | |
| 9053 | ** |
| 9054 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 9055 | ** content of the dynamic string under construction in X. The value |
| 9056 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 9057 | ** and might be freed or altered by any subsequent method on the same |
| 9058 | ** [sqlite3_str] object. Applications must not use the pointer returned by |
| 9059 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 9060 | ** object. ^Applications may change the content of the string returned |
| 9061 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 9062 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 9063 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -9139,11 +9139,11 @@ | |
| 9139 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 9140 | ** <dd>This parameter returns the number of bytes of page cache |
| 9141 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 9142 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 9143 | ** returned value includes allocations that overflowed because they |
| 9144 | ** were too large (they were larger than the "sz" parameter to |
| 9145 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 9146 | ** no space was left in the page cache.</dd>)^ |
| 9147 | ** |
| 9148 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 9149 | ** <dd>This parameter records the largest memory allocation request |
| @@ -9223,53 +9223,55 @@ | |
| 9223 | ** checked out.</dd>)^ |
| 9224 | ** |
| 9225 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 9226 | ** <dd>This parameter returns the number of malloc attempts that were |
| 9227 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 9228 | ** the current value is always zero.</dd>)^ |
| 9229 | ** |
| 9230 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 9231 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 9232 | ** <dd>This parameter returns the number of malloc attempts that might have |
| 9233 | ** been satisfied using lookaside memory but failed due to the amount of |
| 9234 | ** memory requested being larger than the lookaside slot size. |
| 9235 | ** Only the high-water value is meaningful; |
| 9236 | ** the current value is always zero.</dd>)^ |
| 9237 | ** |
| 9238 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 9239 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 9240 | ** <dd>This parameter returns the number of malloc attempts that might have |
| 9241 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 9242 | ** memory already being in use. |
| 9243 | ** Only the high-water value is meaningful; |
| 9244 | ** the current value is always zero.</dd>)^ |
| 9245 | ** |
| 9246 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 9247 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9248 | ** memory used by all pager caches associated with the database connection.)^ |
| 9249 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 9250 | ** </dd> |
| 9251 | ** |
| 9252 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 9253 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 9254 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 9255 | ** pager cache is shared between two or more connections the bytes of heap |
| 9256 | ** memory used by that pager cache is divided evenly between the attached |
| 9257 | ** connections.)^ In other words, if none of the pager caches associated |
| 9258 | ** with the database connection are shared, this request returns the same |
| 9259 | ** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are |
| 9260 | ** shared, the value returned by this call will be smaller than that returned |
| 9261 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 9262 | ** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</dd> |
| 9263 | ** |
| 9264 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 9265 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9266 | ** memory used to store the schema for all databases associated |
| 9267 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 9268 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 9269 | ** schema memory is shared with other database connections due to |
| 9270 | ** [shared cache mode] being enabled. |
| 9271 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 9272 | ** </dd> |
| 9273 | ** |
| 9274 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 9275 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 9276 | ** and lookaside memory used by all prepared statements associated with |
| 9277 | ** the database connection.)^ |
| @@ -9302,11 +9304,11 @@ | |
| 9304 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 9305 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 9306 | ** been written to disk in the middle of a transaction due to the page |
| 9307 | ** cache overflowing. Transactions are more efficient if they are written |
| 9308 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 9309 | ** additional overhead. This parameter can be used to help identify |
| 9310 | ** inefficiencies that can be resolved by increasing the cache size. |
| 9311 | ** </dd> |
| 9312 | ** |
| 9313 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 9314 | ** <dd>This parameter returns zero for the current value if and only if |
| @@ -15440,12 +15442,12 @@ | |
| 15442 | /* |
| 15443 | ** Macro SMXV(n) return the maximum value that can be held in variable n, |
| 15444 | ** assuming n is a signed integer type. UMXV(n) is similar for unsigned |
| 15445 | ** integer types. |
| 15446 | */ |
| 15447 | #define SMXV(n) ((((i64)1)<<(sizeof(n)*8-1))-1) |
| 15448 | #define UMXV(n) ((((i64)1)<<(sizeof(n)*8))-1) |
| 15449 | |
| 15450 | /* |
| 15451 | ** Round up a number to the next larger multiple of 8. This is used |
| 15452 | ** to force 8-byte alignment on 64-bit architectures. |
| 15453 | ** |
| @@ -19268,21 +19270,21 @@ | |
| 19270 | struct AggInfo { |
| 19271 | u8 directMode; /* Direct rendering mode means take data directly |
| 19272 | ** from source tables rather than from accumulators */ |
| 19273 | u8 useSortingIdx; /* In direct mode, reference the sorting index rather |
| 19274 | ** than the source table */ |
| 19275 | u32 nSortingColumn; /* Number of columns in the sorting index */ |
| 19276 | int sortingIdx; /* Cursor number of the sorting index */ |
| 19277 | int sortingIdxPTab; /* Cursor number of pseudo-table */ |
| 19278 | int iFirstReg; /* First register in range for aCol[] and aFunc[] */ |
| 19279 | ExprList *pGroupBy; /* The group by clause */ |
| 19280 | struct AggInfo_col { /* For each column used in source tables */ |
| 19281 | Table *pTab; /* Source table */ |
| 19282 | Expr *pCExpr; /* The original expression */ |
| 19283 | int iTable; /* Cursor number of the source table */ |
| 19284 | int iColumn; /* Column number within the source table */ |
| 19285 | int iSorterColumn; /* Column number in the sorting index */ |
| 19286 | } *aCol; |
| 19287 | int nColumn; /* Number of used entries in aCol[] */ |
| 19288 | int nAccumulator; /* Number of columns that show through to the output. |
| 19289 | ** Additional columns are used only as parameters to |
| 19290 | ** aggregate functions */ |
| @@ -80351,11 +80353,16 @@ | |
| 80353 | |
| 80354 | /* If the sibling pages are not leaves, ensure that the right-child pointer |
| 80355 | ** of the right-most new sibling page is set to the value that was |
| 80356 | ** originally in the same field of the right-most old sibling page. */ |
| 80357 | if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
| 80358 | MemPage *pOld; |
| 80359 | if( nNew>nOld ){ |
| 80360 | pOld = apNew[nOld-1]; |
| 80361 | }else{ |
| 80362 | pOld = apOld[nOld-1]; |
| 80363 | } |
| 80364 | memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4); |
| 80365 | } |
| 80366 | |
| 80367 | /* Make any required updates to pointer map entries associated with |
| 80368 | ** cells stored on sibling pages following the balance operation. Pointer |
| @@ -93911,10 +93918,12 @@ | |
| 93918 | rc = SQLITE_MISUSE_BKPT; |
| 93919 | goto preupdate_new_out; |
| 93920 | } |
| 93921 | if( p->pPk && p->op!=SQLITE_UPDATE ){ |
| 93922 | iStore = sqlite3TableColumnToIndex(p->pPk, iIdx); |
| 93923 | }else if( iIdx >= p->pTab->nCol ){ |
| 93924 | return SQLITE_MISUSE_BKPT; |
| 93925 | }else{ |
| 93926 | iStore = sqlite3TableColumnToStorage(p->pTab, iIdx); |
| 93927 | } |
| 93928 | |
| 93929 | if( iStore>=p->pCsr->nField || iStore<0 ){ |
| @@ -117522,11 +117531,13 @@ | |
| 117531 | AggInfo *pAggInfo, /* The AggInfo object to search and/or modify */ |
| 117532 | Expr *pExpr /* Expr describing the column to find or insert */ |
| 117533 | ){ |
| 117534 | struct AggInfo_col *pCol; |
| 117535 | int k; |
| 117536 | int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; |
| 117537 | |
| 117538 | assert( mxTerm <= SMXV(i16) ); |
| 117539 | assert( pAggInfo->iFirstReg==0 ); |
| 117540 | pCol = pAggInfo->aCol; |
| 117541 | for(k=0; k<pAggInfo->nColumn; k++, pCol++){ |
| 117542 | if( pCol->pCExpr==pExpr ) return; |
| 117543 | if( pCol->iTable==pExpr->iTable |
| @@ -117539,10 +117550,14 @@ | |
| 117550 | k = addAggInfoColumn(pParse->db, pAggInfo); |
| 117551 | if( k<0 ){ |
| 117552 | /* OOM on resize */ |
| 117553 | assert( pParse->db->mallocFailed ); |
| 117554 | return; |
| 117555 | } |
| 117556 | if( k>mxTerm ){ |
| 117557 | sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); |
| 117558 | k = mxTerm; |
| 117559 | } |
| 117560 | pCol = &pAggInfo->aCol[k]; |
| 117561 | assert( ExprUseYTab(pExpr) ); |
| 117562 | pCol->pTab = pExpr->y.pTab; |
| 117563 | pCol->iTable = pExpr->iTable; |
| @@ -117573,10 +117588,11 @@ | |
| 117588 | assert( pExpr->pAggInfo==0 || pExpr->pAggInfo==pAggInfo ); |
| 117589 | pExpr->pAggInfo = pAggInfo; |
| 117590 | if( pExpr->op==TK_COLUMN ){ |
| 117591 | pExpr->op = TK_AGG_COLUMN; |
| 117592 | } |
| 117593 | assert( k <= SMXV(pExpr->iAgg) ); |
| 117594 | pExpr->iAgg = (i16)k; |
| 117595 | } |
| 117596 | |
| 117597 | /* |
| 117598 | ** This is the xExprCallback for a tree walker. It is used to |
| @@ -117657,17 +117673,23 @@ | |
| 117673 | ){ |
| 117674 | /* Check to see if pExpr is a duplicate of another aggregate |
| 117675 | ** function that is already in the pAggInfo structure |
| 117676 | */ |
| 117677 | struct AggInfo_func *pItem = pAggInfo->aFunc; |
| 117678 | int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; |
| 117679 | assert( mxTerm <= SMXV(i16) ); |
| 117680 | for(i=0; i<pAggInfo->nFunc; i++, pItem++){ |
| 117681 | if( NEVER(pItem->pFExpr==pExpr) ) break; |
| 117682 | if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){ |
| 117683 | break; |
| 117684 | } |
| 117685 | } |
| 117686 | if( i>mxTerm ){ |
| 117687 | sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); |
| 117688 | i = mxTerm; |
| 117689 | assert( i<pAggInfo->nFunc ); |
| 117690 | }else if( i>=pAggInfo->nFunc ){ |
| 117691 | /* pExpr is original. Make a new entry in pAggInfo->aFunc[] |
| 117692 | */ |
| 117693 | u8 enc = ENC(pParse->db); |
| 117694 | i = addAggInfoFunc(pParse->db, pAggInfo); |
| 117695 | if( i>=0 ){ |
| @@ -117717,10 +117739,11 @@ | |
| 117739 | } |
| 117740 | /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry |
| 117741 | */ |
| 117742 | assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); |
| 117743 | ExprSetVVAProperty(pExpr, EP_NoReduce); |
| 117744 | assert( i <= SMXV(pExpr->iAgg) ); |
| 117745 | pExpr->iAgg = (i16)i; |
| 117746 | pExpr->pAggInfo = pAggInfo; |
| 117747 | return WRC_Prune; |
| 117748 | }else{ |
| 117749 | return WRC_Continue; |
| @@ -257480,11 +257503,11 @@ | |
| 257503 | int nArg, /* Number of args */ |
| 257504 | sqlite3_value **apUnused /* Function arguments */ |
| 257505 | ){ |
| 257506 | assert( nArg==0 ); |
| 257507 | UNUSED_PARAM2(nArg, apUnused); |
| 257508 | sqlite3_result_text(pCtx, "fts5: 2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8", -1, SQLITE_TRANSIENT); |
| 257509 | } |
| 257510 | |
| 257511 | /* |
| 257512 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 257513 | ** |
| 257514 |
+30
-28
| --- extsrc/sqlite3.h | ||
| +++ extsrc/sqlite3.h | ||
| @@ -146,11 +146,11 @@ | ||
| 146 | 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | 148 | */ |
| 149 | 149 | #define SQLITE_VERSION "3.51.0" |
| 150 | 150 | #define SQLITE_VERSION_NUMBER 3051000 |
| 151 | -#define SQLITE_SOURCE_ID "2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85" | |
| 151 | +#define SQLITE_SOURCE_ID "2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8" | |
| 152 | 152 | |
| 153 | 153 | /* |
| 154 | 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | 156 | ** |
| @@ -6036,11 +6036,11 @@ | ||
| 6036 | 6036 | /* |
| 6037 | 6037 | ** CAPI3REF: Copy And Free SQL Values |
| 6038 | 6038 | ** METHOD: sqlite3_value |
| 6039 | 6039 | ** |
| 6040 | 6040 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6041 | -** object D and returns a pointer to that copy. ^The [sqlite3_value] returned | |
| 6041 | +** object V and returns a pointer to that copy. ^The [sqlite3_value] returned | |
| 6042 | 6042 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6043 | 6043 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6044 | 6044 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6045 | 6045 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6046 | 6046 | ** |
| @@ -6074,11 +6074,11 @@ | ||
| 6074 | 6074 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6075 | 6075 | ** when first called if N is less than or equal to zero or if a memory |
| 6076 | 6076 | ** allocation error occurs. |
| 6077 | 6077 | ** |
| 6078 | 6078 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6079 | -** determined by the N parameter on first successful call. Changing the | |
| 6079 | +** determined by the N parameter on the first successful call. Changing the | |
| 6080 | 6080 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6081 | 6081 | ** the same aggregate function instance will not resize the memory |
| 6082 | 6082 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6083 | 6083 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6084 | 6084 | ** pointless memory allocations occur. |
| @@ -6236,11 +6236,11 @@ | ||
| 6236 | 6236 | ** of as a secret key such that only code that knows the secret key is able |
| 6237 | 6237 | ** to access the associated data. |
| 6238 | 6238 | ** |
| 6239 | 6239 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6240 | 6240 | ** languages or in other circumstances where it might be possible for an |
| 6241 | -** an attacker to invoke them. Any agent that can invoke these interfaces | |
| 6241 | +** attacker to invoke them. Any agent that can invoke these interfaces | |
| 6242 | 6242 | ** can probably also take control of the process. |
| 6243 | 6243 | ** |
| 6244 | 6244 | ** Database connection client data is only available for SQLite |
| 6245 | 6245 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6246 | 6246 | ** |
| @@ -6350,11 +6350,11 @@ | ||
| 6350 | 6350 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6351 | 6351 | ** is non-negative, then as many bytes (not characters) of the text |
| 6352 | 6352 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6353 | 6353 | ** function result. If the 3rd parameter is non-negative, then it |
| 6354 | 6354 | ** must be the byte offset into the string where the NUL terminator would |
| 6355 | -** appear if the string where NUL terminated. If any NUL characters occur | |
| 6355 | +** appear if the string were NUL terminated. If any NUL characters occur | |
| 6356 | 6356 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6357 | 6357 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6358 | 6358 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6359 | 6359 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6360 | 6360 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6408,11 +6408,11 @@ | ||
| 6408 | 6408 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6409 | 6409 | ** when SQLite is finished with P. The T parameter should be a static |
| 6410 | 6410 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6411 | 6411 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6412 | 6412 | ** |
| 6413 | -** If these routines are called from within the different thread | |
| 6413 | +** If these routines are called from within a different thread | |
| 6414 | 6414 | ** than the one containing the application-defined function that received |
| 6415 | 6415 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6416 | 6416 | */ |
| 6417 | 6417 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6418 | 6418 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -6814,11 +6814,11 @@ | ||
| 6814 | 6814 | /* |
| 6815 | 6815 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 6816 | 6816 | ** METHOD: sqlite3 |
| 6817 | 6817 | ** |
| 6818 | 6818 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 6819 | -** for the N-th database on database connection D, or a NULL pointer of N is | |
| 6819 | +** for the N-th database on database connection D, or a NULL pointer if N is | |
| 6820 | 6820 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 6821 | 6821 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 6822 | 6822 | ** databases. |
| 6823 | 6823 | ** |
| 6824 | 6824 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -6909,20 +6909,20 @@ | ||
| 6909 | 6909 | ** |
| 6910 | 6910 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 6911 | 6911 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 6912 | 6912 | ** in a read transaction. Content has been read from the database file |
| 6913 | 6913 | ** but nothing in the database file has changed. The transaction state |
| 6914 | -** will advanced to SQLITE_TXN_WRITE if any changes occur and there are | |
| 6914 | +** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are | |
| 6915 | 6915 | ** no other conflicting concurrent write transactions. The transaction |
| 6916 | 6916 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 6917 | 6917 | ** [COMMIT].</dd> |
| 6918 | 6918 | ** |
| 6919 | 6919 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 6920 | 6920 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 6921 | 6921 | ** in a write transaction. Content has been written to the database file |
| 6922 | 6922 | ** but has not yet committed. The transaction state will change to |
| 6923 | -** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> | |
| 6923 | +** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> | |
| 6924 | 6924 | */ |
| 6925 | 6925 | #define SQLITE_TXN_NONE 0 |
| 6926 | 6926 | #define SQLITE_TXN_READ 1 |
| 6927 | 6927 | #define SQLITE_TXN_WRITE 2 |
| 6928 | 6928 | |
| @@ -7199,11 +7199,11 @@ | ||
| 7199 | 7199 | |
| 7200 | 7200 | /* |
| 7201 | 7201 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7202 | 7202 | ** |
| 7203 | 7203 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7204 | -** by all database connections within a single process. | |
| 7204 | +** used by all database connections within a single process. | |
| 7205 | 7205 | ** |
| 7206 | 7206 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7207 | 7207 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7208 | 7208 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7209 | 7209 | ** limit by reducing the number of pages held in the page cache |
| @@ -7257,11 +7257,11 @@ | ||
| 7257 | 7257 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7258 | 7258 | ** from the heap. |
| 7259 | 7259 | ** </ul>)^ |
| 7260 | 7260 | ** |
| 7261 | 7261 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7262 | -** changes in future releases of SQLite. | |
| 7262 | +** change in future releases of SQLite. | |
| 7263 | 7263 | */ |
| 7264 | 7264 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7265 | 7265 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7266 | 7266 | |
| 7267 | 7267 | /* |
| @@ -7372,12 +7372,12 @@ | ||
| 7372 | 7372 | ** be tried also. |
| 7373 | 7373 | ** |
| 7374 | 7374 | ** ^The entry point is zProc. |
| 7375 | 7375 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7376 | 7376 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7377 | -** If that does not work, it constructs a name "sqlite3_X_init" where the | |
| 7378 | -** X is consists of the lower-case equivalent of all ASCII alphabetic | |
| 7377 | +** If that does not work, it constructs a name "sqlite3_X_init" where | |
| 7378 | +** X consists of the lower-case equivalent of all ASCII alphabetic | |
| 7379 | 7379 | ** characters in the filename from the last "/" to the first following |
| 7380 | 7380 | ** "." and omitting any initial "lib".)^ |
| 7381 | 7381 | ** ^The sqlite3_load_extension() interface returns |
| 7382 | 7382 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7383 | 7383 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7608,11 +7608,11 @@ | ||
| 7608 | 7608 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7609 | 7609 | ** is true, then the constraint is assumed to be fully handled by the |
| 7610 | 7610 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7611 | 7611 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7612 | 7612 | ** is left in its default setting of false, the constraint will always be |
| 7613 | -** checked separately in byte code. If the omit flag is change to true, then | |
| 7613 | +** checked separately in byte code. If the omit flag is changed to true, then | |
| 7614 | 7614 | ** the constraint may or may not be checked in byte code. In other words, |
| 7615 | 7615 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7616 | 7616 | ** not be checked again using byte code.)^ |
| 7617 | 7617 | ** |
| 7618 | 7618 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7634,11 +7634,11 @@ | ||
| 7634 | 7634 | ** will be returned by the strategy. |
| 7635 | 7635 | ** |
| 7636 | 7636 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7637 | 7637 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7638 | 7638 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7639 | -** output to show the idxNum has hex instead of as decimal. Another flag is | |
| 7639 | +** output to show the idxNum as hex instead of as decimal. Another flag is | |
| 7640 | 7640 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7641 | 7641 | ** return at most one row. |
| 7642 | 7642 | ** |
| 7643 | 7643 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7644 | 7644 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8210,11 +8210,11 @@ | ||
| 8210 | 8210 | ** function that calls sqlite3_initialize(). |
| 8211 | 8211 | ** |
| 8212 | 8212 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8213 | 8213 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8214 | 8214 | ** routine returns NULL if it is unable to allocate the requested |
| 8215 | -** mutex. The argument to sqlite3_mutex_alloc() must one of these | |
| 8215 | +** mutex. The argument to sqlite3_mutex_alloc() must be one of these | |
| 8216 | 8216 | ** integer constants: |
| 8217 | 8217 | ** |
| 8218 | 8218 | ** <ul> |
| 8219 | 8219 | ** <li> SQLITE_MUTEX_FAST |
| 8220 | 8220 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8443,11 +8443,11 @@ | ||
| 8443 | 8443 | |
| 8444 | 8444 | /* |
| 8445 | 8445 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8446 | 8446 | ** METHOD: sqlite3 |
| 8447 | 8447 | ** |
| 8448 | -** ^This interface returns a pointer the [sqlite3_mutex] object that | |
| 8448 | +** ^This interface returns a pointer to the [sqlite3_mutex] object that | |
| 8449 | 8449 | ** serializes access to the [database connection] given in the argument |
| 8450 | 8450 | ** when the [threading mode] is Serialized. |
| 8451 | 8451 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8452 | 8452 | ** routine returns a NULL pointer. |
| 8453 | 8453 | */ |
| @@ -8566,11 +8566,11 @@ | ||
| 8566 | 8566 | |
| 8567 | 8567 | /* |
| 8568 | 8568 | ** CAPI3REF: SQL Keyword Checking |
| 8569 | 8569 | ** |
| 8570 | 8570 | ** These routines provide access to the set of SQL language keywords |
| 8571 | -** recognized by SQLite. Applications can uses these routines to determine | |
| 8571 | +** recognized by SQLite. Applications can use these routines to determine | |
| 8572 | 8572 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8573 | 8573 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8574 | 8574 | ** |
| 8575 | 8575 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8576 | 8576 | ** keywords understood by SQLite. |
| @@ -8734,11 +8734,11 @@ | ||
| 8734 | 8734 | ** |
| 8735 | 8735 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 8736 | 8736 | ** content of the dynamic string under construction in X. The value |
| 8737 | 8737 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 8738 | 8738 | ** and might be freed or altered by any subsequent method on the same |
| 8739 | -** [sqlite3_str] object. Applications must not used the pointer returned | |
| 8739 | +** [sqlite3_str] object. Applications must not use the pointer returned by | |
| 8740 | 8740 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 8741 | 8741 | ** object. ^Applications may change the content of the string returned |
| 8742 | 8742 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 8743 | 8743 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 8744 | 8744 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -8820,11 +8820,11 @@ | ||
| 8820 | 8820 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 8821 | 8821 | ** <dd>This parameter returns the number of bytes of page cache |
| 8822 | 8822 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 8823 | 8823 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 8824 | 8824 | ** returned value includes allocations that overflowed because they |
| 8825 | -** where too large (they were larger than the "sz" parameter to | |
| 8825 | +** were too large (they were larger than the "sz" parameter to | |
| 8826 | 8826 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 8827 | 8827 | ** no space was left in the page cache.</dd>)^ |
| 8828 | 8828 | ** |
| 8829 | 8829 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 8830 | 8830 | ** <dd>This parameter records the largest memory allocation request |
| @@ -8904,53 +8904,55 @@ | ||
| 8904 | 8904 | ** checked out.</dd>)^ |
| 8905 | 8905 | ** |
| 8906 | 8906 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 8907 | 8907 | ** <dd>This parameter returns the number of malloc attempts that were |
| 8908 | 8908 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 8909 | -** the current value is always zero.)^ | |
| 8909 | +** the current value is always zero.</dd>)^ | |
| 8910 | 8910 | ** |
| 8911 | 8911 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 8912 | 8912 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 8913 | -** <dd>This parameter returns the number malloc attempts that might have | |
| 8913 | +** <dd>This parameter returns the number of malloc attempts that might have | |
| 8914 | 8914 | ** been satisfied using lookaside memory but failed due to the amount of |
| 8915 | 8915 | ** memory requested being larger than the lookaside slot size. |
| 8916 | 8916 | ** Only the high-water value is meaningful; |
| 8917 | -** the current value is always zero.)^ | |
| 8917 | +** the current value is always zero.</dd>)^ | |
| 8918 | 8918 | ** |
| 8919 | 8919 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 8920 | 8920 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 8921 | -** <dd>This parameter returns the number malloc attempts that might have | |
| 8921 | +** <dd>This parameter returns the number of malloc attempts that might have | |
| 8922 | 8922 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 8923 | 8923 | ** memory already being in use. |
| 8924 | 8924 | ** Only the high-water value is meaningful; |
| 8925 | -** the current value is always zero.)^ | |
| 8925 | +** the current value is always zero.</dd>)^ | |
| 8926 | 8926 | ** |
| 8927 | 8927 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 8928 | 8928 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8929 | 8929 | ** memory used by all pager caches associated with the database connection.)^ |
| 8930 | 8930 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 8931 | +** </dd> | |
| 8931 | 8932 | ** |
| 8932 | 8933 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 8933 | 8934 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 8934 | 8935 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 8935 | 8936 | ** pager cache is shared between two or more connections the bytes of heap |
| 8936 | 8937 | ** memory used by that pager cache is divided evenly between the attached |
| 8937 | 8938 | ** connections.)^ In other words, if none of the pager caches associated |
| 8938 | 8939 | ** with the database connection are shared, this request returns the same |
| 8939 | -** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are | |
| 8940 | +** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are | |
| 8940 | 8941 | ** shared, the value returned by this call will be smaller than that returned |
| 8941 | 8942 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 8942 | -** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. | |
| 8943 | +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</dd> | |
| 8943 | 8944 | ** |
| 8944 | 8945 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 8945 | 8946 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8946 | 8947 | ** memory used to store the schema for all databases associated |
| 8947 | 8948 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 8948 | 8949 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 8949 | 8950 | ** schema memory is shared with other database connections due to |
| 8950 | 8951 | ** [shared cache mode] being enabled. |
| 8951 | 8952 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 8953 | +** </dd> | |
| 8952 | 8954 | ** |
| 8953 | 8955 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 8954 | 8956 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8955 | 8957 | ** and lookaside memory used by all prepared statements associated with |
| 8956 | 8958 | ** the database connection.)^ |
| @@ -8983,11 +8985,11 @@ | ||
| 8983 | 8985 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 8984 | 8986 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 8985 | 8987 | ** been written to disk in the middle of a transaction due to the page |
| 8986 | 8988 | ** cache overflowing. Transactions are more efficient if they are written |
| 8987 | 8989 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 8988 | -** additional overhead. This parameter can be used help identify | |
| 8990 | +** additional overhead. This parameter can be used to help identify | |
| 8989 | 8991 | ** inefficiencies that can be resolved by increasing the cache size. |
| 8990 | 8992 | ** </dd> |
| 8991 | 8993 | ** |
| 8992 | 8994 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 8993 | 8995 | ** <dd>This parameter returns zero for the current value if and only if |
| 8994 | 8996 |
| --- extsrc/sqlite3.h | |
| +++ extsrc/sqlite3.h | |
| @@ -146,11 +146,11 @@ | |
| 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | */ |
| 149 | #define SQLITE_VERSION "3.51.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3051000 |
| 151 | #define SQLITE_SOURCE_ID "2025-06-24 15:58:32 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| @@ -6036,11 +6036,11 @@ | |
| 6036 | /* |
| 6037 | ** CAPI3REF: Copy And Free SQL Values |
| 6038 | ** METHOD: sqlite3_value |
| 6039 | ** |
| 6040 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6041 | ** object D and returns a pointer to that copy. ^The [sqlite3_value] returned |
| 6042 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6043 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6044 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6045 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6046 | ** |
| @@ -6074,11 +6074,11 @@ | |
| 6074 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6075 | ** when first called if N is less than or equal to zero or if a memory |
| 6076 | ** allocation error occurs. |
| 6077 | ** |
| 6078 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6079 | ** determined by the N parameter on first successful call. Changing the |
| 6080 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6081 | ** the same aggregate function instance will not resize the memory |
| 6082 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6083 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6084 | ** pointless memory allocations occur. |
| @@ -6236,11 +6236,11 @@ | |
| 6236 | ** of as a secret key such that only code that knows the secret key is able |
| 6237 | ** to access the associated data. |
| 6238 | ** |
| 6239 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6240 | ** languages or in other circumstances where it might be possible for an |
| 6241 | ** an attacker to invoke them. Any agent that can invoke these interfaces |
| 6242 | ** can probably also take control of the process. |
| 6243 | ** |
| 6244 | ** Database connection client data is only available for SQLite |
| 6245 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6246 | ** |
| @@ -6350,11 +6350,11 @@ | |
| 6350 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6351 | ** is non-negative, then as many bytes (not characters) of the text |
| 6352 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6353 | ** function result. If the 3rd parameter is non-negative, then it |
| 6354 | ** must be the byte offset into the string where the NUL terminator would |
| 6355 | ** appear if the string where NUL terminated. If any NUL characters occur |
| 6356 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6357 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6358 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6359 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6360 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6408,11 +6408,11 @@ | |
| 6408 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6409 | ** when SQLite is finished with P. The T parameter should be a static |
| 6410 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6411 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6412 | ** |
| 6413 | ** If these routines are called from within the different thread |
| 6414 | ** than the one containing the application-defined function that received |
| 6415 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6416 | */ |
| 6417 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6418 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -6814,11 +6814,11 @@ | |
| 6814 | /* |
| 6815 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 6816 | ** METHOD: sqlite3 |
| 6817 | ** |
| 6818 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 6819 | ** for the N-th database on database connection D, or a NULL pointer of N is |
| 6820 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 6821 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 6822 | ** databases. |
| 6823 | ** |
| 6824 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -6909,20 +6909,20 @@ | |
| 6909 | ** |
| 6910 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 6911 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 6912 | ** in a read transaction. Content has been read from the database file |
| 6913 | ** but nothing in the database file has changed. The transaction state |
| 6914 | ** will advanced to SQLITE_TXN_WRITE if any changes occur and there are |
| 6915 | ** no other conflicting concurrent write transactions. The transaction |
| 6916 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 6917 | ** [COMMIT].</dd> |
| 6918 | ** |
| 6919 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 6920 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 6921 | ** in a write transaction. Content has been written to the database file |
| 6922 | ** but has not yet committed. The transaction state will change to |
| 6923 | ** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> |
| 6924 | */ |
| 6925 | #define SQLITE_TXN_NONE 0 |
| 6926 | #define SQLITE_TXN_READ 1 |
| 6927 | #define SQLITE_TXN_WRITE 2 |
| 6928 | |
| @@ -7199,11 +7199,11 @@ | |
| 7199 | |
| 7200 | /* |
| 7201 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7202 | ** |
| 7203 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7204 | ** by all database connections within a single process. |
| 7205 | ** |
| 7206 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7207 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7208 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7209 | ** limit by reducing the number of pages held in the page cache |
| @@ -7257,11 +7257,11 @@ | |
| 7257 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7258 | ** from the heap. |
| 7259 | ** </ul>)^ |
| 7260 | ** |
| 7261 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7262 | ** changes in future releases of SQLite. |
| 7263 | */ |
| 7264 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7265 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7266 | |
| 7267 | /* |
| @@ -7372,12 +7372,12 @@ | |
| 7372 | ** be tried also. |
| 7373 | ** |
| 7374 | ** ^The entry point is zProc. |
| 7375 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7376 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7377 | ** If that does not work, it constructs a name "sqlite3_X_init" where the |
| 7378 | ** X is consists of the lower-case equivalent of all ASCII alphabetic |
| 7379 | ** characters in the filename from the last "/" to the first following |
| 7380 | ** "." and omitting any initial "lib".)^ |
| 7381 | ** ^The sqlite3_load_extension() interface returns |
| 7382 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7383 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7608,11 +7608,11 @@ | |
| 7608 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7609 | ** is true, then the constraint is assumed to be fully handled by the |
| 7610 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7611 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7612 | ** is left in its default setting of false, the constraint will always be |
| 7613 | ** checked separately in byte code. If the omit flag is change to true, then |
| 7614 | ** the constraint may or may not be checked in byte code. In other words, |
| 7615 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7616 | ** not be checked again using byte code.)^ |
| 7617 | ** |
| 7618 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7634,11 +7634,11 @@ | |
| 7634 | ** will be returned by the strategy. |
| 7635 | ** |
| 7636 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7637 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7638 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7639 | ** output to show the idxNum has hex instead of as decimal. Another flag is |
| 7640 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7641 | ** return at most one row. |
| 7642 | ** |
| 7643 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7644 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8210,11 +8210,11 @@ | |
| 8210 | ** function that calls sqlite3_initialize(). |
| 8211 | ** |
| 8212 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8213 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8214 | ** routine returns NULL if it is unable to allocate the requested |
| 8215 | ** mutex. The argument to sqlite3_mutex_alloc() must one of these |
| 8216 | ** integer constants: |
| 8217 | ** |
| 8218 | ** <ul> |
| 8219 | ** <li> SQLITE_MUTEX_FAST |
| 8220 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8443,11 +8443,11 @@ | |
| 8443 | |
| 8444 | /* |
| 8445 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8446 | ** METHOD: sqlite3 |
| 8447 | ** |
| 8448 | ** ^This interface returns a pointer the [sqlite3_mutex] object that |
| 8449 | ** serializes access to the [database connection] given in the argument |
| 8450 | ** when the [threading mode] is Serialized. |
| 8451 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8452 | ** routine returns a NULL pointer. |
| 8453 | */ |
| @@ -8566,11 +8566,11 @@ | |
| 8566 | |
| 8567 | /* |
| 8568 | ** CAPI3REF: SQL Keyword Checking |
| 8569 | ** |
| 8570 | ** These routines provide access to the set of SQL language keywords |
| 8571 | ** recognized by SQLite. Applications can uses these routines to determine |
| 8572 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8573 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8574 | ** |
| 8575 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8576 | ** keywords understood by SQLite. |
| @@ -8734,11 +8734,11 @@ | |
| 8734 | ** |
| 8735 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 8736 | ** content of the dynamic string under construction in X. The value |
| 8737 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 8738 | ** and might be freed or altered by any subsequent method on the same |
| 8739 | ** [sqlite3_str] object. Applications must not used the pointer returned |
| 8740 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 8741 | ** object. ^Applications may change the content of the string returned |
| 8742 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 8743 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 8744 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -8820,11 +8820,11 @@ | |
| 8820 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 8821 | ** <dd>This parameter returns the number of bytes of page cache |
| 8822 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 8823 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 8824 | ** returned value includes allocations that overflowed because they |
| 8825 | ** where too large (they were larger than the "sz" parameter to |
| 8826 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 8827 | ** no space was left in the page cache.</dd>)^ |
| 8828 | ** |
| 8829 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 8830 | ** <dd>This parameter records the largest memory allocation request |
| @@ -8904,53 +8904,55 @@ | |
| 8904 | ** checked out.</dd>)^ |
| 8905 | ** |
| 8906 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 8907 | ** <dd>This parameter returns the number of malloc attempts that were |
| 8908 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 8909 | ** the current value is always zero.)^ |
| 8910 | ** |
| 8911 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 8912 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 8913 | ** <dd>This parameter returns the number malloc attempts that might have |
| 8914 | ** been satisfied using lookaside memory but failed due to the amount of |
| 8915 | ** memory requested being larger than the lookaside slot size. |
| 8916 | ** Only the high-water value is meaningful; |
| 8917 | ** the current value is always zero.)^ |
| 8918 | ** |
| 8919 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 8920 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 8921 | ** <dd>This parameter returns the number malloc attempts that might have |
| 8922 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 8923 | ** memory already being in use. |
| 8924 | ** Only the high-water value is meaningful; |
| 8925 | ** the current value is always zero.)^ |
| 8926 | ** |
| 8927 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 8928 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8929 | ** memory used by all pager caches associated with the database connection.)^ |
| 8930 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 8931 | ** |
| 8932 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 8933 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 8934 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 8935 | ** pager cache is shared between two or more connections the bytes of heap |
| 8936 | ** memory used by that pager cache is divided evenly between the attached |
| 8937 | ** connections.)^ In other words, if none of the pager caches associated |
| 8938 | ** with the database connection are shared, this request returns the same |
| 8939 | ** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are |
| 8940 | ** shared, the value returned by this call will be smaller than that returned |
| 8941 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 8942 | ** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. |
| 8943 | ** |
| 8944 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 8945 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8946 | ** memory used to store the schema for all databases associated |
| 8947 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 8948 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 8949 | ** schema memory is shared with other database connections due to |
| 8950 | ** [shared cache mode] being enabled. |
| 8951 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 8952 | ** |
| 8953 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 8954 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8955 | ** and lookaside memory used by all prepared statements associated with |
| 8956 | ** the database connection.)^ |
| @@ -8983,11 +8985,11 @@ | |
| 8983 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 8984 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 8985 | ** been written to disk in the middle of a transaction due to the page |
| 8986 | ** cache overflowing. Transactions are more efficient if they are written |
| 8987 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 8988 | ** additional overhead. This parameter can be used help identify |
| 8989 | ** inefficiencies that can be resolved by increasing the cache size. |
| 8990 | ** </dd> |
| 8991 | ** |
| 8992 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 8993 | ** <dd>This parameter returns zero for the current value if and only if |
| 8994 |
| --- extsrc/sqlite3.h | |
| +++ extsrc/sqlite3.h | |
| @@ -146,11 +146,11 @@ | |
| 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | */ |
| 149 | #define SQLITE_VERSION "3.51.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3051000 |
| 151 | #define SQLITE_SOURCE_ID "2025-06-27 19:02:21 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| @@ -6036,11 +6036,11 @@ | |
| 6036 | /* |
| 6037 | ** CAPI3REF: Copy And Free SQL Values |
| 6038 | ** METHOD: sqlite3_value |
| 6039 | ** |
| 6040 | ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] |
| 6041 | ** object V and returns a pointer to that copy. ^The [sqlite3_value] returned |
| 6042 | ** is a [protected sqlite3_value] object even if the input is not. |
| 6043 | ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a |
| 6044 | ** memory allocation fails. ^If V is a [pointer value], then the result |
| 6045 | ** of sqlite3_value_dup(V) is a NULL value. |
| 6046 | ** |
| @@ -6074,11 +6074,11 @@ | |
| 6074 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 6075 | ** when first called if N is less than or equal to zero or if a memory |
| 6076 | ** allocation error occurs. |
| 6077 | ** |
| 6078 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 6079 | ** determined by the N parameter on the first successful call. Changing the |
| 6080 | ** value of N in any subsequent call to sqlite3_aggregate_context() within |
| 6081 | ** the same aggregate function instance will not resize the memory |
| 6082 | ** allocation.)^ Within the xFinal callback, it is customary to set |
| 6083 | ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no |
| 6084 | ** pointless memory allocations occur. |
| @@ -6236,11 +6236,11 @@ | |
| 6236 | ** of as a secret key such that only code that knows the secret key is able |
| 6237 | ** to access the associated data. |
| 6238 | ** |
| 6239 | ** Security Warning: These interfaces should not be exposed in scripting |
| 6240 | ** languages or in other circumstances where it might be possible for an |
| 6241 | ** attacker to invoke them. Any agent that can invoke these interfaces |
| 6242 | ** can probably also take control of the process. |
| 6243 | ** |
| 6244 | ** Database connection client data is only available for SQLite |
| 6245 | ** version 3.44.0 ([dateof:3.44.0]) and later. |
| 6246 | ** |
| @@ -6350,11 +6350,11 @@ | |
| 6350 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 6351 | ** is non-negative, then as many bytes (not characters) of the text |
| 6352 | ** pointed to by the 2nd parameter are taken as the application-defined |
| 6353 | ** function result. If the 3rd parameter is non-negative, then it |
| 6354 | ** must be the byte offset into the string where the NUL terminator would |
| 6355 | ** appear if the string were NUL terminated. If any NUL characters occur |
| 6356 | ** in the string at a byte offset that is less than the value of the 3rd |
| 6357 | ** parameter, then the resulting string will contain embedded NULs and the |
| 6358 | ** result of expressions operating on strings with embedded NULs is undefined. |
| 6359 | ** ^If the 4th parameter to the sqlite3_result_text* interfaces |
| 6360 | ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that |
| @@ -6408,11 +6408,11 @@ | |
| 6408 | ** for the P parameter. ^SQLite invokes D with P as its only argument |
| 6409 | ** when SQLite is finished with P. The T parameter should be a static |
| 6410 | ** string and preferably a string literal. The sqlite3_result_pointer() |
| 6411 | ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. |
| 6412 | ** |
| 6413 | ** If these routines are called from within a different thread |
| 6414 | ** than the one containing the application-defined function that received |
| 6415 | ** the [sqlite3_context] pointer, the results are undefined. |
| 6416 | */ |
| 6417 | SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 6418 | SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| @@ -6814,11 +6814,11 @@ | |
| 6814 | /* |
| 6815 | ** CAPI3REF: Return The Schema Name For A Database Connection |
| 6816 | ** METHOD: sqlite3 |
| 6817 | ** |
| 6818 | ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 6819 | ** for the N-th database on database connection D, or a NULL pointer if N is |
| 6820 | ** out of range. An N value of 0 means the main database file. An N of 1 is |
| 6821 | ** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 6822 | ** databases. |
| 6823 | ** |
| 6824 | ** Space to hold the string that is returned by sqlite3_db_name() is managed |
| @@ -6909,20 +6909,20 @@ | |
| 6909 | ** |
| 6910 | ** [[SQLITE_TXN_READ]] <dt>SQLITE_TXN_READ</dt> |
| 6911 | ** <dd>The SQLITE_TXN_READ state means that the database is currently |
| 6912 | ** in a read transaction. Content has been read from the database file |
| 6913 | ** but nothing in the database file has changed. The transaction state |
| 6914 | ** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are |
| 6915 | ** no other conflicting concurrent write transactions. The transaction |
| 6916 | ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or |
| 6917 | ** [COMMIT].</dd> |
| 6918 | ** |
| 6919 | ** [[SQLITE_TXN_WRITE]] <dt>SQLITE_TXN_WRITE</dt> |
| 6920 | ** <dd>The SQLITE_TXN_WRITE state means that the database is currently |
| 6921 | ** in a write transaction. Content has been written to the database file |
| 6922 | ** but has not yet committed. The transaction state will change to |
| 6923 | ** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd> |
| 6924 | */ |
| 6925 | #define SQLITE_TXN_NONE 0 |
| 6926 | #define SQLITE_TXN_READ 1 |
| 6927 | #define SQLITE_TXN_WRITE 2 |
| 6928 | |
| @@ -7199,11 +7199,11 @@ | |
| 7199 | |
| 7200 | /* |
| 7201 | ** CAPI3REF: Impose A Limit On Heap Size |
| 7202 | ** |
| 7203 | ** These interfaces impose limits on the amount of heap memory that will be |
| 7204 | ** used by all database connections within a single process. |
| 7205 | ** |
| 7206 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| 7207 | ** soft limit on the amount of heap memory that may be allocated by SQLite. |
| 7208 | ** ^SQLite strives to keep heap memory utilization below the soft heap |
| 7209 | ** limit by reducing the number of pages held in the page cache |
| @@ -7257,11 +7257,11 @@ | |
| 7257 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 7258 | ** from the heap. |
| 7259 | ** </ul>)^ |
| 7260 | ** |
| 7261 | ** The circumstances under which SQLite will enforce the heap limits may |
| 7262 | ** change in future releases of SQLite. |
| 7263 | */ |
| 7264 | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 7265 | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); |
| 7266 | |
| 7267 | /* |
| @@ -7372,12 +7372,12 @@ | |
| 7372 | ** be tried also. |
| 7373 | ** |
| 7374 | ** ^The entry point is zProc. |
| 7375 | ** ^(zProc may be 0, in which case SQLite will try to come up with an |
| 7376 | ** entry point name on its own. It first tries "sqlite3_extension_init". |
| 7377 | ** If that does not work, it constructs a name "sqlite3_X_init" where |
| 7378 | ** X consists of the lower-case equivalent of all ASCII alphabetic |
| 7379 | ** characters in the filename from the last "/" to the first following |
| 7380 | ** "." and omitting any initial "lib".)^ |
| 7381 | ** ^The sqlite3_load_extension() interface returns |
| 7382 | ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. |
| 7383 | ** ^If an error occurs and pzErrMsg is not 0, then the |
| @@ -7608,11 +7608,11 @@ | |
| 7608 | ** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit |
| 7609 | ** is true, then the constraint is assumed to be fully handled by the |
| 7610 | ** virtual table and might not be checked again by the byte code.)^ ^(The |
| 7611 | ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag |
| 7612 | ** is left in its default setting of false, the constraint will always be |
| 7613 | ** checked separately in byte code. If the omit flag is changed to true, then |
| 7614 | ** the constraint may or may not be checked in byte code. In other words, |
| 7615 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7616 | ** not be checked again using byte code.)^ |
| 7617 | ** |
| 7618 | ** ^The idxNum and idxStr values are recorded and passed into the |
| @@ -7634,11 +7634,11 @@ | |
| 7634 | ** will be returned by the strategy. |
| 7635 | ** |
| 7636 | ** The xBestIndex method may optionally populate the idxFlags field with a |
| 7637 | ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is |
| 7638 | ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] |
| 7639 | ** output to show the idxNum as hex instead of as decimal. Another flag is |
| 7640 | ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will |
| 7641 | ** return at most one row. |
| 7642 | ** |
| 7643 | ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then |
| 7644 | ** SQLite also assumes that if a call to the xUpdate() method is made as |
| @@ -8210,11 +8210,11 @@ | |
| 8210 | ** function that calls sqlite3_initialize(). |
| 8211 | ** |
| 8212 | ** ^The sqlite3_mutex_alloc() routine allocates a new |
| 8213 | ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() |
| 8214 | ** routine returns NULL if it is unable to allocate the requested |
| 8215 | ** mutex. The argument to sqlite3_mutex_alloc() must be one of these |
| 8216 | ** integer constants: |
| 8217 | ** |
| 8218 | ** <ul> |
| 8219 | ** <li> SQLITE_MUTEX_FAST |
| 8220 | ** <li> SQLITE_MUTEX_RECURSIVE |
| @@ -8443,11 +8443,11 @@ | |
| 8443 | |
| 8444 | /* |
| 8445 | ** CAPI3REF: Retrieve the mutex for a database connection |
| 8446 | ** METHOD: sqlite3 |
| 8447 | ** |
| 8448 | ** ^This interface returns a pointer to the [sqlite3_mutex] object that |
| 8449 | ** serializes access to the [database connection] given in the argument |
| 8450 | ** when the [threading mode] is Serialized. |
| 8451 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 8452 | ** routine returns a NULL pointer. |
| 8453 | */ |
| @@ -8566,11 +8566,11 @@ | |
| 8566 | |
| 8567 | /* |
| 8568 | ** CAPI3REF: SQL Keyword Checking |
| 8569 | ** |
| 8570 | ** These routines provide access to the set of SQL language keywords |
| 8571 | ** recognized by SQLite. Applications can use these routines to determine |
| 8572 | ** whether or not a specific identifier needs to be escaped (for example, |
| 8573 | ** by enclosing in double-quotes) so as not to confuse the parser. |
| 8574 | ** |
| 8575 | ** The sqlite3_keyword_count() interface returns the number of distinct |
| 8576 | ** keywords understood by SQLite. |
| @@ -8734,11 +8734,11 @@ | |
| 8734 | ** |
| 8735 | ** ^The [sqlite3_str_value(X)] method returns a pointer to the current |
| 8736 | ** content of the dynamic string under construction in X. The value |
| 8737 | ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X |
| 8738 | ** and might be freed or altered by any subsequent method on the same |
| 8739 | ** [sqlite3_str] object. Applications must not use the pointer returned by |
| 8740 | ** [sqlite3_str_value(X)] after any subsequent method call on the same |
| 8741 | ** object. ^Applications may change the content of the string returned |
| 8742 | ** by [sqlite3_str_value(X)] as long as they do not write into any bytes |
| 8743 | ** outside the range of 0 to [sqlite3_str_length(X)] and do not read or |
| 8744 | ** write any byte after any subsequent sqlite3_str method call. |
| @@ -8820,11 +8820,11 @@ | |
| 8820 | ** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> |
| 8821 | ** <dd>This parameter returns the number of bytes of page cache |
| 8822 | ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] |
| 8823 | ** buffer and where forced to overflow to [sqlite3_malloc()]. The |
| 8824 | ** returned value includes allocations that overflowed because they |
| 8825 | ** were too large (they were larger than the "sz" parameter to |
| 8826 | ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because |
| 8827 | ** no space was left in the page cache.</dd>)^ |
| 8828 | ** |
| 8829 | ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> |
| 8830 | ** <dd>This parameter records the largest memory allocation request |
| @@ -8904,53 +8904,55 @@ | |
| 8904 | ** checked out.</dd>)^ |
| 8905 | ** |
| 8906 | ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt> |
| 8907 | ** <dd>This parameter returns the number of malloc attempts that were |
| 8908 | ** satisfied using lookaside memory. Only the high-water value is meaningful; |
| 8909 | ** the current value is always zero.</dd>)^ |
| 8910 | ** |
| 8911 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] |
| 8912 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt> |
| 8913 | ** <dd>This parameter returns the number of malloc attempts that might have |
| 8914 | ** been satisfied using lookaside memory but failed due to the amount of |
| 8915 | ** memory requested being larger than the lookaside slot size. |
| 8916 | ** Only the high-water value is meaningful; |
| 8917 | ** the current value is always zero.</dd>)^ |
| 8918 | ** |
| 8919 | ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] |
| 8920 | ** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt> |
| 8921 | ** <dd>This parameter returns the number of malloc attempts that might have |
| 8922 | ** been satisfied using lookaside memory but failed due to all lookaside |
| 8923 | ** memory already being in use. |
| 8924 | ** Only the high-water value is meaningful; |
| 8925 | ** the current value is always zero.</dd>)^ |
| 8926 | ** |
| 8927 | ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> |
| 8928 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8929 | ** memory used by all pager caches associated with the database connection.)^ |
| 8930 | ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. |
| 8931 | ** </dd> |
| 8932 | ** |
| 8933 | ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] |
| 8934 | ** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt> |
| 8935 | ** <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a |
| 8936 | ** pager cache is shared between two or more connections the bytes of heap |
| 8937 | ** memory used by that pager cache is divided evenly between the attached |
| 8938 | ** connections.)^ In other words, if none of the pager caches associated |
| 8939 | ** with the database connection are shared, this request returns the same |
| 8940 | ** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are |
| 8941 | ** shared, the value returned by this call will be smaller than that returned |
| 8942 | ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with |
| 8943 | ** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</dd> |
| 8944 | ** |
| 8945 | ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> |
| 8946 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8947 | ** memory used to store the schema for all databases associated |
| 8948 | ** with the connection - main, temp, and any [ATTACH]-ed databases.)^ |
| 8949 | ** ^The full amount of memory used by the schemas is reported, even if the |
| 8950 | ** schema memory is shared with other database connections due to |
| 8951 | ** [shared cache mode] being enabled. |
| 8952 | ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. |
| 8953 | ** </dd> |
| 8954 | ** |
| 8955 | ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> |
| 8956 | ** <dd>This parameter returns the approximate number of bytes of heap |
| 8957 | ** and lookaside memory used by all prepared statements associated with |
| 8958 | ** the database connection.)^ |
| @@ -8983,11 +8985,11 @@ | |
| 8985 | ** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt> |
| 8986 | ** <dd>This parameter returns the number of dirty cache entries that have |
| 8987 | ** been written to disk in the middle of a transaction due to the page |
| 8988 | ** cache overflowing. Transactions are more efficient if they are written |
| 8989 | ** to disk all at once. When pages spill mid-transaction, that introduces |
| 8990 | ** additional overhead. This parameter can be used to help identify |
| 8991 | ** inefficiencies that can be resolved by increasing the cache size. |
| 8992 | ** </dd> |
| 8993 | ** |
| 8994 | ** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt> |
| 8995 | ** <dd>This parameter returns zero for the current value if and only if |
| 8996 |