Fossil SCM

Update the built-in SQLite to the latest trunk version.

drh 2025-06-23 16:54 trunk
Commit 746a9636ab563d942fdc2a6204232e8e0f37ad6d9929172960482e63405fc41f
+6 -5
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -29456,11 +29456,12 @@
2945629456
rc = sqlite3_exec(p->db,
2945729457
"SELECT sql FROM"
2945829458
" (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x"
2945929459
" FROM sqlite_schema UNION ALL"
2946029460
" SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_schema) "
29461
- "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%' "
29461
+ "WHERE type!='meta' AND sql NOTNULL"
29462
+ " AND name NOT LIKE 'sqlite__%' ESCAPE '_' "
2946229463
"ORDER BY x",
2946329464
callback, &data, 0
2946429465
);
2946529466
if( rc==SQLITE_OK ){
2946629467
sqlite3_stmt *pStmt;
@@ -30932,11 +30933,11 @@
3093230933
}
3093330934
appendText(&sSelect, " AND ", 0);
3093430935
sqlite3_free(zQarg);
3093530936
}
3093630937
if( bNoSystemTabs ){
30937
- appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0);
30938
+ appendText(&sSelect, "name NOT LIKE 'sqlite__%%' ESCALE '_' AND ", 0);
3093830939
}
3093930940
appendText(&sSelect, "sql IS NOT NULL"
3094030941
" ORDER BY snum, rowid", 0);
3094130942
if( bDebug ){
3094230943
sqlite3_fprintf(p->out, "SQL: %s;\n", sSelect.z);
@@ -31363,11 +31364,11 @@
3136331364
" UNION ALL SELECT 'sqlite_schema'"
3136431365
" ORDER BY 1 collate nocase";
3136531366
}else{
3136631367
zSql = "SELECT lower(name) as tname FROM sqlite_schema"
3136731368
" WHERE type='table' AND coalesce(rootpage,0)>1"
31368
- " AND name NOT LIKE 'sqlite_%'"
31369
+ " AND name NOT LIKE 'sqlite__%' ESCAPE '_'"
3136931370
" ORDER BY 1 collate nocase";
3137031371
}
3137131372
sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
3137231373
initText(&sQuery);
3137331374
initText(&sSql);
@@ -31428,11 +31429,11 @@
3142831429
{
3142931430
int lrc;
3143031431
char *zRevText = /* Query for reversible to-blob-to-text check */
3143131432
"SELECT lower(name) as tname FROM sqlite_schema\n"
3143231433
"WHERE type='table' AND coalesce(rootpage,0)>1\n"
31433
- "AND name NOT LIKE 'sqlite_%%'%s\n"
31434
+ "AND name NOT LIKE 'sqlite__%%' ESCAPE '_'%s\n"
3143431435
"ORDER BY 1 collate nocase";
3143531436
zRevText = sqlite3_mprintf(zRevText, zLike? " AND name LIKE $tspec" : "");
3143631437
zRevText = sqlite3_mprintf(
3143731438
/* lower-case query is first run, producing upper-case query. */
3143831439
"with tabcols as materialized(\n"
@@ -31624,11 +31625,11 @@
3162431625
}
3162531626
appendText(&s, zDbName, '"');
3162631627
appendText(&s, ".sqlite_schema ", 0);
3162731628
if( c=='t' ){
3162831629
appendText(&s," WHERE type IN ('table','view')"
31629
- " AND name NOT LIKE 'sqlite_%'"
31630
+ " AND name NOT LIKE 'sqlite__%' ESCAPE '_'"
3163031631
" AND name LIKE ?1", 0);
3163131632
}else{
3163231633
appendText(&s," WHERE type='index'"
3163331634
" AND tbl_name LIKE ?1", 0);
3163431635
}
3163531636
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -29456,11 +29456,12 @@
29456 rc = sqlite3_exec(p->db,
29457 "SELECT sql FROM"
29458 " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x"
29459 " FROM sqlite_schema UNION ALL"
29460 " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_schema) "
29461 "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%' "
 
29462 "ORDER BY x",
29463 callback, &data, 0
29464 );
29465 if( rc==SQLITE_OK ){
29466 sqlite3_stmt *pStmt;
@@ -30932,11 +30933,11 @@
30932 }
30933 appendText(&sSelect, " AND ", 0);
30934 sqlite3_free(zQarg);
30935 }
30936 if( bNoSystemTabs ){
30937 appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0);
30938 }
30939 appendText(&sSelect, "sql IS NOT NULL"
30940 " ORDER BY snum, rowid", 0);
30941 if( bDebug ){
30942 sqlite3_fprintf(p->out, "SQL: %s;\n", sSelect.z);
@@ -31363,11 +31364,11 @@
31363 " UNION ALL SELECT 'sqlite_schema'"
31364 " ORDER BY 1 collate nocase";
31365 }else{
31366 zSql = "SELECT lower(name) as tname FROM sqlite_schema"
31367 " WHERE type='table' AND coalesce(rootpage,0)>1"
31368 " AND name NOT LIKE 'sqlite_%'"
31369 " ORDER BY 1 collate nocase";
31370 }
31371 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
31372 initText(&sQuery);
31373 initText(&sSql);
@@ -31428,11 +31429,11 @@
31428 {
31429 int lrc;
31430 char *zRevText = /* Query for reversible to-blob-to-text check */
31431 "SELECT lower(name) as tname FROM sqlite_schema\n"
31432 "WHERE type='table' AND coalesce(rootpage,0)>1\n"
31433 "AND name NOT LIKE 'sqlite_%%'%s\n"
31434 "ORDER BY 1 collate nocase";
31435 zRevText = sqlite3_mprintf(zRevText, zLike? " AND name LIKE $tspec" : "");
31436 zRevText = sqlite3_mprintf(
31437 /* lower-case query is first run, producing upper-case query. */
31438 "with tabcols as materialized(\n"
@@ -31624,11 +31625,11 @@
31624 }
31625 appendText(&s, zDbName, '"');
31626 appendText(&s, ".sqlite_schema ", 0);
31627 if( c=='t' ){
31628 appendText(&s," WHERE type IN ('table','view')"
31629 " AND name NOT LIKE 'sqlite_%'"
31630 " AND name LIKE ?1", 0);
31631 }else{
31632 appendText(&s," WHERE type='index'"
31633 " AND tbl_name LIKE ?1", 0);
31634 }
31635
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -29456,11 +29456,12 @@
29456 rc = sqlite3_exec(p->db,
29457 "SELECT sql FROM"
29458 " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x"
29459 " FROM sqlite_schema UNION ALL"
29460 " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_schema) "
29461 "WHERE type!='meta' AND sql NOTNULL"
29462 " AND name NOT LIKE 'sqlite__%' ESCAPE '_' "
29463 "ORDER BY x",
29464 callback, &data, 0
29465 );
29466 if( rc==SQLITE_OK ){
29467 sqlite3_stmt *pStmt;
@@ -30932,11 +30933,11 @@
30933 }
30934 appendText(&sSelect, " AND ", 0);
30935 sqlite3_free(zQarg);
30936 }
30937 if( bNoSystemTabs ){
30938 appendText(&sSelect, "name NOT LIKE 'sqlite__%%' ESCALE '_' AND ", 0);
30939 }
30940 appendText(&sSelect, "sql IS NOT NULL"
30941 " ORDER BY snum, rowid", 0);
30942 if( bDebug ){
30943 sqlite3_fprintf(p->out, "SQL: %s;\n", sSelect.z);
@@ -31363,11 +31364,11 @@
31364 " UNION ALL SELECT 'sqlite_schema'"
31365 " ORDER BY 1 collate nocase";
31366 }else{
31367 zSql = "SELECT lower(name) as tname FROM sqlite_schema"
31368 " WHERE type='table' AND coalesce(rootpage,0)>1"
31369 " AND name NOT LIKE 'sqlite__%' ESCAPE '_'"
31370 " ORDER BY 1 collate nocase";
31371 }
31372 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
31373 initText(&sQuery);
31374 initText(&sSql);
@@ -31428,11 +31429,11 @@
31429 {
31430 int lrc;
31431 char *zRevText = /* Query for reversible to-blob-to-text check */
31432 "SELECT lower(name) as tname FROM sqlite_schema\n"
31433 "WHERE type='table' AND coalesce(rootpage,0)>1\n"
31434 "AND name NOT LIKE 'sqlite__%%' ESCAPE '_'%s\n"
31435 "ORDER BY 1 collate nocase";
31436 zRevText = sqlite3_mprintf(zRevText, zLike? " AND name LIKE $tspec" : "");
31437 zRevText = sqlite3_mprintf(
31438 /* lower-case query is first run, producing upper-case query. */
31439 "with tabcols as materialized(\n"
@@ -31624,11 +31625,11 @@
31625 }
31626 appendText(&s, zDbName, '"');
31627 appendText(&s, ".sqlite_schema ", 0);
31628 if( c=='t' ){
31629 appendText(&s," WHERE type IN ('table','view')"
31630 " AND name NOT LIKE 'sqlite__%' ESCAPE '_'"
31631 " AND name LIKE ?1", 0);
31632 }else{
31633 appendText(&s," WHERE type='index'"
31634 " AND tbl_name LIKE ?1", 0);
31635 }
31636
+77 -45
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** a88bb75288a06492a04ab1278e8a2101a74f with changes in files:
21
+** cf61cd359e666c66b6bba4407a653c799f7f with changes in files:
2222
**
2323
**
2424
*/
2525
#ifndef SQLITE_AMALGAMATION
2626
#define SQLITE_CORE 1
@@ -465,11 +465,11 @@
465465
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
466466
** [sqlite_version()] and [sqlite_source_id()].
467467
*/
468468
#define SQLITE_VERSION "3.51.0"
469469
#define SQLITE_VERSION_NUMBER 3051000
470
-#define SQLITE_SOURCE_ID "2025-06-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d"
470
+#define SQLITE_SOURCE_ID "2025-06-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a"
471471
472472
/*
473473
** CAPI3REF: Run-Time Library Version Numbers
474474
** KEYWORDS: sqlite3_version sqlite3_sourceid
475475
**
@@ -485,13 +485,13 @@
485485
** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
486486
** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
487487
** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
488488
** </pre></blockquote>)^
489489
**
490
-** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
491
-** macro. ^The sqlite3_libversion() function returns a pointer to the
492
-** to the sqlite3_version[] string constant. The sqlite3_libversion()
490
+** ^The sqlite3_version[] string constant contains the text of the
491
+** [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a
492
+** pointer to the sqlite3_version[] string constant. The sqlite3_libversion()
493493
** function is provided for use in DLLs since DLL users usually do not have
494494
** direct access to string constants within the DLL. ^The
495495
** sqlite3_libversion_number() function returns an integer equal to
496496
** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
497497
** a pointer to a string constant whose value is the same as the
@@ -687,11 +687,11 @@
687687
** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
688688
** that allows an application to run multiple statements of SQL
689689
** without having to use a lot of C code.
690690
**
691691
** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
692
-** semicolon-separate SQL statements passed into its 2nd argument,
692
+** semicolon-separated SQL statements passed into its 2nd argument,
693693
** in the context of the [database connection] passed in as its 1st
694694
** argument. ^If the callback function of the 3rd argument to
695695
** sqlite3_exec() is not NULL, then it is invoked for each result row
696696
** coming out of the evaluated SQL statements. ^The 4th argument to
697697
** sqlite3_exec() is relayed through to the 1st argument of each
@@ -720,11 +720,11 @@
720720
** callback is an array of pointers to strings obtained as if from
721721
** [sqlite3_column_text()], one for each column. ^If an element of a
722722
** result row is NULL then the corresponding string pointer for the
723723
** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
724724
** sqlite3_exec() callback is an array of pointers to strings where each
725
-** entry represents the name of corresponding result column as obtained
725
+** entry represents the name of a corresponding result column as obtained
726726
** from [sqlite3_column_name()].
727727
**
728728
** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
729729
** to an empty string, or a pointer that contains only whitespace and/or
730730
** SQL comments, then no SQL statements are evaluated and the database
@@ -906,11 +906,11 @@
906906
** Applications should not depend on the historical behavior.
907907
**
908908
** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
909909
** [sqlite3_open_v2()] does *not* cause the underlying database file
910910
** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
911
-** [sqlite3_open_v2()] has historically be a no-op and might become an
911
+** [sqlite3_open_v2()] has historically been a no-op and might become an
912912
** error in future versions of SQLite.
913913
*/
914914
#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
915915
#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
916916
#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -1000,11 +1000,11 @@
10001000
** CAPI3REF: File Locking Levels
10011001
**
10021002
** SQLite uses one of these integer values as the second
10031003
** argument to calls it makes to the xLock() and xUnlock() methods
10041004
** of an [sqlite3_io_methods] object. These values are ordered from
1005
-** lest restrictive to most restrictive.
1005
+** least restrictive to most restrictive.
10061006
**
10071007
** The argument to xLock() is always SHARED or higher. The argument to
10081008
** xUnlock is either SHARED or NONE.
10091009
*/
10101010
#define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -1316,11 +1316,11 @@
13161316
** reason, the entire database file will be overwritten by the current
13171317
** transaction. This is used by VACUUM operations.
13181318
**
13191319
** <li>[[SQLITE_FCNTL_VFSNAME]]
13201320
** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1321
-** all [VFSes] in the VFS stack. The names are of all VFS shims and the
1321
+** all [VFSes] in the VFS stack. The names of all VFS shims and the
13221322
** final bottom-level VFS are written into memory obtained from
13231323
** [sqlite3_malloc()] and the result is stored in the char* variable
13241324
** that the fourth parameter of [sqlite3_file_control()] points to.
13251325
** The caller is responsible for freeing the memory when done. As with
13261326
** all file-control actions, there is no guarantee that this will actually
@@ -1330,11 +1330,11 @@
13301330
**
13311331
** <li>[[SQLITE_FCNTL_VFS_POINTER]]
13321332
** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
13331333
** [VFSes] currently in use. ^(The argument X in
13341334
** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1335
-** of type "[sqlite3_vfs] **". This opcodes will set *X
1335
+** of type "[sqlite3_vfs] **". This opcode will set *X
13361336
** to a pointer to the top-level VFS.)^
13371337
** ^When there are multiple VFS shims in the stack, this opcode finds the
13381338
** upper-most shim only.
13391339
**
13401340
** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1520,11 +1520,11 @@
15201520
** record the fact that the pages have been checkpointed.
15211521
**
15221522
** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
15231523
** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
15241524
** whether or not there is a database client in another process with a wal-mode
1525
-** transaction open on the database or not. It is only available on unix.The
1525
+** transaction open on the database or not. It is only available on unix. The
15261526
** (void*) argument passed with this file-control should be a pointer to a
15271527
** value of type (int). The integer value is set to 1 if the database is a wal
15281528
** mode database and there exists at least one client in another process that
15291529
** currently has an SQL transaction open on the database. It is set to 0 if
15301530
** the database is not a wal-mode db, or if there is no such connection in any
@@ -1945,11 +1945,11 @@
19451945
**
19461946
** ^The sqlite3_initialize() routine is called internally by many other
19471947
** SQLite interfaces so that an application usually does not need to
19481948
** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
19491949
** calls sqlite3_initialize() so the SQLite library will be automatically
1950
-** initialized when [sqlite3_open()] is called if it has not be initialized
1950
+** initialized when [sqlite3_open()] is called if it has not been initialized
19511951
** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
19521952
** compile-time option, then the automatic calls to sqlite3_initialize()
19531953
** are omitted and the application must call sqlite3_initialize() directly
19541954
** prior to using any other SQLite interface. For maximum portability,
19551955
** it is recommended that applications always invoke sqlite3_initialize()
@@ -2202,25 +2202,25 @@
22022202
** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
22032203
** is a pointer to an instance of the [sqlite3_mem_methods] structure.
22042204
** The [sqlite3_mem_methods]
22052205
** structure is filled with the currently defined memory allocation routines.)^
22062206
** This option can be used to overload the default memory allocation
2207
-** routines with a wrapper that simulations memory allocation failure or
2207
+** routines with a wrapper that simulates memory allocation failure or
22082208
** tracks memory usage, for example. </dd>
22092209
**
22102210
** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
2211
-** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
2211
+** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes a single argument of
22122212
** type int, interpreted as a boolean, which if true provides a hint to
22132213
** SQLite that it should avoid large memory allocations if possible.
22142214
** SQLite will run faster if it is free to make large memory allocations,
2215
-** but some application might prefer to run slower in exchange for
2215
+** but some applications might prefer to run slower in exchange for
22162216
** guarantees about memory fragmentation that are possible if large
22172217
** allocations are avoided. This hint is normally off.
22182218
** </dd>
22192219
**
22202220
** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
2221
-** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
2221
+** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes a single argument of type int,
22222222
** interpreted as a boolean, which enables or disables the collection of
22232223
** memory allocation statistics. ^(When memory allocation statistics are
22242224
** disabled, the following SQLite interfaces become non-operational:
22252225
** <ul>
22262226
** <li> [sqlite3_hard_heap_limit64()]
@@ -2261,11 +2261,11 @@
22612261
** a page cache line is larger than sz bytes or if all of the pMem buffer
22622262
** is exhausted.
22632263
** ^If pMem is NULL and N is non-zero, then each database connection
22642264
** does an initial bulk allocation for page cache memory
22652265
** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
2266
-** of -1024*N bytes if N is negative, . ^If additional
2266
+** of -1024*N bytes if N is negative. ^If additional
22672267
** page cache memory is needed beyond what is provided by the initial
22682268
** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
22692269
** additional cache line. </dd>
22702270
**
22712271
** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -2290,11 +2290,11 @@
22902290
**
22912291
** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
22922292
** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
22932293
** pointer to an instance of the [sqlite3_mutex_methods] structure.
22942294
** The argument specifies alternative low-level mutex routines to be used
2295
-** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
2295
+** in place of the mutex routines built into SQLite.)^ ^SQLite makes a copy of
22962296
** the content of the [sqlite3_mutex_methods] structure before the call to
22972297
** [sqlite3_config()] returns. ^If SQLite is compiled with
22982298
** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
22992299
** the entire mutexing subsystem is omitted from the build and hence calls to
23002300
** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2332,11 +2332,11 @@
23322332
** the interface to a custom page cache implementation.)^
23332333
** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
23342334
**
23352335
** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
23362336
** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2337
-** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
2337
+** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies off
23382338
** the current page cache implementation into that object.)^ </dd>
23392339
**
23402340
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
23412341
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
23422342
** global [error log].
@@ -2349,11 +2349,11 @@
23492349
** passed through as the first parameter to the application-defined logger
23502350
** function whenever that function is invoked. ^The second parameter to
23512351
** the logger function is a copy of the first parameter to the corresponding
23522352
** [sqlite3_log()] call and is intended to be a [result code] or an
23532353
** [extended result code]. ^The third parameter passed to the logger is
2354
-** log message after formatting via [sqlite3_snprintf()].
2354
+** a log message after formatting via [sqlite3_snprintf()].
23552355
** The SQLite logging interface is not reentrant; the logger function
23562356
** supplied by the application must not invoke any SQLite interface.
23572357
** In a multi-threaded application, the application-defined logger
23582358
** function must be threadsafe. </dd>
23592359
**
@@ -2540,11 +2540,11 @@
25402540
** CAPI3REF: Database Connection Configuration Options
25412541
**
25422542
** These constants are the available integer configuration options that
25432543
** can be passed as the second parameter to the [sqlite3_db_config()] interface.
25442544
**
2545
-** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2545
+** The [sqlite3_db_config()] interface is a var-args function. It takes a
25462546
** variable number of parameters, though always at least two. The number of
25472547
** parameters passed into sqlite3_db_config() depends on which of these
25482548
** constants is given as the second parameter. This documentation page
25492549
** refers to parameters beyond the second as "arguments". Thus, when this
25502550
** page says "the N-th argument" it means "the N-th parameter past the
@@ -2674,12 +2674,12 @@
26742674
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
26752675
** There must be two additional arguments.
26762676
** When the first argument to this interface is 1, then only the C-API is
26772677
** enabled and the SQL function remains disabled. If the first argument to
26782678
** this interface is 0, then both the C-API and the SQL function are disabled.
2679
-** If the first argument is -1, then no changes are made to state of either the
2680
-** C-API or the SQL function.
2679
+** If the first argument is -1, then no changes are made to the state of either
2680
+** the C-API or the SQL function.
26812681
** The second parameter is a pointer to an integer into which
26822682
** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
26832683
** is disabled or enabled following this call. The second parameter may
26842684
** be a NULL pointer, in which case the new setting is not reported back.
26852685
** </dd>
@@ -2793,11 +2793,11 @@
27932793
** </dd>
27942794
**
27952795
** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
27962796
** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
27972797
** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2798
-** the legacy behavior of the [ALTER TABLE RENAME] command such it
2798
+** the legacy behavior of the [ALTER TABLE RENAME] command such that it
27992799
** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
28002800
** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
28012801
** additional information. This feature can also be turned on and off
28022802
** using the [PRAGMA legacy_alter_table] statement.
28032803
** </dd>
@@ -2842,11 +2842,11 @@
28422842
**
28432843
** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
28442844
** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
28452845
** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
28462846
** the legacy file format flag. When activated, this flag causes all newly
2847
-** created database file to have a schema format version number (the 4-byte
2847
+** created database files to have a schema format version number (the 4-byte
28482848
** integer found at offset 44 into the database header) of 1. This in turn
28492849
** means that the resulting database file will be readable and writable by
28502850
** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
28512851
** newly created databases are generally not understandable by SQLite versions
28522852
** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2869,11 +2869,11 @@
28692869
** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
28702870
** statistics. For statistics to be collected, the flag must be set on
28712871
** the database handle both when the SQL statement is prepared and when it
28722872
** is stepped. The flag is set (collection of statistics is enabled)
28732873
** by default. <p>This option takes two arguments: an integer and a pointer to
2874
-** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2874
+** an integer. The first argument is 1, 0, or -1 to enable, disable, or
28752875
** leave unchanged the statement scanstatus option. If the second argument
28762876
** is not NULL, then the value of the statement scanstatus setting after
28772877
** processing the first argument is written into the integer that the second
28782878
** argument points to.
28792879
** </dd>
@@ -2912,12 +2912,12 @@
29122912
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
29132913
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
29142914
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
29152915
** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
29162916
** This capability is enabled by default. Applications can disable or
2917
-** reenable this capability using the current DBCONFIG option. If the
2918
-** the this capability is disabled, the [ATTACH] command will still work,
2917
+** reenable this capability using the current DBCONFIG option. If
2918
+** this capability is disabled, the [ATTACH] command will still work,
29192919
** but the database will be opened read-only. If this option is disabled,
29202920
** then the ability to create a new database using [ATTACH] is also disabled,
29212921
** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
29222922
** option.<p>
29232923
** This option takes two arguments which are an integer and a pointer
@@ -2947,11 +2947,11 @@
29472947
**
29482948
** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
29492949
**
29502950
** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
29512951
** overall call to [sqlite3_db_config()] has a total of four parameters.
2952
-** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2952
+** The first argument (the third parameter to sqlite3_db_config()) is an integer.
29532953
** The second argument is a pointer to an integer. If the first argument is 1,
29542954
** then the option becomes enabled. If the first integer argument is 0, then the
29552955
** option is disabled. If the first argument is -1, then the option setting
29562956
** is unchanged. The second argument, the pointer to an integer, may be NULL.
29572957
** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -3237,11 +3237,11 @@
32373237
** and comments that follow the final semicolon are ignored.
32383238
**
32393239
** ^These routines return 0 if the statement is incomplete. ^If a
32403240
** memory allocation fails, then SQLITE_NOMEM is returned.
32413241
**
3242
-** ^These routines do not parse the SQL statements thus
3242
+** ^These routines do not parse the SQL statements and thus
32433243
** will not detect syntactically incorrect SQL.
32443244
**
32453245
** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
32463246
** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
32473247
** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3354,11 +3354,11 @@
33543354
** Passing 0 to this function disables blocking locks altogether. Passing
33553355
** -1 to this function requests that the VFS blocks for a long time -
33563356
** indefinitely if possible. The results of passing any other negative value
33573357
** are undefined.
33583358
**
3359
-** Internally, each SQLite database handle store two timeout values - the
3359
+** Internally, each SQLite database handle stores two timeout values - the
33603360
** busy-timeout (used for rollback mode databases, or if the VFS does not
33613361
** support blocking locks) and the setlk-timeout (used for blocking locks
33623362
** on wal-mode databases). The sqlite3_busy_timeout() method sets both
33633363
** values, this function sets only the setlk-timeout value. Therefore,
33643364
** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3384,11 +3384,11 @@
33843384
** METHOD: sqlite3
33853385
**
33863386
** This is a legacy interface that is preserved for backwards compatibility.
33873387
** Use of this interface is not recommended.
33883388
**
3389
-** Definition: A <b>result table</b> is memory data structure created by the
3389
+** Definition: A <b>result table</b> is a memory data structure created by the
33903390
** [sqlite3_get_table()] interface. A result table records the
33913391
** complete query results from one or more queries.
33923392
**
33933393
** The table conceptually has a number of rows and columns. But
33943394
** these numbers are not part of the result table itself. These
@@ -3527,11 +3527,11 @@
35273527
** of a signed 32-bit integer.
35283528
**
35293529
** ^Calling sqlite3_free() with a pointer previously returned
35303530
** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
35313531
** that it might be reused. ^The sqlite3_free() routine is
3532
-** a no-op if is called with a NULL pointer. Passing a NULL pointer
3532
+** a no-op if it is called with a NULL pointer. Passing a NULL pointer
35333533
** to sqlite3_free() is harmless. After being freed, memory
35343534
** should neither be read nor written. Even reading previously freed
35353535
** memory might result in a segmentation fault or other severe error.
35363536
** Memory corruption, a segmentation fault, or other severe error
35373537
** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3545,17 +3545,17 @@
35453545
** ^If the N parameter to sqlite3_realloc(X,N) is zero or
35463546
** negative then the behavior is exactly the same as calling
35473547
** sqlite3_free(X).
35483548
** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
35493549
** of at least N bytes in size or NULL if insufficient memory is available.
3550
-** ^If M is the size of the prior allocation, then min(N,M) bytes
3551
-** of the prior allocation are copied into the beginning of buffer returned
3550
+** ^If M is the size of the prior allocation, then min(N,M) bytes of the
3551
+** prior allocation are copied into the beginning of the buffer returned
35523552
** by sqlite3_realloc(X,N) and the prior allocation is freed.
35533553
** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
35543554
** prior allocation is not freed.
35553555
**
3556
-** ^The sqlite3_realloc64(X,N) interfaces works the same as
3556
+** ^The sqlite3_realloc64(X,N) interface works the same as
35573557
** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
35583558
** of a 32-bit signed integer.
35593559
**
35603560
** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
35613561
** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3601,11 +3601,11 @@
36013601
** ^The [sqlite3_memory_highwater()] routine returns the maximum
36023602
** value of [sqlite3_memory_used()] since the high-water mark
36033603
** was last reset. ^The values returned by [sqlite3_memory_used()] and
36043604
** [sqlite3_memory_highwater()] include any overhead
36053605
** added by SQLite in its implementation of [sqlite3_malloc()],
3606
-** but not overhead added by the any underlying system library
3606
+** but not overhead added by any underlying system library
36073607
** routines that [sqlite3_malloc()] may call.
36083608
**
36093609
** ^The memory high-water mark is reset to the current value of
36103610
** [sqlite3_memory_used()] if and only if the parameter to
36113611
** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -4053,19 +4053,19 @@
40534053
** attempt to use the same database connection at the same time.
40544054
** (Mutexes will block any actual concurrency, but in this mode
40554055
** there is no harm in trying.)
40564056
**
40574057
** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
4058
-** <dd>The database is opened [shared cache] enabled, overriding
4058
+** <dd>The database is opened with [shared cache] enabled, overriding
40594059
** the default shared cache setting provided by
40604060
** [sqlite3_enable_shared_cache()].)^
40614061
** The [use of shared cache mode is discouraged] and hence shared cache
40624062
** capabilities may be omitted from many builds of SQLite. In such cases,
40634063
** this option is a no-op.
40644064
**
40654065
** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
4066
-** <dd>The database is opened [shared cache] disabled, overriding
4066
+** <dd>The database is opened with [shared cache] disabled, overriding
40674067
** the default shared cache setting provided by
40684068
** [sqlite3_enable_shared_cache()].)^
40694069
**
40704070
** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
40714071
** <dd>The database connection comes up in "extended result code mode".
@@ -74729,10 +74729,14 @@
7472974729
BtShared *pBt = p->pBt;
7473074730
assert( nReserve>=0 && nReserve<=255 );
7473174731
sqlite3BtreeEnter(p);
7473274732
pBt->nReserveWanted = (u8)nReserve;
7473374733
x = pBt->pageSize - pBt->usableSize;
74734
+ if( x==nReserve && (pageSize==0 || (u32)pageSize==pBt->pageSize) ){
74735
+ sqlite3BtreeLeave(p);
74736
+ return SQLITE_OK;
74737
+ }
7473474738
if( nReserve<x ) nReserve = x;
7473574739
if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
7473674740
sqlite3BtreeLeave(p);
7473774741
return SQLITE_READONLY;
7473874742
}
@@ -95229,10 +95233,40 @@
9522995233
}
9523095234
pDest->flags &= ~MEM_Ephem;
9523195235
return rc;
9523295236
}
9523395237
95238
+/*
95239
+** Send a "statement aborts" message to the error log.
95240
+*/
95241
+static SQLITE_NOINLINE void sqlite3VdbeLogAbort(
95242
+ Vdbe *p, /* The statement that is running at the time of failure */
95243
+ int rc, /* Error code */
95244
+ Op *pOp, /* Opcode that filed */
95245
+ Op *aOp /* All opcodes */
95246
+){
95247
+ const char *zSql = p->zSql; /* Original SQL text */
95248
+ const char *zPrefix = ""; /* Prefix added to SQL text */
95249
+ int pc; /* Opcode address */
95250
+ char zXtra[100]; /* Buffer space to store zPrefix */
95251
+
95252
+ if( p->pFrame ){
95253
+ assert( aOp[0].opcode==OP_Init );
95254
+ if( aOp[0].p4.z!=0 ){
95255
+ assert( aOp[0].p4.z[0]=='-'
95256
+ && aOp[0].p4.z[1]=='-'
95257
+ && aOp[0].p4.z[2]==' ' );
95258
+ sqlite3_snprintf(sizeof(zXtra), zXtra,"/* %s */ ",aOp[0].p4.z+3);
95259
+ zPrefix = zXtra;
95260
+ }else{
95261
+ zPrefix = "/* unknown trigger */ ";
95262
+ }
95263
+ }
95264
+ pc = (int)(pOp - aOp);
95265
+ sqlite3_log(rc, "statement aborts at %d: %s; [%s%s]",
95266
+ pc, p->zErrMsg, zPrefix, zSql);
95267
+}
9523495268
9523595269
/*
9523695270
** Return the symbolic name for the data type of a pMem
9523795271
*/
9523895272
static const char *vdbeMemTypeName(Mem *pMem){
@@ -95754,12 +95788,11 @@
9575495788
p->zErrMsg = sqlite3MPrintf(db, "%z: %s", p->zErrMsg, pOp->p4.z);
9575595789
}
9575695790
}else{
9575795791
sqlite3VdbeError(p, "%s", pOp->p4.z);
9575895792
}
95759
- pcx = (int)(pOp - aOp);
95760
- sqlite3_log(pOp->p1, "abort at %d: %s; [%s]", pcx, p->zErrMsg, p->zSql);
95793
+ sqlite3VdbeLogAbort(p, pOp->p1, pOp, aOp);
9576195794
}
9576295795
rc = sqlite3VdbeHalt(p);
9576395796
assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );
9576495797
if( rc==SQLITE_BUSY ){
9576595798
p->rc = SQLITE_BUSY;
@@ -103619,12 +103652,11 @@
103619103652
sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));
103620103653
}
103621103654
p->rc = rc;
103622103655
sqlite3SystemError(db, rc);
103623103656
testcase( sqlite3GlobalConfig.xLog!=0 );
103624
- sqlite3_log(rc, "statement aborts at %d: %s; [%s]",
103625
- (int)(pOp - aOp), p->zErrMsg, p->zSql);
103657
+ sqlite3VdbeLogAbort(p, rc, pOp, aOp);
103626103658
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
103627103659
if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db);
103628103660
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
103629103661
db->flags |= SQLITE_CorruptRdOnly;
103630103662
}
@@ -257401,11 +257433,11 @@
257401257433
int nArg, /* Number of args */
257402257434
sqlite3_value **apUnused /* Function arguments */
257403257435
){
257404257436
assert( nArg==0 );
257405257437
UNUSED_PARAM2(nArg, apUnused);
257406
- sqlite3_result_text(pCtx, "fts5: 2025-06-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d", -1, SQLITE_TRANSIENT);
257438
+ sqlite3_result_text(pCtx, "fts5: 2025-06-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a", -1, SQLITE_TRANSIENT);
257407257439
}
257408257440
257409257441
/*
257410257442
** Implementation of fts5_locale(LOCALE, TEXT) function.
257411257443
**
257412257444
--- 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 ** a88bb75288a06492a04ab1278e8a2101a74f 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-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d"
471
472 /*
473 ** CAPI3REF: Run-Time Library Version Numbers
474 ** KEYWORDS: sqlite3_version sqlite3_sourceid
475 **
@@ -485,13 +485,13 @@
485 ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
486 ** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
487 ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
488 ** </pre></blockquote>)^
489 **
490 ** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
491 ** macro. ^The sqlite3_libversion() function returns a pointer to the
492 ** to the sqlite3_version[] string constant. The sqlite3_libversion()
493 ** function is provided for use in DLLs since DLL users usually do not have
494 ** direct access to string constants within the DLL. ^The
495 ** sqlite3_libversion_number() function returns an integer equal to
496 ** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
497 ** a pointer to a string constant whose value is the same as the
@@ -687,11 +687,11 @@
687 ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
688 ** that allows an application to run multiple statements of SQL
689 ** without having to use a lot of C code.
690 **
691 ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
692 ** semicolon-separate SQL statements passed into its 2nd argument,
693 ** in the context of the [database connection] passed in as its 1st
694 ** argument. ^If the callback function of the 3rd argument to
695 ** sqlite3_exec() is not NULL, then it is invoked for each result row
696 ** coming out of the evaluated SQL statements. ^The 4th argument to
697 ** sqlite3_exec() is relayed through to the 1st argument of each
@@ -720,11 +720,11 @@
720 ** callback is an array of pointers to strings obtained as if from
721 ** [sqlite3_column_text()], one for each column. ^If an element of a
722 ** result row is NULL then the corresponding string pointer for the
723 ** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
724 ** sqlite3_exec() callback is an array of pointers to strings where each
725 ** entry represents the name of corresponding result column as obtained
726 ** from [sqlite3_column_name()].
727 **
728 ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
729 ** to an empty string, or a pointer that contains only whitespace and/or
730 ** SQL comments, then no SQL statements are evaluated and the database
@@ -906,11 +906,11 @@
906 ** Applications should not depend on the historical behavior.
907 **
908 ** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
909 ** [sqlite3_open_v2()] does *not* cause the underlying database file
910 ** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
911 ** [sqlite3_open_v2()] has historically be a no-op and might become an
912 ** error in future versions of SQLite.
913 */
914 #define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
915 #define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
916 #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -1000,11 +1000,11 @@
1000 ** CAPI3REF: File Locking Levels
1001 **
1002 ** SQLite uses one of these integer values as the second
1003 ** argument to calls it makes to the xLock() and xUnlock() methods
1004 ** of an [sqlite3_io_methods] object. These values are ordered from
1005 ** lest restrictive to most restrictive.
1006 **
1007 ** The argument to xLock() is always SHARED or higher. The argument to
1008 ** xUnlock is either SHARED or NONE.
1009 */
1010 #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -1316,11 +1316,11 @@
1316 ** reason, the entire database file will be overwritten by the current
1317 ** transaction. This is used by VACUUM operations.
1318 **
1319 ** <li>[[SQLITE_FCNTL_VFSNAME]]
1320 ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1321 ** all [VFSes] in the VFS stack. The names are of all VFS shims and the
1322 ** final bottom-level VFS are written into memory obtained from
1323 ** [sqlite3_malloc()] and the result is stored in the char* variable
1324 ** that the fourth parameter of [sqlite3_file_control()] points to.
1325 ** The caller is responsible for freeing the memory when done. As with
1326 ** all file-control actions, there is no guarantee that this will actually
@@ -1330,11 +1330,11 @@
1330 **
1331 ** <li>[[SQLITE_FCNTL_VFS_POINTER]]
1332 ** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
1333 ** [VFSes] currently in use. ^(The argument X in
1334 ** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1335 ** of type "[sqlite3_vfs] **". This opcodes will set *X
1336 ** to a pointer to the top-level VFS.)^
1337 ** ^When there are multiple VFS shims in the stack, this opcode finds the
1338 ** upper-most shim only.
1339 **
1340 ** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1520,11 +1520,11 @@
1520 ** record the fact that the pages have been checkpointed.
1521 **
1522 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1523 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1524 ** whether or not there is a database client in another process with a wal-mode
1525 ** transaction open on the database or not. It is only available on unix.The
1526 ** (void*) argument passed with this file-control should be a pointer to a
1527 ** value of type (int). The integer value is set to 1 if the database is a wal
1528 ** mode database and there exists at least one client in another process that
1529 ** currently has an SQL transaction open on the database. It is set to 0 if
1530 ** the database is not a wal-mode db, or if there is no such connection in any
@@ -1945,11 +1945,11 @@
1945 **
1946 ** ^The sqlite3_initialize() routine is called internally by many other
1947 ** SQLite interfaces so that an application usually does not need to
1948 ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
1949 ** calls sqlite3_initialize() so the SQLite library will be automatically
1950 ** initialized when [sqlite3_open()] is called if it has not be initialized
1951 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1952 ** compile-time option, then the automatic calls to sqlite3_initialize()
1953 ** are omitted and the application must call sqlite3_initialize() directly
1954 ** prior to using any other SQLite interface. For maximum portability,
1955 ** it is recommended that applications always invoke sqlite3_initialize()
@@ -2202,25 +2202,25 @@
2202 ** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
2203 ** is a pointer to an instance of the [sqlite3_mem_methods] structure.
2204 ** The [sqlite3_mem_methods]
2205 ** structure is filled with the currently defined memory allocation routines.)^
2206 ** This option can be used to overload the default memory allocation
2207 ** routines with a wrapper that simulations memory allocation failure or
2208 ** tracks memory usage, for example. </dd>
2209 **
2210 ** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
2211 ** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
2212 ** type int, interpreted as a boolean, which if true provides a hint to
2213 ** SQLite that it should avoid large memory allocations if possible.
2214 ** SQLite will run faster if it is free to make large memory allocations,
2215 ** but some application might prefer to run slower in exchange for
2216 ** guarantees about memory fragmentation that are possible if large
2217 ** allocations are avoided. This hint is normally off.
2218 ** </dd>
2219 **
2220 ** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
2221 ** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
2222 ** interpreted as a boolean, which enables or disables the collection of
2223 ** memory allocation statistics. ^(When memory allocation statistics are
2224 ** disabled, the following SQLite interfaces become non-operational:
2225 ** <ul>
2226 ** <li> [sqlite3_hard_heap_limit64()]
@@ -2261,11 +2261,11 @@
2261 ** a page cache line is larger than sz bytes or if all of the pMem buffer
2262 ** is exhausted.
2263 ** ^If pMem is NULL and N is non-zero, then each database connection
2264 ** does an initial bulk allocation for page cache memory
2265 ** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
2266 ** of -1024*N bytes if N is negative, . ^If additional
2267 ** page cache memory is needed beyond what is provided by the initial
2268 ** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
2269 ** additional cache line. </dd>
2270 **
2271 ** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -2290,11 +2290,11 @@
2290 **
2291 ** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
2292 ** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
2293 ** pointer to an instance of the [sqlite3_mutex_methods] structure.
2294 ** The argument specifies alternative low-level mutex routines to be used
2295 ** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
2296 ** the content of the [sqlite3_mutex_methods] structure before the call to
2297 ** [sqlite3_config()] returns. ^If SQLite is compiled with
2298 ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
2299 ** the entire mutexing subsystem is omitted from the build and hence calls to
2300 ** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2332,11 +2332,11 @@
2332 ** the interface to a custom page cache implementation.)^
2333 ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
2334 **
2335 ** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
2336 ** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2337 ** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
2338 ** the current page cache implementation into that object.)^ </dd>
2339 **
2340 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
2341 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
2342 ** global [error log].
@@ -2349,11 +2349,11 @@
2349 ** passed through as the first parameter to the application-defined logger
2350 ** function whenever that function is invoked. ^The second parameter to
2351 ** the logger function is a copy of the first parameter to the corresponding
2352 ** [sqlite3_log()] call and is intended to be a [result code] or an
2353 ** [extended result code]. ^The third parameter passed to the logger is
2354 ** log message after formatting via [sqlite3_snprintf()].
2355 ** The SQLite logging interface is not reentrant; the logger function
2356 ** supplied by the application must not invoke any SQLite interface.
2357 ** In a multi-threaded application, the application-defined logger
2358 ** function must be threadsafe. </dd>
2359 **
@@ -2540,11 +2540,11 @@
2540 ** CAPI3REF: Database Connection Configuration Options
2541 **
2542 ** These constants are the available integer configuration options that
2543 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2544 **
2545 ** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2546 ** variable number of parameters, though always at least two. The number of
2547 ** parameters passed into sqlite3_db_config() depends on which of these
2548 ** constants is given as the second parameter. This documentation page
2549 ** refers to parameters beyond the second as "arguments". Thus, when this
2550 ** page says "the N-th argument" it means "the N-th parameter past the
@@ -2674,12 +2674,12 @@
2674 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2675 ** There must be two additional arguments.
2676 ** When the first argument to this interface is 1, then only the C-API is
2677 ** enabled and the SQL function remains disabled. If the first argument to
2678 ** this interface is 0, then both the C-API and the SQL function are disabled.
2679 ** If the first argument is -1, then no changes are made to state of either the
2680 ** C-API or the SQL function.
2681 ** The second parameter is a pointer to an integer into which
2682 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
2683 ** is disabled or enabled following this call. The second parameter may
2684 ** be a NULL pointer, in which case the new setting is not reported back.
2685 ** </dd>
@@ -2793,11 +2793,11 @@
2793 ** </dd>
2794 **
2795 ** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
2796 ** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
2797 ** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2798 ** the legacy behavior of the [ALTER TABLE RENAME] command such it
2799 ** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
2800 ** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
2801 ** additional information. This feature can also be turned on and off
2802 ** using the [PRAGMA legacy_alter_table] statement.
2803 ** </dd>
@@ -2842,11 +2842,11 @@
2842 **
2843 ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
2844 ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
2845 ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
2846 ** the legacy file format flag. When activated, this flag causes all newly
2847 ** created database file to have a schema format version number (the 4-byte
2848 ** integer found at offset 44 into the database header) of 1. This in turn
2849 ** means that the resulting database file will be readable and writable by
2850 ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
2851 ** newly created databases are generally not understandable by SQLite versions
2852 ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2869,11 +2869,11 @@
2869 ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
2870 ** statistics. For statistics to be collected, the flag must be set on
2871 ** the database handle both when the SQL statement is prepared and when it
2872 ** is stepped. The flag is set (collection of statistics is enabled)
2873 ** by default. <p>This option takes two arguments: an integer and a pointer to
2874 ** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2875 ** leave unchanged the statement scanstatus option. If the second argument
2876 ** is not NULL, then the value of the statement scanstatus setting after
2877 ** processing the first argument is written into the integer that the second
2878 ** argument points to.
2879 ** </dd>
@@ -2912,12 +2912,12 @@
2912 ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
2913 ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
2914 ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
2915 ** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
2916 ** This capability is enabled by default. Applications can disable or
2917 ** reenable this capability using the current DBCONFIG option. If the
2918 ** the this capability is disabled, the [ATTACH] command will still work,
2919 ** but the database will be opened read-only. If this option is disabled,
2920 ** then the ability to create a new database using [ATTACH] is also disabled,
2921 ** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
2922 ** option.<p>
2923 ** This option takes two arguments which are an integer and a pointer
@@ -2947,11 +2947,11 @@
2947 **
2948 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2949 **
2950 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2951 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2952 ** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2953 ** The second argument is a pointer to an integer. If the first argument is 1,
2954 ** then the option becomes enabled. If the first integer argument is 0, then the
2955 ** option is disabled. If the first argument is -1, then the option setting
2956 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2957 ** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -3237,11 +3237,11 @@
3237 ** and comments that follow the final semicolon are ignored.
3238 **
3239 ** ^These routines return 0 if the statement is incomplete. ^If a
3240 ** memory allocation fails, then SQLITE_NOMEM is returned.
3241 **
3242 ** ^These routines do not parse the SQL statements thus
3243 ** will not detect syntactically incorrect SQL.
3244 **
3245 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
3246 ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
3247 ** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3354,11 +3354,11 @@
3354 ** Passing 0 to this function disables blocking locks altogether. Passing
3355 ** -1 to this function requests that the VFS blocks for a long time -
3356 ** indefinitely if possible. The results of passing any other negative value
3357 ** are undefined.
3358 **
3359 ** Internally, each SQLite database handle store two timeout values - the
3360 ** busy-timeout (used for rollback mode databases, or if the VFS does not
3361 ** support blocking locks) and the setlk-timeout (used for blocking locks
3362 ** on wal-mode databases). The sqlite3_busy_timeout() method sets both
3363 ** values, this function sets only the setlk-timeout value. Therefore,
3364 ** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3384,11 +3384,11 @@
3384 ** METHOD: sqlite3
3385 **
3386 ** This is a legacy interface that is preserved for backwards compatibility.
3387 ** Use of this interface is not recommended.
3388 **
3389 ** Definition: A <b>result table</b> is memory data structure created by the
3390 ** [sqlite3_get_table()] interface. A result table records the
3391 ** complete query results from one or more queries.
3392 **
3393 ** The table conceptually has a number of rows and columns. But
3394 ** these numbers are not part of the result table itself. These
@@ -3527,11 +3527,11 @@
3527 ** of a signed 32-bit integer.
3528 **
3529 ** ^Calling sqlite3_free() with a pointer previously returned
3530 ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
3531 ** that it might be reused. ^The sqlite3_free() routine is
3532 ** a no-op if is called with a NULL pointer. Passing a NULL pointer
3533 ** to sqlite3_free() is harmless. After being freed, memory
3534 ** should neither be read nor written. Even reading previously freed
3535 ** memory might result in a segmentation fault or other severe error.
3536 ** Memory corruption, a segmentation fault, or other severe error
3537 ** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3545,17 +3545,17 @@
3545 ** ^If the N parameter to sqlite3_realloc(X,N) is zero or
3546 ** negative then the behavior is exactly the same as calling
3547 ** sqlite3_free(X).
3548 ** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
3549 ** of at least N bytes in size or NULL if insufficient memory is available.
3550 ** ^If M is the size of the prior allocation, then min(N,M) bytes
3551 ** of the prior allocation are copied into the beginning of buffer returned
3552 ** by sqlite3_realloc(X,N) and the prior allocation is freed.
3553 ** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
3554 ** prior allocation is not freed.
3555 **
3556 ** ^The sqlite3_realloc64(X,N) interfaces works the same as
3557 ** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
3558 ** of a 32-bit signed integer.
3559 **
3560 ** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
3561 ** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3601,11 +3601,11 @@
3601 ** ^The [sqlite3_memory_highwater()] routine returns the maximum
3602 ** value of [sqlite3_memory_used()] since the high-water mark
3603 ** was last reset. ^The values returned by [sqlite3_memory_used()] and
3604 ** [sqlite3_memory_highwater()] include any overhead
3605 ** added by SQLite in its implementation of [sqlite3_malloc()],
3606 ** but not overhead added by the any underlying system library
3607 ** routines that [sqlite3_malloc()] may call.
3608 **
3609 ** ^The memory high-water mark is reset to the current value of
3610 ** [sqlite3_memory_used()] if and only if the parameter to
3611 ** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -4053,19 +4053,19 @@
4053 ** attempt to use the same database connection at the same time.
4054 ** (Mutexes will block any actual concurrency, but in this mode
4055 ** there is no harm in trying.)
4056 **
4057 ** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
4058 ** <dd>The database is opened [shared cache] enabled, overriding
4059 ** the default shared cache setting provided by
4060 ** [sqlite3_enable_shared_cache()].)^
4061 ** The [use of shared cache mode is discouraged] and hence shared cache
4062 ** capabilities may be omitted from many builds of SQLite. In such cases,
4063 ** this option is a no-op.
4064 **
4065 ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
4066 ** <dd>The database is opened [shared cache] disabled, overriding
4067 ** the default shared cache setting provided by
4068 ** [sqlite3_enable_shared_cache()].)^
4069 **
4070 ** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
4071 ** <dd>The database connection comes up in "extended result code mode".
@@ -74729,10 +74729,14 @@
74729 BtShared *pBt = p->pBt;
74730 assert( nReserve>=0 && nReserve<=255 );
74731 sqlite3BtreeEnter(p);
74732 pBt->nReserveWanted = (u8)nReserve;
74733 x = pBt->pageSize - pBt->usableSize;
 
 
 
 
74734 if( nReserve<x ) nReserve = x;
74735 if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
74736 sqlite3BtreeLeave(p);
74737 return SQLITE_READONLY;
74738 }
@@ -95229,10 +95233,40 @@
95229 }
95230 pDest->flags &= ~MEM_Ephem;
95231 return rc;
95232 }
95233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95234
95235 /*
95236 ** Return the symbolic name for the data type of a pMem
95237 */
95238 static const char *vdbeMemTypeName(Mem *pMem){
@@ -95754,12 +95788,11 @@
95754 p->zErrMsg = sqlite3MPrintf(db, "%z: %s", p->zErrMsg, pOp->p4.z);
95755 }
95756 }else{
95757 sqlite3VdbeError(p, "%s", pOp->p4.z);
95758 }
95759 pcx = (int)(pOp - aOp);
95760 sqlite3_log(pOp->p1, "abort at %d: %s; [%s]", pcx, p->zErrMsg, p->zSql);
95761 }
95762 rc = sqlite3VdbeHalt(p);
95763 assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );
95764 if( rc==SQLITE_BUSY ){
95765 p->rc = SQLITE_BUSY;
@@ -103619,12 +103652,11 @@
103619 sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));
103620 }
103621 p->rc = rc;
103622 sqlite3SystemError(db, rc);
103623 testcase( sqlite3GlobalConfig.xLog!=0 );
103624 sqlite3_log(rc, "statement aborts at %d: %s; [%s]",
103625 (int)(pOp - aOp), p->zErrMsg, p->zSql);
103626 if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
103627 if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db);
103628 if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
103629 db->flags |= SQLITE_CorruptRdOnly;
103630 }
@@ -257401,11 +257433,11 @@
257401 int nArg, /* Number of args */
257402 sqlite3_value **apUnused /* Function arguments */
257403 ){
257404 assert( nArg==0 );
257405 UNUSED_PARAM2(nArg, apUnused);
257406 sqlite3_result_text(pCtx, "fts5: 2025-06-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d", -1, SQLITE_TRANSIENT);
257407 }
257408
257409 /*
257410 ** Implementation of fts5_locale(LOCALE, TEXT) function.
257411 **
257412
--- 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 ** cf61cd359e666c66b6bba4407a653c799f7f 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-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a"
471
472 /*
473 ** CAPI3REF: Run-Time Library Version Numbers
474 ** KEYWORDS: sqlite3_version sqlite3_sourceid
475 **
@@ -485,13 +485,13 @@
485 ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
486 ** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
487 ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
488 ** </pre></blockquote>)^
489 **
490 ** ^The sqlite3_version[] string constant contains the text of the
491 ** [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a
492 ** pointer to the sqlite3_version[] string constant. The sqlite3_libversion()
493 ** function is provided for use in DLLs since DLL users usually do not have
494 ** direct access to string constants within the DLL. ^The
495 ** sqlite3_libversion_number() function returns an integer equal to
496 ** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
497 ** a pointer to a string constant whose value is the same as the
@@ -687,11 +687,11 @@
687 ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
688 ** that allows an application to run multiple statements of SQL
689 ** without having to use a lot of C code.
690 **
691 ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
692 ** semicolon-separated SQL statements passed into its 2nd argument,
693 ** in the context of the [database connection] passed in as its 1st
694 ** argument. ^If the callback function of the 3rd argument to
695 ** sqlite3_exec() is not NULL, then it is invoked for each result row
696 ** coming out of the evaluated SQL statements. ^The 4th argument to
697 ** sqlite3_exec() is relayed through to the 1st argument of each
@@ -720,11 +720,11 @@
720 ** callback is an array of pointers to strings obtained as if from
721 ** [sqlite3_column_text()], one for each column. ^If an element of a
722 ** result row is NULL then the corresponding string pointer for the
723 ** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
724 ** sqlite3_exec() callback is an array of pointers to strings where each
725 ** entry represents the name of a corresponding result column as obtained
726 ** from [sqlite3_column_name()].
727 **
728 ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
729 ** to an empty string, or a pointer that contains only whitespace and/or
730 ** SQL comments, then no SQL statements are evaluated and the database
@@ -906,11 +906,11 @@
906 ** Applications should not depend on the historical behavior.
907 **
908 ** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
909 ** [sqlite3_open_v2()] does *not* cause the underlying database file
910 ** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
911 ** [sqlite3_open_v2()] has historically been a no-op and might become an
912 ** error in future versions of SQLite.
913 */
914 #define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
915 #define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
916 #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -1000,11 +1000,11 @@
1000 ** CAPI3REF: File Locking Levels
1001 **
1002 ** SQLite uses one of these integer values as the second
1003 ** argument to calls it makes to the xLock() and xUnlock() methods
1004 ** of an [sqlite3_io_methods] object. These values are ordered from
1005 ** least restrictive to most restrictive.
1006 **
1007 ** The argument to xLock() is always SHARED or higher. The argument to
1008 ** xUnlock is either SHARED or NONE.
1009 */
1010 #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -1316,11 +1316,11 @@
1316 ** reason, the entire database file will be overwritten by the current
1317 ** transaction. This is used by VACUUM operations.
1318 **
1319 ** <li>[[SQLITE_FCNTL_VFSNAME]]
1320 ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1321 ** all [VFSes] in the VFS stack. The names of all VFS shims and the
1322 ** final bottom-level VFS are written into memory obtained from
1323 ** [sqlite3_malloc()] and the result is stored in the char* variable
1324 ** that the fourth parameter of [sqlite3_file_control()] points to.
1325 ** The caller is responsible for freeing the memory when done. As with
1326 ** all file-control actions, there is no guarantee that this will actually
@@ -1330,11 +1330,11 @@
1330 **
1331 ** <li>[[SQLITE_FCNTL_VFS_POINTER]]
1332 ** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
1333 ** [VFSes] currently in use. ^(The argument X in
1334 ** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1335 ** of type "[sqlite3_vfs] **". This opcode will set *X
1336 ** to a pointer to the top-level VFS.)^
1337 ** ^When there are multiple VFS shims in the stack, this opcode finds the
1338 ** upper-most shim only.
1339 **
1340 ** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1520,11 +1520,11 @@
1520 ** record the fact that the pages have been checkpointed.
1521 **
1522 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1523 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1524 ** whether or not there is a database client in another process with a wal-mode
1525 ** transaction open on the database or not. It is only available on unix. The
1526 ** (void*) argument passed with this file-control should be a pointer to a
1527 ** value of type (int). The integer value is set to 1 if the database is a wal
1528 ** mode database and there exists at least one client in another process that
1529 ** currently has an SQL transaction open on the database. It is set to 0 if
1530 ** the database is not a wal-mode db, or if there is no such connection in any
@@ -1945,11 +1945,11 @@
1945 **
1946 ** ^The sqlite3_initialize() routine is called internally by many other
1947 ** SQLite interfaces so that an application usually does not need to
1948 ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
1949 ** calls sqlite3_initialize() so the SQLite library will be automatically
1950 ** initialized when [sqlite3_open()] is called if it has not been initialized
1951 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1952 ** compile-time option, then the automatic calls to sqlite3_initialize()
1953 ** are omitted and the application must call sqlite3_initialize() directly
1954 ** prior to using any other SQLite interface. For maximum portability,
1955 ** it is recommended that applications always invoke sqlite3_initialize()
@@ -2202,25 +2202,25 @@
2202 ** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
2203 ** is a pointer to an instance of the [sqlite3_mem_methods] structure.
2204 ** The [sqlite3_mem_methods]
2205 ** structure is filled with the currently defined memory allocation routines.)^
2206 ** This option can be used to overload the default memory allocation
2207 ** routines with a wrapper that simulates memory allocation failure or
2208 ** tracks memory usage, for example. </dd>
2209 **
2210 ** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
2211 ** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes a single argument of
2212 ** type int, interpreted as a boolean, which if true provides a hint to
2213 ** SQLite that it should avoid large memory allocations if possible.
2214 ** SQLite will run faster if it is free to make large memory allocations,
2215 ** but some applications might prefer to run slower in exchange for
2216 ** guarantees about memory fragmentation that are possible if large
2217 ** allocations are avoided. This hint is normally off.
2218 ** </dd>
2219 **
2220 ** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
2221 ** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes a single argument of type int,
2222 ** interpreted as a boolean, which enables or disables the collection of
2223 ** memory allocation statistics. ^(When memory allocation statistics are
2224 ** disabled, the following SQLite interfaces become non-operational:
2225 ** <ul>
2226 ** <li> [sqlite3_hard_heap_limit64()]
@@ -2261,11 +2261,11 @@
2261 ** a page cache line is larger than sz bytes or if all of the pMem buffer
2262 ** is exhausted.
2263 ** ^If pMem is NULL and N is non-zero, then each database connection
2264 ** does an initial bulk allocation for page cache memory
2265 ** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
2266 ** of -1024*N bytes if N is negative. ^If additional
2267 ** page cache memory is needed beyond what is provided by the initial
2268 ** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
2269 ** additional cache line. </dd>
2270 **
2271 ** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -2290,11 +2290,11 @@
2290 **
2291 ** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
2292 ** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
2293 ** pointer to an instance of the [sqlite3_mutex_methods] structure.
2294 ** The argument specifies alternative low-level mutex routines to be used
2295 ** in place of the mutex routines built into SQLite.)^ ^SQLite makes a copy of
2296 ** the content of the [sqlite3_mutex_methods] structure before the call to
2297 ** [sqlite3_config()] returns. ^If SQLite is compiled with
2298 ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
2299 ** the entire mutexing subsystem is omitted from the build and hence calls to
2300 ** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2332,11 +2332,11 @@
2332 ** the interface to a custom page cache implementation.)^
2333 ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
2334 **
2335 ** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
2336 ** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2337 ** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies off
2338 ** the current page cache implementation into that object.)^ </dd>
2339 **
2340 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
2341 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
2342 ** global [error log].
@@ -2349,11 +2349,11 @@
2349 ** passed through as the first parameter to the application-defined logger
2350 ** function whenever that function is invoked. ^The second parameter to
2351 ** the logger function is a copy of the first parameter to the corresponding
2352 ** [sqlite3_log()] call and is intended to be a [result code] or an
2353 ** [extended result code]. ^The third parameter passed to the logger is
2354 ** a log message after formatting via [sqlite3_snprintf()].
2355 ** The SQLite logging interface is not reentrant; the logger function
2356 ** supplied by the application must not invoke any SQLite interface.
2357 ** In a multi-threaded application, the application-defined logger
2358 ** function must be threadsafe. </dd>
2359 **
@@ -2540,11 +2540,11 @@
2540 ** CAPI3REF: Database Connection Configuration Options
2541 **
2542 ** These constants are the available integer configuration options that
2543 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2544 **
2545 ** The [sqlite3_db_config()] interface is a var-args function. It takes a
2546 ** variable number of parameters, though always at least two. The number of
2547 ** parameters passed into sqlite3_db_config() depends on which of these
2548 ** constants is given as the second parameter. This documentation page
2549 ** refers to parameters beyond the second as "arguments". Thus, when this
2550 ** page says "the N-th argument" it means "the N-th parameter past the
@@ -2674,12 +2674,12 @@
2674 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2675 ** There must be two additional arguments.
2676 ** When the first argument to this interface is 1, then only the C-API is
2677 ** enabled and the SQL function remains disabled. If the first argument to
2678 ** this interface is 0, then both the C-API and the SQL function are disabled.
2679 ** If the first argument is -1, then no changes are made to the state of either
2680 ** the C-API or the SQL function.
2681 ** The second parameter is a pointer to an integer into which
2682 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
2683 ** is disabled or enabled following this call. The second parameter may
2684 ** be a NULL pointer, in which case the new setting is not reported back.
2685 ** </dd>
@@ -2793,11 +2793,11 @@
2793 ** </dd>
2794 **
2795 ** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
2796 ** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
2797 ** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2798 ** the legacy behavior of the [ALTER TABLE RENAME] command such that it
2799 ** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
2800 ** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
2801 ** additional information. This feature can also be turned on and off
2802 ** using the [PRAGMA legacy_alter_table] statement.
2803 ** </dd>
@@ -2842,11 +2842,11 @@
2842 **
2843 ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
2844 ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
2845 ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
2846 ** the legacy file format flag. When activated, this flag causes all newly
2847 ** created database files to have a schema format version number (the 4-byte
2848 ** integer found at offset 44 into the database header) of 1. This in turn
2849 ** means that the resulting database file will be readable and writable by
2850 ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
2851 ** newly created databases are generally not understandable by SQLite versions
2852 ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2869,11 +2869,11 @@
2869 ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
2870 ** statistics. For statistics to be collected, the flag must be set on
2871 ** the database handle both when the SQL statement is prepared and when it
2872 ** is stepped. The flag is set (collection of statistics is enabled)
2873 ** by default. <p>This option takes two arguments: an integer and a pointer to
2874 ** an integer. The first argument is 1, 0, or -1 to enable, disable, or
2875 ** leave unchanged the statement scanstatus option. If the second argument
2876 ** is not NULL, then the value of the statement scanstatus setting after
2877 ** processing the first argument is written into the integer that the second
2878 ** argument points to.
2879 ** </dd>
@@ -2912,12 +2912,12 @@
2912 ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
2913 ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
2914 ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
2915 ** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
2916 ** This capability is enabled by default. Applications can disable or
2917 ** reenable this capability using the current DBCONFIG option. If
2918 ** this capability is disabled, the [ATTACH] command will still work,
2919 ** but the database will be opened read-only. If this option is disabled,
2920 ** then the ability to create a new database using [ATTACH] is also disabled,
2921 ** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
2922 ** option.<p>
2923 ** This option takes two arguments which are an integer and a pointer
@@ -2947,11 +2947,11 @@
2947 **
2948 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2949 **
2950 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2951 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2952 ** The first argument (the third parameter to sqlite3_db_config()) is an integer.
2953 ** The second argument is a pointer to an integer. If the first argument is 1,
2954 ** then the option becomes enabled. If the first integer argument is 0, then the
2955 ** option is disabled. If the first argument is -1, then the option setting
2956 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2957 ** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -3237,11 +3237,11 @@
3237 ** and comments that follow the final semicolon are ignored.
3238 **
3239 ** ^These routines return 0 if the statement is incomplete. ^If a
3240 ** memory allocation fails, then SQLITE_NOMEM is returned.
3241 **
3242 ** ^These routines do not parse the SQL statements and thus
3243 ** will not detect syntactically incorrect SQL.
3244 **
3245 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
3246 ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
3247 ** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3354,11 +3354,11 @@
3354 ** Passing 0 to this function disables blocking locks altogether. Passing
3355 ** -1 to this function requests that the VFS blocks for a long time -
3356 ** indefinitely if possible. The results of passing any other negative value
3357 ** are undefined.
3358 **
3359 ** Internally, each SQLite database handle stores two timeout values - the
3360 ** busy-timeout (used for rollback mode databases, or if the VFS does not
3361 ** support blocking locks) and the setlk-timeout (used for blocking locks
3362 ** on wal-mode databases). The sqlite3_busy_timeout() method sets both
3363 ** values, this function sets only the setlk-timeout value. Therefore,
3364 ** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3384,11 +3384,11 @@
3384 ** METHOD: sqlite3
3385 **
3386 ** This is a legacy interface that is preserved for backwards compatibility.
3387 ** Use of this interface is not recommended.
3388 **
3389 ** Definition: A <b>result table</b> is a memory data structure created by the
3390 ** [sqlite3_get_table()] interface. A result table records the
3391 ** complete query results from one or more queries.
3392 **
3393 ** The table conceptually has a number of rows and columns. But
3394 ** these numbers are not part of the result table itself. These
@@ -3527,11 +3527,11 @@
3527 ** of a signed 32-bit integer.
3528 **
3529 ** ^Calling sqlite3_free() with a pointer previously returned
3530 ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
3531 ** that it might be reused. ^The sqlite3_free() routine is
3532 ** a no-op if it is called with a NULL pointer. Passing a NULL pointer
3533 ** to sqlite3_free() is harmless. After being freed, memory
3534 ** should neither be read nor written. Even reading previously freed
3535 ** memory might result in a segmentation fault or other severe error.
3536 ** Memory corruption, a segmentation fault, or other severe error
3537 ** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3545,17 +3545,17 @@
3545 ** ^If the N parameter to sqlite3_realloc(X,N) is zero or
3546 ** negative then the behavior is exactly the same as calling
3547 ** sqlite3_free(X).
3548 ** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
3549 ** of at least N bytes in size or NULL if insufficient memory is available.
3550 ** ^If M is the size of the prior allocation, then min(N,M) bytes of the
3551 ** prior allocation are copied into the beginning of the buffer returned
3552 ** by sqlite3_realloc(X,N) and the prior allocation is freed.
3553 ** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
3554 ** prior allocation is not freed.
3555 **
3556 ** ^The sqlite3_realloc64(X,N) interface works the same as
3557 ** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
3558 ** of a 32-bit signed integer.
3559 **
3560 ** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
3561 ** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3601,11 +3601,11 @@
3601 ** ^The [sqlite3_memory_highwater()] routine returns the maximum
3602 ** value of [sqlite3_memory_used()] since the high-water mark
3603 ** was last reset. ^The values returned by [sqlite3_memory_used()] and
3604 ** [sqlite3_memory_highwater()] include any overhead
3605 ** added by SQLite in its implementation of [sqlite3_malloc()],
3606 ** but not overhead added by any underlying system library
3607 ** routines that [sqlite3_malloc()] may call.
3608 **
3609 ** ^The memory high-water mark is reset to the current value of
3610 ** [sqlite3_memory_used()] if and only if the parameter to
3611 ** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -4053,19 +4053,19 @@
4053 ** attempt to use the same database connection at the same time.
4054 ** (Mutexes will block any actual concurrency, but in this mode
4055 ** there is no harm in trying.)
4056 **
4057 ** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
4058 ** <dd>The database is opened with [shared cache] enabled, overriding
4059 ** the default shared cache setting provided by
4060 ** [sqlite3_enable_shared_cache()].)^
4061 ** The [use of shared cache mode is discouraged] and hence shared cache
4062 ** capabilities may be omitted from many builds of SQLite. In such cases,
4063 ** this option is a no-op.
4064 **
4065 ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
4066 ** <dd>The database is opened with [shared cache] disabled, overriding
4067 ** the default shared cache setting provided by
4068 ** [sqlite3_enable_shared_cache()].)^
4069 **
4070 ** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
4071 ** <dd>The database connection comes up in "extended result code mode".
@@ -74729,10 +74729,14 @@
74729 BtShared *pBt = p->pBt;
74730 assert( nReserve>=0 && nReserve<=255 );
74731 sqlite3BtreeEnter(p);
74732 pBt->nReserveWanted = (u8)nReserve;
74733 x = pBt->pageSize - pBt->usableSize;
74734 if( x==nReserve && (pageSize==0 || (u32)pageSize==pBt->pageSize) ){
74735 sqlite3BtreeLeave(p);
74736 return SQLITE_OK;
74737 }
74738 if( nReserve<x ) nReserve = x;
74739 if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
74740 sqlite3BtreeLeave(p);
74741 return SQLITE_READONLY;
74742 }
@@ -95229,10 +95233,40 @@
95233 }
95234 pDest->flags &= ~MEM_Ephem;
95235 return rc;
95236 }
95237
95238 /*
95239 ** Send a "statement aborts" message to the error log.
95240 */
95241 static SQLITE_NOINLINE void sqlite3VdbeLogAbort(
95242 Vdbe *p, /* The statement that is running at the time of failure */
95243 int rc, /* Error code */
95244 Op *pOp, /* Opcode that filed */
95245 Op *aOp /* All opcodes */
95246 ){
95247 const char *zSql = p->zSql; /* Original SQL text */
95248 const char *zPrefix = ""; /* Prefix added to SQL text */
95249 int pc; /* Opcode address */
95250 char zXtra[100]; /* Buffer space to store zPrefix */
95251
95252 if( p->pFrame ){
95253 assert( aOp[0].opcode==OP_Init );
95254 if( aOp[0].p4.z!=0 ){
95255 assert( aOp[0].p4.z[0]=='-'
95256 && aOp[0].p4.z[1]=='-'
95257 && aOp[0].p4.z[2]==' ' );
95258 sqlite3_snprintf(sizeof(zXtra), zXtra,"/* %s */ ",aOp[0].p4.z+3);
95259 zPrefix = zXtra;
95260 }else{
95261 zPrefix = "/* unknown trigger */ ";
95262 }
95263 }
95264 pc = (int)(pOp - aOp);
95265 sqlite3_log(rc, "statement aborts at %d: %s; [%s%s]",
95266 pc, p->zErrMsg, zPrefix, zSql);
95267 }
95268
95269 /*
95270 ** Return the symbolic name for the data type of a pMem
95271 */
95272 static const char *vdbeMemTypeName(Mem *pMem){
@@ -95754,12 +95788,11 @@
95788 p->zErrMsg = sqlite3MPrintf(db, "%z: %s", p->zErrMsg, pOp->p4.z);
95789 }
95790 }else{
95791 sqlite3VdbeError(p, "%s", pOp->p4.z);
95792 }
95793 sqlite3VdbeLogAbort(p, pOp->p1, pOp, aOp);
 
95794 }
95795 rc = sqlite3VdbeHalt(p);
95796 assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );
95797 if( rc==SQLITE_BUSY ){
95798 p->rc = SQLITE_BUSY;
@@ -103619,12 +103652,11 @@
103652 sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));
103653 }
103654 p->rc = rc;
103655 sqlite3SystemError(db, rc);
103656 testcase( sqlite3GlobalConfig.xLog!=0 );
103657 sqlite3VdbeLogAbort(p, rc, pOp, aOp);
 
103658 if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
103659 if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db);
103660 if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
103661 db->flags |= SQLITE_CorruptRdOnly;
103662 }
@@ -257401,11 +257433,11 @@
257433 int nArg, /* Number of args */
257434 sqlite3_value **apUnused /* Function arguments */
257435 ){
257436 assert( nArg==0 );
257437 UNUSED_PARAM2(nArg, apUnused);
257438 sqlite3_result_text(pCtx, "fts5: 2025-06-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a", -1, SQLITE_TRANSIENT);
257439 }
257440
257441 /*
257442 ** Implementation of fts5_locale(LOCALE, TEXT) function.
257443 **
257444
+39 -39
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.51.0"
150150
#define SQLITE_VERSION_NUMBER 3051000
151
-#define SQLITE_SOURCE_ID "2025-06-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d"
151
+#define SQLITE_SOURCE_ID "2025-06-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
@@ -166,13 +166,13 @@
166166
** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
167167
** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
168168
** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
169169
** </pre></blockquote>)^
170170
**
171
-** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
172
-** macro. ^The sqlite3_libversion() function returns a pointer to the
173
-** to the sqlite3_version[] string constant. The sqlite3_libversion()
171
+** ^The sqlite3_version[] string constant contains the text of the
172
+** [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a
173
+** pointer to the sqlite3_version[] string constant. The sqlite3_libversion()
174174
** function is provided for use in DLLs since DLL users usually do not have
175175
** direct access to string constants within the DLL. ^The
176176
** sqlite3_libversion_number() function returns an integer equal to
177177
** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
178178
** a pointer to a string constant whose value is the same as the
@@ -368,11 +368,11 @@
368368
** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
369369
** that allows an application to run multiple statements of SQL
370370
** without having to use a lot of C code.
371371
**
372372
** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
373
-** semicolon-separate SQL statements passed into its 2nd argument,
373
+** semicolon-separated SQL statements passed into its 2nd argument,
374374
** in the context of the [database connection] passed in as its 1st
375375
** argument. ^If the callback function of the 3rd argument to
376376
** sqlite3_exec() is not NULL, then it is invoked for each result row
377377
** coming out of the evaluated SQL statements. ^The 4th argument to
378378
** sqlite3_exec() is relayed through to the 1st argument of each
@@ -401,11 +401,11 @@
401401
** callback is an array of pointers to strings obtained as if from
402402
** [sqlite3_column_text()], one for each column. ^If an element of a
403403
** result row is NULL then the corresponding string pointer for the
404404
** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
405405
** sqlite3_exec() callback is an array of pointers to strings where each
406
-** entry represents the name of corresponding result column as obtained
406
+** entry represents the name of a corresponding result column as obtained
407407
** from [sqlite3_column_name()].
408408
**
409409
** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
410410
** to an empty string, or a pointer that contains only whitespace and/or
411411
** SQL comments, then no SQL statements are evaluated and the database
@@ -587,11 +587,11 @@
587587
** Applications should not depend on the historical behavior.
588588
**
589589
** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
590590
** [sqlite3_open_v2()] does *not* cause the underlying database file
591591
** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
592
-** [sqlite3_open_v2()] has historically be a no-op and might become an
592
+** [sqlite3_open_v2()] has historically been a no-op and might become an
593593
** error in future versions of SQLite.
594594
*/
595595
#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
596596
#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
597597
#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -681,11 +681,11 @@
681681
** CAPI3REF: File Locking Levels
682682
**
683683
** SQLite uses one of these integer values as the second
684684
** argument to calls it makes to the xLock() and xUnlock() methods
685685
** of an [sqlite3_io_methods] object. These values are ordered from
686
-** lest restrictive to most restrictive.
686
+** least restrictive to most restrictive.
687687
**
688688
** The argument to xLock() is always SHARED or higher. The argument to
689689
** xUnlock is either SHARED or NONE.
690690
*/
691691
#define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -997,11 +997,11 @@
997997
** reason, the entire database file will be overwritten by the current
998998
** transaction. This is used by VACUUM operations.
999999
**
10001000
** <li>[[SQLITE_FCNTL_VFSNAME]]
10011001
** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1002
-** all [VFSes] in the VFS stack. The names are of all VFS shims and the
1002
+** all [VFSes] in the VFS stack. The names of all VFS shims and the
10031003
** final bottom-level VFS are written into memory obtained from
10041004
** [sqlite3_malloc()] and the result is stored in the char* variable
10051005
** that the fourth parameter of [sqlite3_file_control()] points to.
10061006
** The caller is responsible for freeing the memory when done. As with
10071007
** all file-control actions, there is no guarantee that this will actually
@@ -1011,11 +1011,11 @@
10111011
**
10121012
** <li>[[SQLITE_FCNTL_VFS_POINTER]]
10131013
** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
10141014
** [VFSes] currently in use. ^(The argument X in
10151015
** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1016
-** of type "[sqlite3_vfs] **". This opcodes will set *X
1016
+** of type "[sqlite3_vfs] **". This opcode will set *X
10171017
** to a pointer to the top-level VFS.)^
10181018
** ^When there are multiple VFS shims in the stack, this opcode finds the
10191019
** upper-most shim only.
10201020
**
10211021
** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1201,11 +1201,11 @@
12011201
** record the fact that the pages have been checkpointed.
12021202
**
12031203
** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
12041204
** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
12051205
** whether or not there is a database client in another process with a wal-mode
1206
-** transaction open on the database or not. It is only available on unix.The
1206
+** transaction open on the database or not. It is only available on unix. The
12071207
** (void*) argument passed with this file-control should be a pointer to a
12081208
** value of type (int). The integer value is set to 1 if the database is a wal
12091209
** mode database and there exists at least one client in another process that
12101210
** currently has an SQL transaction open on the database. It is set to 0 if
12111211
** the database is not a wal-mode db, or if there is no such connection in any
@@ -1626,11 +1626,11 @@
16261626
**
16271627
** ^The sqlite3_initialize() routine is called internally by many other
16281628
** SQLite interfaces so that an application usually does not need to
16291629
** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
16301630
** calls sqlite3_initialize() so the SQLite library will be automatically
1631
-** initialized when [sqlite3_open()] is called if it has not be initialized
1631
+** initialized when [sqlite3_open()] is called if it has not been initialized
16321632
** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
16331633
** compile-time option, then the automatic calls to sqlite3_initialize()
16341634
** are omitted and the application must call sqlite3_initialize() directly
16351635
** prior to using any other SQLite interface. For maximum portability,
16361636
** it is recommended that applications always invoke sqlite3_initialize()
@@ -1883,25 +1883,25 @@
18831883
** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
18841884
** is a pointer to an instance of the [sqlite3_mem_methods] structure.
18851885
** The [sqlite3_mem_methods]
18861886
** structure is filled with the currently defined memory allocation routines.)^
18871887
** This option can be used to overload the default memory allocation
1888
-** routines with a wrapper that simulations memory allocation failure or
1888
+** routines with a wrapper that simulates memory allocation failure or
18891889
** tracks memory usage, for example. </dd>
18901890
**
18911891
** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
1892
-** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
1892
+** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes a single argument of
18931893
** type int, interpreted as a boolean, which if true provides a hint to
18941894
** SQLite that it should avoid large memory allocations if possible.
18951895
** SQLite will run faster if it is free to make large memory allocations,
1896
-** but some application might prefer to run slower in exchange for
1896
+** but some applications might prefer to run slower in exchange for
18971897
** guarantees about memory fragmentation that are possible if large
18981898
** allocations are avoided. This hint is normally off.
18991899
** </dd>
19001900
**
19011901
** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
1902
-** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
1902
+** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes a single argument of type int,
19031903
** interpreted as a boolean, which enables or disables the collection of
19041904
** memory allocation statistics. ^(When memory allocation statistics are
19051905
** disabled, the following SQLite interfaces become non-operational:
19061906
** <ul>
19071907
** <li> [sqlite3_hard_heap_limit64()]
@@ -1942,11 +1942,11 @@
19421942
** a page cache line is larger than sz bytes or if all of the pMem buffer
19431943
** is exhausted.
19441944
** ^If pMem is NULL and N is non-zero, then each database connection
19451945
** does an initial bulk allocation for page cache memory
19461946
** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
1947
-** of -1024*N bytes if N is negative, . ^If additional
1947
+** of -1024*N bytes if N is negative. ^If additional
19481948
** page cache memory is needed beyond what is provided by the initial
19491949
** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
19501950
** additional cache line. </dd>
19511951
**
19521952
** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -1971,11 +1971,11 @@
19711971
**
19721972
** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
19731973
** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
19741974
** pointer to an instance of the [sqlite3_mutex_methods] structure.
19751975
** The argument specifies alternative low-level mutex routines to be used
1976
-** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
1976
+** in place of the mutex routines built into SQLite.)^ ^SQLite makes a copy of
19771977
** the content of the [sqlite3_mutex_methods] structure before the call to
19781978
** [sqlite3_config()] returns. ^If SQLite is compiled with
19791979
** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
19801980
** the entire mutexing subsystem is omitted from the build and hence calls to
19811981
** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2013,11 +2013,11 @@
20132013
** the interface to a custom page cache implementation.)^
20142014
** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
20152015
**
20162016
** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
20172017
** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2018
-** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
2018
+** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies off
20192019
** the current page cache implementation into that object.)^ </dd>
20202020
**
20212021
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
20222022
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
20232023
** global [error log].
@@ -2030,11 +2030,11 @@
20302030
** passed through as the first parameter to the application-defined logger
20312031
** function whenever that function is invoked. ^The second parameter to
20322032
** the logger function is a copy of the first parameter to the corresponding
20332033
** [sqlite3_log()] call and is intended to be a [result code] or an
20342034
** [extended result code]. ^The third parameter passed to the logger is
2035
-** log message after formatting via [sqlite3_snprintf()].
2035
+** a log message after formatting via [sqlite3_snprintf()].
20362036
** The SQLite logging interface is not reentrant; the logger function
20372037
** supplied by the application must not invoke any SQLite interface.
20382038
** In a multi-threaded application, the application-defined logger
20392039
** function must be threadsafe. </dd>
20402040
**
@@ -2221,11 +2221,11 @@
22212221
** CAPI3REF: Database Connection Configuration Options
22222222
**
22232223
** These constants are the available integer configuration options that
22242224
** can be passed as the second parameter to the [sqlite3_db_config()] interface.
22252225
**
2226
-** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2226
+** The [sqlite3_db_config()] interface is a var-args function. It takes a
22272227
** variable number of parameters, though always at least two. The number of
22282228
** parameters passed into sqlite3_db_config() depends on which of these
22292229
** constants is given as the second parameter. This documentation page
22302230
** refers to parameters beyond the second as "arguments". Thus, when this
22312231
** page says "the N-th argument" it means "the N-th parameter past the
@@ -2355,12 +2355,12 @@
23552355
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
23562356
** There must be two additional arguments.
23572357
** When the first argument to this interface is 1, then only the C-API is
23582358
** enabled and the SQL function remains disabled. If the first argument to
23592359
** this interface is 0, then both the C-API and the SQL function are disabled.
2360
-** If the first argument is -1, then no changes are made to state of either the
2361
-** C-API or the SQL function.
2360
+** If the first argument is -1, then no changes are made to the state of either
2361
+** the C-API or the SQL function.
23622362
** The second parameter is a pointer to an integer into which
23632363
** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
23642364
** is disabled or enabled following this call. The second parameter may
23652365
** be a NULL pointer, in which case the new setting is not reported back.
23662366
** </dd>
@@ -2474,11 +2474,11 @@
24742474
** </dd>
24752475
**
24762476
** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
24772477
** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
24782478
** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2479
-** the legacy behavior of the [ALTER TABLE RENAME] command such it
2479
+** the legacy behavior of the [ALTER TABLE RENAME] command such that it
24802480
** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
24812481
** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
24822482
** additional information. This feature can also be turned on and off
24832483
** using the [PRAGMA legacy_alter_table] statement.
24842484
** </dd>
@@ -2523,11 +2523,11 @@
25232523
**
25242524
** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
25252525
** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
25262526
** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
25272527
** the legacy file format flag. When activated, this flag causes all newly
2528
-** created database file to have a schema format version number (the 4-byte
2528
+** created database files to have a schema format version number (the 4-byte
25292529
** integer found at offset 44 into the database header) of 1. This in turn
25302530
** means that the resulting database file will be readable and writable by
25312531
** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
25322532
** newly created databases are generally not understandable by SQLite versions
25332533
** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2550,11 +2550,11 @@
25502550
** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
25512551
** statistics. For statistics to be collected, the flag must be set on
25522552
** the database handle both when the SQL statement is prepared and when it
25532553
** is stepped. The flag is set (collection of statistics is enabled)
25542554
** by default. <p>This option takes two arguments: an integer and a pointer to
2555
-** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2555
+** an integer. The first argument is 1, 0, or -1 to enable, disable, or
25562556
** leave unchanged the statement scanstatus option. If the second argument
25572557
** is not NULL, then the value of the statement scanstatus setting after
25582558
** processing the first argument is written into the integer that the second
25592559
** argument points to.
25602560
** </dd>
@@ -2593,12 +2593,12 @@
25932593
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
25942594
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
25952595
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
25962596
** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
25972597
** This capability is enabled by default. Applications can disable or
2598
-** reenable this capability using the current DBCONFIG option. If the
2599
-** the this capability is disabled, the [ATTACH] command will still work,
2598
+** reenable this capability using the current DBCONFIG option. If
2599
+** this capability is disabled, the [ATTACH] command will still work,
26002600
** but the database will be opened read-only. If this option is disabled,
26012601
** then the ability to create a new database using [ATTACH] is also disabled,
26022602
** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
26032603
** option.<p>
26042604
** This option takes two arguments which are an integer and a pointer
@@ -2628,11 +2628,11 @@
26282628
**
26292629
** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
26302630
**
26312631
** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
26322632
** overall call to [sqlite3_db_config()] has a total of four parameters.
2633
-** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2633
+** The first argument (the third parameter to sqlite3_db_config()) is an integer.
26342634
** The second argument is a pointer to an integer. If the first argument is 1,
26352635
** then the option becomes enabled. If the first integer argument is 0, then the
26362636
** option is disabled. If the first argument is -1, then the option setting
26372637
** is unchanged. The second argument, the pointer to an integer, may be NULL.
26382638
** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -2918,11 +2918,11 @@
29182918
** and comments that follow the final semicolon are ignored.
29192919
**
29202920
** ^These routines return 0 if the statement is incomplete. ^If a
29212921
** memory allocation fails, then SQLITE_NOMEM is returned.
29222922
**
2923
-** ^These routines do not parse the SQL statements thus
2923
+** ^These routines do not parse the SQL statements and thus
29242924
** will not detect syntactically incorrect SQL.
29252925
**
29262926
** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
29272927
** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
29282928
** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3035,11 +3035,11 @@
30353035
** Passing 0 to this function disables blocking locks altogether. Passing
30363036
** -1 to this function requests that the VFS blocks for a long time -
30373037
** indefinitely if possible. The results of passing any other negative value
30383038
** are undefined.
30393039
**
3040
-** Internally, each SQLite database handle store two timeout values - the
3040
+** Internally, each SQLite database handle stores two timeout values - the
30413041
** busy-timeout (used for rollback mode databases, or if the VFS does not
30423042
** support blocking locks) and the setlk-timeout (used for blocking locks
30433043
** on wal-mode databases). The sqlite3_busy_timeout() method sets both
30443044
** values, this function sets only the setlk-timeout value. Therefore,
30453045
** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3065,11 +3065,11 @@
30653065
** METHOD: sqlite3
30663066
**
30673067
** This is a legacy interface that is preserved for backwards compatibility.
30683068
** Use of this interface is not recommended.
30693069
**
3070
-** Definition: A <b>result table</b> is memory data structure created by the
3070
+** Definition: A <b>result table</b> is a memory data structure created by the
30713071
** [sqlite3_get_table()] interface. A result table records the
30723072
** complete query results from one or more queries.
30733073
**
30743074
** The table conceptually has a number of rows and columns. But
30753075
** these numbers are not part of the result table itself. These
@@ -3208,11 +3208,11 @@
32083208
** of a signed 32-bit integer.
32093209
**
32103210
** ^Calling sqlite3_free() with a pointer previously returned
32113211
** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
32123212
** that it might be reused. ^The sqlite3_free() routine is
3213
-** a no-op if is called with a NULL pointer. Passing a NULL pointer
3213
+** a no-op if it is called with a NULL pointer. Passing a NULL pointer
32143214
** to sqlite3_free() is harmless. After being freed, memory
32153215
** should neither be read nor written. Even reading previously freed
32163216
** memory might result in a segmentation fault or other severe error.
32173217
** Memory corruption, a segmentation fault, or other severe error
32183218
** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3226,17 +3226,17 @@
32263226
** ^If the N parameter to sqlite3_realloc(X,N) is zero or
32273227
** negative then the behavior is exactly the same as calling
32283228
** sqlite3_free(X).
32293229
** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
32303230
** of at least N bytes in size or NULL if insufficient memory is available.
3231
-** ^If M is the size of the prior allocation, then min(N,M) bytes
3232
-** of the prior allocation are copied into the beginning of buffer returned
3231
+** ^If M is the size of the prior allocation, then min(N,M) bytes of the
3232
+** prior allocation are copied into the beginning of the buffer returned
32333233
** by sqlite3_realloc(X,N) and the prior allocation is freed.
32343234
** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
32353235
** prior allocation is not freed.
32363236
**
3237
-** ^The sqlite3_realloc64(X,N) interfaces works the same as
3237
+** ^The sqlite3_realloc64(X,N) interface works the same as
32383238
** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
32393239
** of a 32-bit signed integer.
32403240
**
32413241
** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
32423242
** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3282,11 +3282,11 @@
32823282
** ^The [sqlite3_memory_highwater()] routine returns the maximum
32833283
** value of [sqlite3_memory_used()] since the high-water mark
32843284
** was last reset. ^The values returned by [sqlite3_memory_used()] and
32853285
** [sqlite3_memory_highwater()] include any overhead
32863286
** added by SQLite in its implementation of [sqlite3_malloc()],
3287
-** but not overhead added by the any underlying system library
3287
+** but not overhead added by any underlying system library
32883288
** routines that [sqlite3_malloc()] may call.
32893289
**
32903290
** ^The memory high-water mark is reset to the current value of
32913291
** [sqlite3_memory_used()] if and only if the parameter to
32923292
** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -3734,19 +3734,19 @@
37343734
** attempt to use the same database connection at the same time.
37353735
** (Mutexes will block any actual concurrency, but in this mode
37363736
** there is no harm in trying.)
37373737
**
37383738
** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
3739
-** <dd>The database is opened [shared cache] enabled, overriding
3739
+** <dd>The database is opened with [shared cache] enabled, overriding
37403740
** the default shared cache setting provided by
37413741
** [sqlite3_enable_shared_cache()].)^
37423742
** The [use of shared cache mode is discouraged] and hence shared cache
37433743
** capabilities may be omitted from many builds of SQLite. In such cases,
37443744
** this option is a no-op.
37453745
**
37463746
** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
3747
-** <dd>The database is opened [shared cache] disabled, overriding
3747
+** <dd>The database is opened with [shared cache] disabled, overriding
37483748
** the default shared cache setting provided by
37493749
** [sqlite3_enable_shared_cache()].)^
37503750
**
37513751
** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
37523752
** <dd>The database connection comes up in "extended result code mode".
37533753
--- 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-19 20:19:12 a88bb75288a06492a04ab1278e8a2101a74f4ba712d328b4c73e86ac01cb946d"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -166,13 +166,13 @@
166 ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
167 ** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
168 ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
169 ** </pre></blockquote>)^
170 **
171 ** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
172 ** macro. ^The sqlite3_libversion() function returns a pointer to the
173 ** to the sqlite3_version[] string constant. The sqlite3_libversion()
174 ** function is provided for use in DLLs since DLL users usually do not have
175 ** direct access to string constants within the DLL. ^The
176 ** sqlite3_libversion_number() function returns an integer equal to
177 ** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
178 ** a pointer to a string constant whose value is the same as the
@@ -368,11 +368,11 @@
368 ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
369 ** that allows an application to run multiple statements of SQL
370 ** without having to use a lot of C code.
371 **
372 ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
373 ** semicolon-separate SQL statements passed into its 2nd argument,
374 ** in the context of the [database connection] passed in as its 1st
375 ** argument. ^If the callback function of the 3rd argument to
376 ** sqlite3_exec() is not NULL, then it is invoked for each result row
377 ** coming out of the evaluated SQL statements. ^The 4th argument to
378 ** sqlite3_exec() is relayed through to the 1st argument of each
@@ -401,11 +401,11 @@
401 ** callback is an array of pointers to strings obtained as if from
402 ** [sqlite3_column_text()], one for each column. ^If an element of a
403 ** result row is NULL then the corresponding string pointer for the
404 ** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
405 ** sqlite3_exec() callback is an array of pointers to strings where each
406 ** entry represents the name of corresponding result column as obtained
407 ** from [sqlite3_column_name()].
408 **
409 ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
410 ** to an empty string, or a pointer that contains only whitespace and/or
411 ** SQL comments, then no SQL statements are evaluated and the database
@@ -587,11 +587,11 @@
587 ** Applications should not depend on the historical behavior.
588 **
589 ** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
590 ** [sqlite3_open_v2()] does *not* cause the underlying database file
591 ** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
592 ** [sqlite3_open_v2()] has historically be a no-op and might become an
593 ** error in future versions of SQLite.
594 */
595 #define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
596 #define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
597 #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -681,11 +681,11 @@
681 ** CAPI3REF: File Locking Levels
682 **
683 ** SQLite uses one of these integer values as the second
684 ** argument to calls it makes to the xLock() and xUnlock() methods
685 ** of an [sqlite3_io_methods] object. These values are ordered from
686 ** lest restrictive to most restrictive.
687 **
688 ** The argument to xLock() is always SHARED or higher. The argument to
689 ** xUnlock is either SHARED or NONE.
690 */
691 #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -997,11 +997,11 @@
997 ** reason, the entire database file will be overwritten by the current
998 ** transaction. This is used by VACUUM operations.
999 **
1000 ** <li>[[SQLITE_FCNTL_VFSNAME]]
1001 ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1002 ** all [VFSes] in the VFS stack. The names are of all VFS shims and the
1003 ** final bottom-level VFS are written into memory obtained from
1004 ** [sqlite3_malloc()] and the result is stored in the char* variable
1005 ** that the fourth parameter of [sqlite3_file_control()] points to.
1006 ** The caller is responsible for freeing the memory when done. As with
1007 ** all file-control actions, there is no guarantee that this will actually
@@ -1011,11 +1011,11 @@
1011 **
1012 ** <li>[[SQLITE_FCNTL_VFS_POINTER]]
1013 ** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
1014 ** [VFSes] currently in use. ^(The argument X in
1015 ** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1016 ** of type "[sqlite3_vfs] **". This opcodes will set *X
1017 ** to a pointer to the top-level VFS.)^
1018 ** ^When there are multiple VFS shims in the stack, this opcode finds the
1019 ** upper-most shim only.
1020 **
1021 ** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1201,11 +1201,11 @@
1201 ** record the fact that the pages have been checkpointed.
1202 **
1203 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1204 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1205 ** whether or not there is a database client in another process with a wal-mode
1206 ** transaction open on the database or not. It is only available on unix.The
1207 ** (void*) argument passed with this file-control should be a pointer to a
1208 ** value of type (int). The integer value is set to 1 if the database is a wal
1209 ** mode database and there exists at least one client in another process that
1210 ** currently has an SQL transaction open on the database. It is set to 0 if
1211 ** the database is not a wal-mode db, or if there is no such connection in any
@@ -1626,11 +1626,11 @@
1626 **
1627 ** ^The sqlite3_initialize() routine is called internally by many other
1628 ** SQLite interfaces so that an application usually does not need to
1629 ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
1630 ** calls sqlite3_initialize() so the SQLite library will be automatically
1631 ** initialized when [sqlite3_open()] is called if it has not be initialized
1632 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1633 ** compile-time option, then the automatic calls to sqlite3_initialize()
1634 ** are omitted and the application must call sqlite3_initialize() directly
1635 ** prior to using any other SQLite interface. For maximum portability,
1636 ** it is recommended that applications always invoke sqlite3_initialize()
@@ -1883,25 +1883,25 @@
1883 ** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
1884 ** is a pointer to an instance of the [sqlite3_mem_methods] structure.
1885 ** The [sqlite3_mem_methods]
1886 ** structure is filled with the currently defined memory allocation routines.)^
1887 ** This option can be used to overload the default memory allocation
1888 ** routines with a wrapper that simulations memory allocation failure or
1889 ** tracks memory usage, for example. </dd>
1890 **
1891 ** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
1892 ** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
1893 ** type int, interpreted as a boolean, which if true provides a hint to
1894 ** SQLite that it should avoid large memory allocations if possible.
1895 ** SQLite will run faster if it is free to make large memory allocations,
1896 ** but some application might prefer to run slower in exchange for
1897 ** guarantees about memory fragmentation that are possible if large
1898 ** allocations are avoided. This hint is normally off.
1899 ** </dd>
1900 **
1901 ** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
1902 ** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
1903 ** interpreted as a boolean, which enables or disables the collection of
1904 ** memory allocation statistics. ^(When memory allocation statistics are
1905 ** disabled, the following SQLite interfaces become non-operational:
1906 ** <ul>
1907 ** <li> [sqlite3_hard_heap_limit64()]
@@ -1942,11 +1942,11 @@
1942 ** a page cache line is larger than sz bytes or if all of the pMem buffer
1943 ** is exhausted.
1944 ** ^If pMem is NULL and N is non-zero, then each database connection
1945 ** does an initial bulk allocation for page cache memory
1946 ** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
1947 ** of -1024*N bytes if N is negative, . ^If additional
1948 ** page cache memory is needed beyond what is provided by the initial
1949 ** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
1950 ** additional cache line. </dd>
1951 **
1952 ** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -1971,11 +1971,11 @@
1971 **
1972 ** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
1973 ** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
1974 ** pointer to an instance of the [sqlite3_mutex_methods] structure.
1975 ** The argument specifies alternative low-level mutex routines to be used
1976 ** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
1977 ** the content of the [sqlite3_mutex_methods] structure before the call to
1978 ** [sqlite3_config()] returns. ^If SQLite is compiled with
1979 ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
1980 ** the entire mutexing subsystem is omitted from the build and hence calls to
1981 ** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2013,11 +2013,11 @@
2013 ** the interface to a custom page cache implementation.)^
2014 ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
2015 **
2016 ** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
2017 ** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2018 ** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
2019 ** the current page cache implementation into that object.)^ </dd>
2020 **
2021 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
2022 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
2023 ** global [error log].
@@ -2030,11 +2030,11 @@
2030 ** passed through as the first parameter to the application-defined logger
2031 ** function whenever that function is invoked. ^The second parameter to
2032 ** the logger function is a copy of the first parameter to the corresponding
2033 ** [sqlite3_log()] call and is intended to be a [result code] or an
2034 ** [extended result code]. ^The third parameter passed to the logger is
2035 ** log message after formatting via [sqlite3_snprintf()].
2036 ** The SQLite logging interface is not reentrant; the logger function
2037 ** supplied by the application must not invoke any SQLite interface.
2038 ** In a multi-threaded application, the application-defined logger
2039 ** function must be threadsafe. </dd>
2040 **
@@ -2221,11 +2221,11 @@
2221 ** CAPI3REF: Database Connection Configuration Options
2222 **
2223 ** These constants are the available integer configuration options that
2224 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2225 **
2226 ** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2227 ** variable number of parameters, though always at least two. The number of
2228 ** parameters passed into sqlite3_db_config() depends on which of these
2229 ** constants is given as the second parameter. This documentation page
2230 ** refers to parameters beyond the second as "arguments". Thus, when this
2231 ** page says "the N-th argument" it means "the N-th parameter past the
@@ -2355,12 +2355,12 @@
2355 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2356 ** There must be two additional arguments.
2357 ** When the first argument to this interface is 1, then only the C-API is
2358 ** enabled and the SQL function remains disabled. If the first argument to
2359 ** this interface is 0, then both the C-API and the SQL function are disabled.
2360 ** If the first argument is -1, then no changes are made to state of either the
2361 ** C-API or the SQL function.
2362 ** The second parameter is a pointer to an integer into which
2363 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
2364 ** is disabled or enabled following this call. The second parameter may
2365 ** be a NULL pointer, in which case the new setting is not reported back.
2366 ** </dd>
@@ -2474,11 +2474,11 @@
2474 ** </dd>
2475 **
2476 ** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
2477 ** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
2478 ** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2479 ** the legacy behavior of the [ALTER TABLE RENAME] command such it
2480 ** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
2481 ** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
2482 ** additional information. This feature can also be turned on and off
2483 ** using the [PRAGMA legacy_alter_table] statement.
2484 ** </dd>
@@ -2523,11 +2523,11 @@
2523 **
2524 ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
2525 ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
2526 ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
2527 ** the legacy file format flag. When activated, this flag causes all newly
2528 ** created database file to have a schema format version number (the 4-byte
2529 ** integer found at offset 44 into the database header) of 1. This in turn
2530 ** means that the resulting database file will be readable and writable by
2531 ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
2532 ** newly created databases are generally not understandable by SQLite versions
2533 ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2550,11 +2550,11 @@
2550 ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
2551 ** statistics. For statistics to be collected, the flag must be set on
2552 ** the database handle both when the SQL statement is prepared and when it
2553 ** is stepped. The flag is set (collection of statistics is enabled)
2554 ** by default. <p>This option takes two arguments: an integer and a pointer to
2555 ** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2556 ** leave unchanged the statement scanstatus option. If the second argument
2557 ** is not NULL, then the value of the statement scanstatus setting after
2558 ** processing the first argument is written into the integer that the second
2559 ** argument points to.
2560 ** </dd>
@@ -2593,12 +2593,12 @@
2593 ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
2594 ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
2595 ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
2596 ** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
2597 ** This capability is enabled by default. Applications can disable or
2598 ** reenable this capability using the current DBCONFIG option. If the
2599 ** the this capability is disabled, the [ATTACH] command will still work,
2600 ** but the database will be opened read-only. If this option is disabled,
2601 ** then the ability to create a new database using [ATTACH] is also disabled,
2602 ** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
2603 ** option.<p>
2604 ** This option takes two arguments which are an integer and a pointer
@@ -2628,11 +2628,11 @@
2628 **
2629 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2630 **
2631 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2632 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2633 ** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2634 ** The second argument is a pointer to an integer. If the first argument is 1,
2635 ** then the option becomes enabled. If the first integer argument is 0, then the
2636 ** option is disabled. If the first argument is -1, then the option setting
2637 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2638 ** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -2918,11 +2918,11 @@
2918 ** and comments that follow the final semicolon are ignored.
2919 **
2920 ** ^These routines return 0 if the statement is incomplete. ^If a
2921 ** memory allocation fails, then SQLITE_NOMEM is returned.
2922 **
2923 ** ^These routines do not parse the SQL statements thus
2924 ** will not detect syntactically incorrect SQL.
2925 **
2926 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
2927 ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
2928 ** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3035,11 +3035,11 @@
3035 ** Passing 0 to this function disables blocking locks altogether. Passing
3036 ** -1 to this function requests that the VFS blocks for a long time -
3037 ** indefinitely if possible. The results of passing any other negative value
3038 ** are undefined.
3039 **
3040 ** Internally, each SQLite database handle store two timeout values - the
3041 ** busy-timeout (used for rollback mode databases, or if the VFS does not
3042 ** support blocking locks) and the setlk-timeout (used for blocking locks
3043 ** on wal-mode databases). The sqlite3_busy_timeout() method sets both
3044 ** values, this function sets only the setlk-timeout value. Therefore,
3045 ** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3065,11 +3065,11 @@
3065 ** METHOD: sqlite3
3066 **
3067 ** This is a legacy interface that is preserved for backwards compatibility.
3068 ** Use of this interface is not recommended.
3069 **
3070 ** Definition: A <b>result table</b> is memory data structure created by the
3071 ** [sqlite3_get_table()] interface. A result table records the
3072 ** complete query results from one or more queries.
3073 **
3074 ** The table conceptually has a number of rows and columns. But
3075 ** these numbers are not part of the result table itself. These
@@ -3208,11 +3208,11 @@
3208 ** of a signed 32-bit integer.
3209 **
3210 ** ^Calling sqlite3_free() with a pointer previously returned
3211 ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
3212 ** that it might be reused. ^The sqlite3_free() routine is
3213 ** a no-op if is called with a NULL pointer. Passing a NULL pointer
3214 ** to sqlite3_free() is harmless. After being freed, memory
3215 ** should neither be read nor written. Even reading previously freed
3216 ** memory might result in a segmentation fault or other severe error.
3217 ** Memory corruption, a segmentation fault, or other severe error
3218 ** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3226,17 +3226,17 @@
3226 ** ^If the N parameter to sqlite3_realloc(X,N) is zero or
3227 ** negative then the behavior is exactly the same as calling
3228 ** sqlite3_free(X).
3229 ** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
3230 ** of at least N bytes in size or NULL if insufficient memory is available.
3231 ** ^If M is the size of the prior allocation, then min(N,M) bytes
3232 ** of the prior allocation are copied into the beginning of buffer returned
3233 ** by sqlite3_realloc(X,N) and the prior allocation is freed.
3234 ** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
3235 ** prior allocation is not freed.
3236 **
3237 ** ^The sqlite3_realloc64(X,N) interfaces works the same as
3238 ** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
3239 ** of a 32-bit signed integer.
3240 **
3241 ** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
3242 ** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3282,11 +3282,11 @@
3282 ** ^The [sqlite3_memory_highwater()] routine returns the maximum
3283 ** value of [sqlite3_memory_used()] since the high-water mark
3284 ** was last reset. ^The values returned by [sqlite3_memory_used()] and
3285 ** [sqlite3_memory_highwater()] include any overhead
3286 ** added by SQLite in its implementation of [sqlite3_malloc()],
3287 ** but not overhead added by the any underlying system library
3288 ** routines that [sqlite3_malloc()] may call.
3289 **
3290 ** ^The memory high-water mark is reset to the current value of
3291 ** [sqlite3_memory_used()] if and only if the parameter to
3292 ** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -3734,19 +3734,19 @@
3734 ** attempt to use the same database connection at the same time.
3735 ** (Mutexes will block any actual concurrency, but in this mode
3736 ** there is no harm in trying.)
3737 **
3738 ** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
3739 ** <dd>The database is opened [shared cache] enabled, overriding
3740 ** the default shared cache setting provided by
3741 ** [sqlite3_enable_shared_cache()].)^
3742 ** The [use of shared cache mode is discouraged] and hence shared cache
3743 ** capabilities may be omitted from many builds of SQLite. In such cases,
3744 ** this option is a no-op.
3745 **
3746 ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
3747 ** <dd>The database is opened [shared cache] disabled, overriding
3748 ** the default shared cache setting provided by
3749 ** [sqlite3_enable_shared_cache()].)^
3750 **
3751 ** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
3752 ** <dd>The database connection comes up in "extended result code mode".
3753
--- 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-23 16:51:33 cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -166,13 +166,13 @@
166 ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
167 ** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
168 ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
169 ** </pre></blockquote>)^
170 **
171 ** ^The sqlite3_version[] string constant contains the text of the
172 ** [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a
173 ** pointer to the sqlite3_version[] string constant. The sqlite3_libversion()
174 ** function is provided for use in DLLs since DLL users usually do not have
175 ** direct access to string constants within the DLL. ^The
176 ** sqlite3_libversion_number() function returns an integer equal to
177 ** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
178 ** a pointer to a string constant whose value is the same as the
@@ -368,11 +368,11 @@
368 ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
369 ** that allows an application to run multiple statements of SQL
370 ** without having to use a lot of C code.
371 **
372 ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
373 ** semicolon-separated SQL statements passed into its 2nd argument,
374 ** in the context of the [database connection] passed in as its 1st
375 ** argument. ^If the callback function of the 3rd argument to
376 ** sqlite3_exec() is not NULL, then it is invoked for each result row
377 ** coming out of the evaluated SQL statements. ^The 4th argument to
378 ** sqlite3_exec() is relayed through to the 1st argument of each
@@ -401,11 +401,11 @@
401 ** callback is an array of pointers to strings obtained as if from
402 ** [sqlite3_column_text()], one for each column. ^If an element of a
403 ** result row is NULL then the corresponding string pointer for the
404 ** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
405 ** sqlite3_exec() callback is an array of pointers to strings where each
406 ** entry represents the name of a corresponding result column as obtained
407 ** from [sqlite3_column_name()].
408 **
409 ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
410 ** to an empty string, or a pointer that contains only whitespace and/or
411 ** SQL comments, then no SQL statements are evaluated and the database
@@ -587,11 +587,11 @@
587 ** Applications should not depend on the historical behavior.
588 **
589 ** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
590 ** [sqlite3_open_v2()] does *not* cause the underlying database file
591 ** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
592 ** [sqlite3_open_v2()] has historically been a no-op and might become an
593 ** error in future versions of SQLite.
594 */
595 #define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
596 #define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
597 #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
@@ -681,11 +681,11 @@
681 ** CAPI3REF: File Locking Levels
682 **
683 ** SQLite uses one of these integer values as the second
684 ** argument to calls it makes to the xLock() and xUnlock() methods
685 ** of an [sqlite3_io_methods] object. These values are ordered from
686 ** least restrictive to most restrictive.
687 **
688 ** The argument to xLock() is always SHARED or higher. The argument to
689 ** xUnlock is either SHARED or NONE.
690 */
691 #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
@@ -997,11 +997,11 @@
997 ** reason, the entire database file will be overwritten by the current
998 ** transaction. This is used by VACUUM operations.
999 **
1000 ** <li>[[SQLITE_FCNTL_VFSNAME]]
1001 ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
1002 ** all [VFSes] in the VFS stack. The names of all VFS shims and the
1003 ** final bottom-level VFS are written into memory obtained from
1004 ** [sqlite3_malloc()] and the result is stored in the char* variable
1005 ** that the fourth parameter of [sqlite3_file_control()] points to.
1006 ** The caller is responsible for freeing the memory when done. As with
1007 ** all file-control actions, there is no guarantee that this will actually
@@ -1011,11 +1011,11 @@
1011 **
1012 ** <li>[[SQLITE_FCNTL_VFS_POINTER]]
1013 ** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
1014 ** [VFSes] currently in use. ^(The argument X in
1015 ** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
1016 ** of type "[sqlite3_vfs] **". This opcode will set *X
1017 ** to a pointer to the top-level VFS.)^
1018 ** ^When there are multiple VFS shims in the stack, this opcode finds the
1019 ** upper-most shim only.
1020 **
1021 ** <li>[[SQLITE_FCNTL_PRAGMA]]
@@ -1201,11 +1201,11 @@
1201 ** record the fact that the pages have been checkpointed.
1202 **
1203 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1204 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1205 ** whether or not there is a database client in another process with a wal-mode
1206 ** transaction open on the database or not. It is only available on unix. The
1207 ** (void*) argument passed with this file-control should be a pointer to a
1208 ** value of type (int). The integer value is set to 1 if the database is a wal
1209 ** mode database and there exists at least one client in another process that
1210 ** currently has an SQL transaction open on the database. It is set to 0 if
1211 ** the database is not a wal-mode db, or if there is no such connection in any
@@ -1626,11 +1626,11 @@
1626 **
1627 ** ^The sqlite3_initialize() routine is called internally by many other
1628 ** SQLite interfaces so that an application usually does not need to
1629 ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
1630 ** calls sqlite3_initialize() so the SQLite library will be automatically
1631 ** initialized when [sqlite3_open()] is called if it has not been initialized
1632 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1633 ** compile-time option, then the automatic calls to sqlite3_initialize()
1634 ** are omitted and the application must call sqlite3_initialize() directly
1635 ** prior to using any other SQLite interface. For maximum portability,
1636 ** it is recommended that applications always invoke sqlite3_initialize()
@@ -1883,25 +1883,25 @@
1883 ** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
1884 ** is a pointer to an instance of the [sqlite3_mem_methods] structure.
1885 ** The [sqlite3_mem_methods]
1886 ** structure is filled with the currently defined memory allocation routines.)^
1887 ** This option can be used to overload the default memory allocation
1888 ** routines with a wrapper that simulates memory allocation failure or
1889 ** tracks memory usage, for example. </dd>
1890 **
1891 ** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
1892 ** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes a single argument of
1893 ** type int, interpreted as a boolean, which if true provides a hint to
1894 ** SQLite that it should avoid large memory allocations if possible.
1895 ** SQLite will run faster if it is free to make large memory allocations,
1896 ** but some applications might prefer to run slower in exchange for
1897 ** guarantees about memory fragmentation that are possible if large
1898 ** allocations are avoided. This hint is normally off.
1899 ** </dd>
1900 **
1901 ** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
1902 ** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes a single argument of type int,
1903 ** interpreted as a boolean, which enables or disables the collection of
1904 ** memory allocation statistics. ^(When memory allocation statistics are
1905 ** disabled, the following SQLite interfaces become non-operational:
1906 ** <ul>
1907 ** <li> [sqlite3_hard_heap_limit64()]
@@ -1942,11 +1942,11 @@
1942 ** a page cache line is larger than sz bytes or if all of the pMem buffer
1943 ** is exhausted.
1944 ** ^If pMem is NULL and N is non-zero, then each database connection
1945 ** does an initial bulk allocation for page cache memory
1946 ** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
1947 ** of -1024*N bytes if N is negative. ^If additional
1948 ** page cache memory is needed beyond what is provided by the initial
1949 ** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
1950 ** additional cache line. </dd>
1951 **
1952 ** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
@@ -1971,11 +1971,11 @@
1971 **
1972 ** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
1973 ** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
1974 ** pointer to an instance of the [sqlite3_mutex_methods] structure.
1975 ** The argument specifies alternative low-level mutex routines to be used
1976 ** in place of the mutex routines built into SQLite.)^ ^SQLite makes a copy of
1977 ** the content of the [sqlite3_mutex_methods] structure before the call to
1978 ** [sqlite3_config()] returns. ^If SQLite is compiled with
1979 ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
1980 ** the entire mutexing subsystem is omitted from the build and hence calls to
1981 ** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
@@ -2013,11 +2013,11 @@
2013 ** the interface to a custom page cache implementation.)^
2014 ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
2015 **
2016 ** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
2017 ** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
2018 ** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies off
2019 ** the current page cache implementation into that object.)^ </dd>
2020 **
2021 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
2022 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
2023 ** global [error log].
@@ -2030,11 +2030,11 @@
2030 ** passed through as the first parameter to the application-defined logger
2031 ** function whenever that function is invoked. ^The second parameter to
2032 ** the logger function is a copy of the first parameter to the corresponding
2033 ** [sqlite3_log()] call and is intended to be a [result code] or an
2034 ** [extended result code]. ^The third parameter passed to the logger is
2035 ** a log message after formatting via [sqlite3_snprintf()].
2036 ** The SQLite logging interface is not reentrant; the logger function
2037 ** supplied by the application must not invoke any SQLite interface.
2038 ** In a multi-threaded application, the application-defined logger
2039 ** function must be threadsafe. </dd>
2040 **
@@ -2221,11 +2221,11 @@
2221 ** CAPI3REF: Database Connection Configuration Options
2222 **
2223 ** These constants are the available integer configuration options that
2224 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2225 **
2226 ** The [sqlite3_db_config()] interface is a var-args function. It takes a
2227 ** variable number of parameters, though always at least two. The number of
2228 ** parameters passed into sqlite3_db_config() depends on which of these
2229 ** constants is given as the second parameter. This documentation page
2230 ** refers to parameters beyond the second as "arguments". Thus, when this
2231 ** page says "the N-th argument" it means "the N-th parameter past the
@@ -2355,12 +2355,12 @@
2355 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2356 ** There must be two additional arguments.
2357 ** When the first argument to this interface is 1, then only the C-API is
2358 ** enabled and the SQL function remains disabled. If the first argument to
2359 ** this interface is 0, then both the C-API and the SQL function are disabled.
2360 ** If the first argument is -1, then no changes are made to the state of either
2361 ** the C-API or the SQL function.
2362 ** The second parameter is a pointer to an integer into which
2363 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
2364 ** is disabled or enabled following this call. The second parameter may
2365 ** be a NULL pointer, in which case the new setting is not reported back.
2366 ** </dd>
@@ -2474,11 +2474,11 @@
2474 ** </dd>
2475 **
2476 ** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
2477 ** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
2478 ** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
2479 ** the legacy behavior of the [ALTER TABLE RENAME] command such that it
2480 ** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
2481 ** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
2482 ** additional information. This feature can also be turned on and off
2483 ** using the [PRAGMA legacy_alter_table] statement.
2484 ** </dd>
@@ -2523,11 +2523,11 @@
2523 **
2524 ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
2525 ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
2526 ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
2527 ** the legacy file format flag. When activated, this flag causes all newly
2528 ** created database files to have a schema format version number (the 4-byte
2529 ** integer found at offset 44 into the database header) of 1. This in turn
2530 ** means that the resulting database file will be readable and writable by
2531 ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
2532 ** newly created databases are generally not understandable by SQLite versions
2533 ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
@@ -2550,11 +2550,11 @@
2550 ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
2551 ** statistics. For statistics to be collected, the flag must be set on
2552 ** the database handle both when the SQL statement is prepared and when it
2553 ** is stepped. The flag is set (collection of statistics is enabled)
2554 ** by default. <p>This option takes two arguments: an integer and a pointer to
2555 ** an integer. The first argument is 1, 0, or -1 to enable, disable, or
2556 ** leave unchanged the statement scanstatus option. If the second argument
2557 ** is not NULL, then the value of the statement scanstatus setting after
2558 ** processing the first argument is written into the integer that the second
2559 ** argument points to.
2560 ** </dd>
@@ -2593,12 +2593,12 @@
2593 ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
2594 ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
2595 ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
2596 ** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
2597 ** This capability is enabled by default. Applications can disable or
2598 ** reenable this capability using the current DBCONFIG option. If
2599 ** this capability is disabled, the [ATTACH] command will still work,
2600 ** but the database will be opened read-only. If this option is disabled,
2601 ** then the ability to create a new database using [ATTACH] is also disabled,
2602 ** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
2603 ** option.<p>
2604 ** This option takes two arguments which are an integer and a pointer
@@ -2628,11 +2628,11 @@
2628 **
2629 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2630 **
2631 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2632 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2633 ** The first argument (the third parameter to sqlite3_db_config()) is an integer.
2634 ** The second argument is a pointer to an integer. If the first argument is 1,
2635 ** then the option becomes enabled. If the first integer argument is 0, then the
2636 ** option is disabled. If the first argument is -1, then the option setting
2637 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2638 ** If the second argument is not NULL, then a value of 0 or 1 is written into
@@ -2918,11 +2918,11 @@
2918 ** and comments that follow the final semicolon are ignored.
2919 **
2920 ** ^These routines return 0 if the statement is incomplete. ^If a
2921 ** memory allocation fails, then SQLITE_NOMEM is returned.
2922 **
2923 ** ^These routines do not parse the SQL statements and thus
2924 ** will not detect syntactically incorrect SQL.
2925 **
2926 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
2927 ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
2928 ** automatically by sqlite3_complete16(). If that initialization fails,
@@ -3035,11 +3035,11 @@
3035 ** Passing 0 to this function disables blocking locks altogether. Passing
3036 ** -1 to this function requests that the VFS blocks for a long time -
3037 ** indefinitely if possible. The results of passing any other negative value
3038 ** are undefined.
3039 **
3040 ** Internally, each SQLite database handle stores two timeout values - the
3041 ** busy-timeout (used for rollback mode databases, or if the VFS does not
3042 ** support blocking locks) and the setlk-timeout (used for blocking locks
3043 ** on wal-mode databases). The sqlite3_busy_timeout() method sets both
3044 ** values, this function sets only the setlk-timeout value. Therefore,
3045 ** to configure separate busy-timeout and setlk-timeout values for a single
@@ -3065,11 +3065,11 @@
3065 ** METHOD: sqlite3
3066 **
3067 ** This is a legacy interface that is preserved for backwards compatibility.
3068 ** Use of this interface is not recommended.
3069 **
3070 ** Definition: A <b>result table</b> is a memory data structure created by the
3071 ** [sqlite3_get_table()] interface. A result table records the
3072 ** complete query results from one or more queries.
3073 **
3074 ** The table conceptually has a number of rows and columns. But
3075 ** these numbers are not part of the result table itself. These
@@ -3208,11 +3208,11 @@
3208 ** of a signed 32-bit integer.
3209 **
3210 ** ^Calling sqlite3_free() with a pointer previously returned
3211 ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
3212 ** that it might be reused. ^The sqlite3_free() routine is
3213 ** a no-op if it is called with a NULL pointer. Passing a NULL pointer
3214 ** to sqlite3_free() is harmless. After being freed, memory
3215 ** should neither be read nor written. Even reading previously freed
3216 ** memory might result in a segmentation fault or other severe error.
3217 ** Memory corruption, a segmentation fault, or other severe error
3218 ** might result if sqlite3_free() is called with a non-NULL pointer that
@@ -3226,17 +3226,17 @@
3226 ** ^If the N parameter to sqlite3_realloc(X,N) is zero or
3227 ** negative then the behavior is exactly the same as calling
3228 ** sqlite3_free(X).
3229 ** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
3230 ** of at least N bytes in size or NULL if insufficient memory is available.
3231 ** ^If M is the size of the prior allocation, then min(N,M) bytes of the
3232 ** prior allocation are copied into the beginning of the buffer returned
3233 ** by sqlite3_realloc(X,N) and the prior allocation is freed.
3234 ** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
3235 ** prior allocation is not freed.
3236 **
3237 ** ^The sqlite3_realloc64(X,N) interface works the same as
3238 ** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
3239 ** of a 32-bit signed integer.
3240 **
3241 ** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
3242 ** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
@@ -3282,11 +3282,11 @@
3282 ** ^The [sqlite3_memory_highwater()] routine returns the maximum
3283 ** value of [sqlite3_memory_used()] since the high-water mark
3284 ** was last reset. ^The values returned by [sqlite3_memory_used()] and
3285 ** [sqlite3_memory_highwater()] include any overhead
3286 ** added by SQLite in its implementation of [sqlite3_malloc()],
3287 ** but not overhead added by any underlying system library
3288 ** routines that [sqlite3_malloc()] may call.
3289 **
3290 ** ^The memory high-water mark is reset to the current value of
3291 ** [sqlite3_memory_used()] if and only if the parameter to
3292 ** [sqlite3_memory_highwater()] is true. ^The value returned
@@ -3734,19 +3734,19 @@
3734 ** attempt to use the same database connection at the same time.
3735 ** (Mutexes will block any actual concurrency, but in this mode
3736 ** there is no harm in trying.)
3737 **
3738 ** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
3739 ** <dd>The database is opened with [shared cache] enabled, overriding
3740 ** the default shared cache setting provided by
3741 ** [sqlite3_enable_shared_cache()].)^
3742 ** The [use of shared cache mode is discouraged] and hence shared cache
3743 ** capabilities may be omitted from many builds of SQLite. In such cases,
3744 ** this option is a no-op.
3745 **
3746 ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
3747 ** <dd>The database is opened with [shared cache] disabled, overriding
3748 ** the default shared cache setting provided by
3749 ** [sqlite3_enable_shared_cache()].)^
3750 **
3751 ** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
3752 ** <dd>The database connection comes up in "extended result code mode".
3753

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button