Fossil SCM

Update the built-in SQLite to the 3.49.0 release.

drh 2025-02-06 15:57 trunk
Commit 935cd45f03304fed7358f1f07616aee67570f8ade39a62c057a68cebbf5de5b6
2 files changed +93 -29 +30 -16
+93 -29
--- 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
-** 4068f586ddadd3a818645574f7584fcee6d3 with changes in files:
21
+** 4a7dd425dc2a0e5082a9049c9b4a9d4f199a 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.49.0"
469469
#define SQLITE_VERSION_NUMBER 3049000
470
-#define SQLITE_SOURCE_ID "2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a"
470
+#define SQLITE_SOURCE_ID "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde"
471471
472472
/*
473473
** CAPI3REF: Run-Time Library Version Numbers
474474
** KEYWORDS: sqlite3_version sqlite3_sourceid
475475
**
@@ -2528,11 +2528,19 @@
25282528
25292529
/*
25302530
** CAPI3REF: Database Connection Configuration Options
25312531
**
25322532
** These constants are the available integer configuration options that
2533
-** can be passed as the second argument to the [sqlite3_db_config()] interface.
2533
+** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2534
+**
2535
+** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2536
+** variable number of parameters, though always at least two. The number of
2537
+** parameters passed into sqlite3_db_config() depends on which of these
2538
+** constants is given as the second parameter. This documentation page
2539
+** refers to parameters beyond the second as "arguments". Thus, when this
2540
+** page says "the N-th argument" it means "the N-th parameter past the
2541
+** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
25342542
**
25352543
** New configuration options may be added in future releases of SQLite.
25362544
** Existing configuration options might be discontinued. Applications
25372545
** should check the return code from [sqlite3_db_config()] to make sure that
25382546
** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2545,11 +2553,13 @@
25452553
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
25462554
** configuration of the lookaside memory allocator within a database
25472555
** connection.
25482556
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
25492557
** in the [DBCONFIG arguments|usual format].
2550
-** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two.
2558
+** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2559
+** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2560
+** should have a total of five parameters.
25512561
** ^The first argument (the third parameter to [sqlite3_db_config()] is a
25522562
** pointer to a memory buffer to use for lookaside memory.
25532563
** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
25542564
** may be NULL in which case SQLite will allocate the
25552565
** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2647,16 +2657,17 @@
26472657
**
26482658
** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
26492659
** <dd> ^This option is used to change the name of the "main" database
26502660
** schema. This option does not follow the
26512661
** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2652
-** This option takes exactly one argument, which ust be a pointer
2653
-** to a constant UTF8 string which will become the new schema name
2654
-** in place of "main". ^SQLite does not make a copy of the new main
2655
-** schema name string, so the application must ensure that the argument
2656
-** passed into SQLITE_DBCONFIG MAINDBNAME is unchanged
2657
-** until after the database connection closes.
2662
+** This option takes exactly one additional argument so that the
2663
+** [sqlite3_db_config()] call has a total of three parameters. The
2664
+** extra argument must be a pointer to a constant UTF8 string which
2665
+** will become the new schema name in place of "main". ^SQLite does
2666
+** not make a copy of the new main schema name string, so the application
2667
+** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
2668
+** is unchanged until after the database connection closes.
26582669
** </dd>
26592670
**
26602671
** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
26612672
** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
26622673
** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2663,14 +2674,15 @@
26632674
** database handle, SQLite checks if if there are other connections to the
26642675
** same database, and if there are no other database connection (if the
26652676
** connection being closed is the last open connection to the database),
26662677
** then SQLite performs a [checkpoint] before closing the connection and
26672678
** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2668
-** be used to override that behavior. The first parameter passed to this
2669
-** operation is an integer - positive to disable checkpoints-on-close, or
2670
-** zero (the default) to enable them, and negative to leave the setting unchanged.
2671
-** The second parameter is a pointer to an integer
2679
+** be used to override that behavior. The first argument passed to this
2680
+** operation (the third parameter to [sqlite3_db_config()]) is an integer
2681
+** which is positive to disable checkpoints-on-close, or zero (the default)
2682
+** to enable them, and negative to leave the setting unchanged.
2683
+** The second argument (the fourth parameter) is a pointer to an integer
26722684
** into which is written 0 or 1 to indicate whether checkpoints-on-close
26732685
** have been disabled - 0 if they are not disabled, 1 if they are.
26742686
** </dd>
26752687
**
26762688
** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2904,13 +2916,15 @@
29042916
**
29052917
** </dl>
29062918
**
29072919
** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
29082920
**
2909
-** <p>Most of the SQLITE_DBCONFIG options take two arguments: an integer
2910
-** and a pointer to an integer. If the first integer argument is 1, then
2911
-** the option becomes enabled. If the first integer argument is 0, then the
2921
+** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2922
+** overall call to [sqlite3_db_config()] has a total of four parameters.
2923
+** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2924
+** The second argument is a pointer to an integer. If the first argument is 1,
2925
+** then the option becomes enabled. If the first integer argument is 0, then the
29122926
** option is disabled. If the first argument is -1, then the option setting
29132927
** is unchanged. The second argument, the pointer to an integer, may be NULL.
29142928
** If the second argument is not NULL, then a value of 0 or 1 is written into
29152929
** the integer to which the second argument points, depending on whether the
29162930
** setting is disabled or enabled after applying any changes specified by
@@ -20205,13 +20219,11 @@
2020520219
u8 eParseMode; /* PARSE_MODE_XXX constant */
2020620220
#ifndef SQLITE_OMIT_VIRTUALTABLE
2020720221
int nVtabLock; /* Number of virtual tables to lock */
2020820222
#endif
2020920223
int nHeight; /* Expression tree height of current sub-select */
20210
-#ifndef SQLITE_OMIT_EXPLAIN
2021120224
int addrExplain; /* Address of current OP_Explain opcode */
20212
-#endif
2021320225
VList *pVList; /* Mapping between variable names and numbers */
2021420226
Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
2021520227
const char *zTail; /* All SQL text past the last semicolon parsed */
2021620228
Table *pNewTable; /* A table being constructed by CREATE TABLE */
2021720229
Index *pNewIndex; /* An index being constructed by CREATE INDEX.
@@ -131351,11 +131363,14 @@
131351131363
** to initialize it */
131352131364
if( ALWAYS(p) && type!=SQLITE_NULL ){
131353131365
assert( p->cnt>0 );
131354131366
p->cnt--;
131355131367
if( !p->approx ){
131356
- p->iSum -= sqlite3_value_int64(argv[0]);
131368
+ if( sqlite3SubInt64(&p->iSum, sqlite3_value_int64(argv[0])) ){
131369
+ p->ovrfl = 1;
131370
+ p->approx = 1;
131371
+ }
131357131372
}else if( type==SQLITE_INTEGER ){
131358131373
i64 iVal = sqlite3_value_int64(argv[0]);
131359131374
if( iVal!=SMALLEST_INT64 ){
131360131375
kahanBabuskaNeumaierStepInt64(p, -iVal);
131361131376
}else{
@@ -188153,10 +188168,11 @@
188153188168
SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext(
188154188169
Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *);
188155188170
SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **);
188156188171
SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *);
188157188172
SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr);
188173
+SQLITE_PRIVATE int sqlite3Fts3MsrCancel(Fts3Cursor*, Fts3Expr*);
188158188174
188159188175
/* fts3_tokenize_vtab.c */
188160188176
SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3*, Fts3Hash *, void(*xDestroy)(void*));
188161188177
188162188178
/* fts3_unicode2.c (functions generated by parsing unicode text files) */
@@ -193670,10 +193686,28 @@
193670193686
193671193687
fts3EvalRestart(pCsr, pExpr->pLeft, pRc);
193672193688
fts3EvalRestart(pCsr, pExpr->pRight, pRc);
193673193689
}
193674193690
}
193691
+
193692
+/*
193693
+** Expression node pExpr is an MSR phrase. This function restarts pExpr
193694
+** so that it is a regular phrase query, not an MSR. SQLITE_OK is returned
193695
+** if successful, or an SQLite error code otherwise.
193696
+*/
193697
+SQLITE_PRIVATE int sqlite3Fts3MsrCancel(Fts3Cursor *pCsr, Fts3Expr *pExpr){
193698
+ int rc = SQLITE_OK;
193699
+ if( pExpr->bEof==0 ){
193700
+ i64 iDocid = pExpr->iDocid;
193701
+ fts3EvalRestart(pCsr, pExpr, &rc);
193702
+ while( rc==SQLITE_OK && pExpr->iDocid!=iDocid ){
193703
+ fts3EvalNextRow(pCsr, pExpr, &rc);
193704
+ if( pExpr->bEof ) rc = FTS_CORRUPT_VTAB;
193705
+ }
193706
+ }
193707
+ return rc;
193708
+}
193675193709
193676193710
/*
193677193711
** After allocating the Fts3Expr.aMI[] array for each phrase in the
193678193712
** expression rooted at pExpr, the cursor iterates through all rows matched
193679193713
** by pExpr, calling this function for each row. This function increments
@@ -205627,10 +205661,26 @@
205627205661
pT->iPos = iPos;
205628205662
}
205629205663
205630205664
return rc;
205631205665
}
205666
+
205667
+/*
205668
+** If expression pExpr is a phrase expression that uses an MSR query,
205669
+** restart it as a regular, non-incremental query. Return SQLITE_OK
205670
+** if successful, or an SQLite error code otherwise.
205671
+*/
205672
+static int fts3ExprRestartIfCb(Fts3Expr *pExpr, int iPhrase, void *ctx){
205673
+ TermOffsetCtx *p = (TermOffsetCtx*)ctx;
205674
+ int rc = SQLITE_OK;
205675
+ UNUSED_PARAMETER(iPhrase);
205676
+ if( pExpr->pPhrase && pExpr->pPhrase->bIncr ){
205677
+ rc = sqlite3Fts3MsrCancel(p->pCsr, pExpr);
205678
+ pExpr->pPhrase->bIncr = 0;
205679
+ }
205680
+ return rc;
205681
+}
205632205682
205633205683
/*
205634205684
** Implementation of offsets() function.
205635205685
*/
205636205686
SQLITE_PRIVATE void sqlite3Fts3Offsets(
@@ -205663,10 +205713,16 @@
205663205713
rc = SQLITE_NOMEM;
205664205714
goto offsets_out;
205665205715
}
205666205716
sCtx.iDocid = pCsr->iPrevId;
205667205717
sCtx.pCsr = pCsr;
205718
+
205719
+ /* If a query restart will be required, do it here, rather than later of
205720
+ ** after pointers to poslist buffers that may be invalidated by a restart
205721
+ ** have been saved. */
205722
+ rc = sqlite3Fts3ExprIterate(pCsr->pExpr, fts3ExprRestartIfCb, (void*)&sCtx);
205723
+ if( rc!=SQLITE_OK ) goto offsets_out;
205668205724
205669205725
/* Loop through the table columns, appending offset information to
205670205726
** string-buffer res for each column.
205671205727
*/
205672205728
for(iCol=0; iCol<pTab->nColumn; iCol++){
@@ -229279,13 +229335,15 @@
229279229335
int nStr = sqlite3Strlen30(zStr)*2 + 2 + 2;
229280229336
if( 0==sessionBufferGrow(p, nStr, pRc) ){
229281229337
char *zOut = (char *)&p->aBuf[p->nBuf];
229282229338
const char *zIn = zStr;
229283229339
*zOut++ = '"';
229284
- while( *zIn ){
229285
- if( *zIn=='"' ) *zOut++ = '"';
229286
- *zOut++ = *(zIn++);
229340
+ if( zIn!=0 ){
229341
+ while( *zIn ){
229342
+ if( *zIn=='"' ) *zOut++ = '"';
229343
+ *zOut++ = *(zIn++);
229344
+ }
229287229345
}
229288229346
*zOut++ = '"';
229289229347
p->nBuf = (int)((u8 *)zOut - p->aBuf);
229290229348
p->aBuf[p->nBuf] = 0x00;
229291229349
}
@@ -248255,12 +248313,15 @@
248255248313
248256248314
/*
248257248315
** This is called as part of flushing a delete to disk in 'secure-delete'
248258248316
** mode. It edits the segments within the database described by argument
248259248317
** pStruct to remove the entries for term zTerm, rowid iRowid.
248318
+**
248319
+** Return SQLITE_OK if successful, or an SQLite error code if an error
248320
+** has occurred. Any error code is also stored in the Fts5Index handle.
248260248321
*/
248261
-static void fts5FlushSecureDelete(
248322
+static int fts5FlushSecureDelete(
248262248323
Fts5Index *p,
248263248324
Fts5Structure *pStruct,
248264248325
const char *zTerm,
248265248326
int nTerm,
248266248327
i64 iRowid
@@ -248301,10 +248362,11 @@
248301248362
fts5DoSecureDelete(p, pSeg);
248302248363
}
248303248364
}
248304248365
248305248366
fts5MultiIterFree(pIter);
248367
+ return p->rc;
248306248368
}
248307248369
248308248370
248309248371
/*
248310248372
** Flush the contents of in-memory hash table iHash to a new level-0
@@ -248384,22 +248446,24 @@
248384248446
/* If in secure delete mode, and if this entry in the poslist is
248385248447
** in fact a delete, then edit the existing segments directly
248386248448
** using fts5FlushSecureDelete(). */
248387248449
if( bSecureDelete ){
248388248450
if( eDetail==FTS5_DETAIL_NONE ){
248389
- if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
248390
- fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid);
248451
+ if( iOff<nDoclist && pDoclist[iOff]==0x00
248452
+ && !fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid)
248453
+ ){
248391248454
iOff++;
248392248455
if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
248393248456
iOff++;
248394248457
nDoclist = 0;
248395248458
}else{
248396248459
continue;
248397248460
}
248398248461
}
248399
- }else if( (pDoclist[iOff] & 0x01) ){
248400
- fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid);
248462
+ }else if( (pDoclist[iOff] & 0x01)
248463
+ && !fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid)
248464
+ ){
248401248465
if( p->rc!=SQLITE_OK || pDoclist[iOff]==0x01 ){
248402248466
iOff++;
248403248467
continue;
248404248468
}
248405248469
}
@@ -255806,11 +255870,11 @@
255806255870
int nArg, /* Number of args */
255807255871
sqlite3_value **apUnused /* Function arguments */
255808255872
){
255809255873
assert( nArg==0 );
255810255874
UNUSED_PARAM2(nArg, apUnused);
255811
- sqlite3_result_text(pCtx, "fts5: 2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a", -1, SQLITE_TRANSIENT);
255875
+ sqlite3_result_text(pCtx, "fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde", -1, SQLITE_TRANSIENT);
255812255876
}
255813255877
255814255878
/*
255815255879
** Implementation of fts5_locale(LOCALE, TEXT) function.
255816255880
**
255817255881
--- 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 ** 4068f586ddadd3a818645574f7584fcee6d3 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.49.0"
469 #define SQLITE_VERSION_NUMBER 3049000
470 #define SQLITE_SOURCE_ID "2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a"
471
472 /*
473 ** CAPI3REF: Run-Time Library Version Numbers
474 ** KEYWORDS: sqlite3_version sqlite3_sourceid
475 **
@@ -2528,11 +2528,19 @@
2528
2529 /*
2530 ** CAPI3REF: Database Connection Configuration Options
2531 **
2532 ** These constants are the available integer configuration options that
2533 ** can be passed as the second argument to the [sqlite3_db_config()] interface.
 
 
 
 
 
 
 
 
2534 **
2535 ** New configuration options may be added in future releases of SQLite.
2536 ** Existing configuration options might be discontinued. Applications
2537 ** should check the return code from [sqlite3_db_config()] to make sure that
2538 ** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2545,11 +2553,13 @@
2545 ** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2546 ** configuration of the lookaside memory allocator within a database
2547 ** connection.
2548 ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2549 ** in the [DBCONFIG arguments|usual format].
2550 ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two.
 
 
2551 ** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2552 ** pointer to a memory buffer to use for lookaside memory.
2553 ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
2554 ** may be NULL in which case SQLite will allocate the
2555 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2647,16 +2657,17 @@
2647 **
2648 ** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2649 ** <dd> ^This option is used to change the name of the "main" database
2650 ** schema. This option does not follow the
2651 ** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2652 ** This option takes exactly one argument, which ust be a pointer
2653 ** to a constant UTF8 string which will become the new schema name
2654 ** in place of "main". ^SQLite does not make a copy of the new main
2655 ** schema name string, so the application must ensure that the argument
2656 ** passed into SQLITE_DBCONFIG MAINDBNAME is unchanged
2657 ** until after the database connection closes.
 
2658 ** </dd>
2659 **
2660 ** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
2661 ** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
2662 ** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2663,14 +2674,15 @@
2663 ** database handle, SQLite checks if if there are other connections to the
2664 ** same database, and if there are no other database connection (if the
2665 ** connection being closed is the last open connection to the database),
2666 ** then SQLite performs a [checkpoint] before closing the connection and
2667 ** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2668 ** be used to override that behavior. The first parameter passed to this
2669 ** operation is an integer - positive to disable checkpoints-on-close, or
2670 ** zero (the default) to enable them, and negative to leave the setting unchanged.
2671 ** The second parameter is a pointer to an integer
 
2672 ** into which is written 0 or 1 to indicate whether checkpoints-on-close
2673 ** have been disabled - 0 if they are not disabled, 1 if they are.
2674 ** </dd>
2675 **
2676 ** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2904,13 +2916,15 @@
2904 **
2905 ** </dl>
2906 **
2907 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2908 **
2909 ** <p>Most of the SQLITE_DBCONFIG options take two arguments: an integer
2910 ** and a pointer to an integer. If the first integer argument is 1, then
2911 ** the option becomes enabled. If the first integer argument is 0, then the
 
 
2912 ** option is disabled. If the first argument is -1, then the option setting
2913 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2914 ** If the second argument is not NULL, then a value of 0 or 1 is written into
2915 ** the integer to which the second argument points, depending on whether the
2916 ** setting is disabled or enabled after applying any changes specified by
@@ -20205,13 +20219,11 @@
20205 u8 eParseMode; /* PARSE_MODE_XXX constant */
20206 #ifndef SQLITE_OMIT_VIRTUALTABLE
20207 int nVtabLock; /* Number of virtual tables to lock */
20208 #endif
20209 int nHeight; /* Expression tree height of current sub-select */
20210 #ifndef SQLITE_OMIT_EXPLAIN
20211 int addrExplain; /* Address of current OP_Explain opcode */
20212 #endif
20213 VList *pVList; /* Mapping between variable names and numbers */
20214 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
20215 const char *zTail; /* All SQL text past the last semicolon parsed */
20216 Table *pNewTable; /* A table being constructed by CREATE TABLE */
20217 Index *pNewIndex; /* An index being constructed by CREATE INDEX.
@@ -131351,11 +131363,14 @@
131351 ** to initialize it */
131352 if( ALWAYS(p) && type!=SQLITE_NULL ){
131353 assert( p->cnt>0 );
131354 p->cnt--;
131355 if( !p->approx ){
131356 p->iSum -= sqlite3_value_int64(argv[0]);
 
 
 
131357 }else if( type==SQLITE_INTEGER ){
131358 i64 iVal = sqlite3_value_int64(argv[0]);
131359 if( iVal!=SMALLEST_INT64 ){
131360 kahanBabuskaNeumaierStepInt64(p, -iVal);
131361 }else{
@@ -188153,10 +188168,11 @@
188153 SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext(
188154 Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *);
188155 SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **);
188156 SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *);
188157 SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr);
 
188158
188159 /* fts3_tokenize_vtab.c */
188160 SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3*, Fts3Hash *, void(*xDestroy)(void*));
188161
188162 /* fts3_unicode2.c (functions generated by parsing unicode text files) */
@@ -193670,10 +193686,28 @@
193670
193671 fts3EvalRestart(pCsr, pExpr->pLeft, pRc);
193672 fts3EvalRestart(pCsr, pExpr->pRight, pRc);
193673 }
193674 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193675
193676 /*
193677 ** After allocating the Fts3Expr.aMI[] array for each phrase in the
193678 ** expression rooted at pExpr, the cursor iterates through all rows matched
193679 ** by pExpr, calling this function for each row. This function increments
@@ -205627,10 +205661,26 @@
205627 pT->iPos = iPos;
205628 }
205629
205630 return rc;
205631 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205632
205633 /*
205634 ** Implementation of offsets() function.
205635 */
205636 SQLITE_PRIVATE void sqlite3Fts3Offsets(
@@ -205663,10 +205713,16 @@
205663 rc = SQLITE_NOMEM;
205664 goto offsets_out;
205665 }
205666 sCtx.iDocid = pCsr->iPrevId;
205667 sCtx.pCsr = pCsr;
 
 
 
 
 
 
205668
205669 /* Loop through the table columns, appending offset information to
205670 ** string-buffer res for each column.
205671 */
205672 for(iCol=0; iCol<pTab->nColumn; iCol++){
@@ -229279,13 +229335,15 @@
229279 int nStr = sqlite3Strlen30(zStr)*2 + 2 + 2;
229280 if( 0==sessionBufferGrow(p, nStr, pRc) ){
229281 char *zOut = (char *)&p->aBuf[p->nBuf];
229282 const char *zIn = zStr;
229283 *zOut++ = '"';
229284 while( *zIn ){
229285 if( *zIn=='"' ) *zOut++ = '"';
229286 *zOut++ = *(zIn++);
 
 
229287 }
229288 *zOut++ = '"';
229289 p->nBuf = (int)((u8 *)zOut - p->aBuf);
229290 p->aBuf[p->nBuf] = 0x00;
229291 }
@@ -248255,12 +248313,15 @@
248255
248256 /*
248257 ** This is called as part of flushing a delete to disk in 'secure-delete'
248258 ** mode. It edits the segments within the database described by argument
248259 ** pStruct to remove the entries for term zTerm, rowid iRowid.
 
 
 
248260 */
248261 static void fts5FlushSecureDelete(
248262 Fts5Index *p,
248263 Fts5Structure *pStruct,
248264 const char *zTerm,
248265 int nTerm,
248266 i64 iRowid
@@ -248301,10 +248362,11 @@
248301 fts5DoSecureDelete(p, pSeg);
248302 }
248303 }
248304
248305 fts5MultiIterFree(pIter);
 
248306 }
248307
248308
248309 /*
248310 ** Flush the contents of in-memory hash table iHash to a new level-0
@@ -248384,22 +248446,24 @@
248384 /* If in secure delete mode, and if this entry in the poslist is
248385 ** in fact a delete, then edit the existing segments directly
248386 ** using fts5FlushSecureDelete(). */
248387 if( bSecureDelete ){
248388 if( eDetail==FTS5_DETAIL_NONE ){
248389 if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
248390 fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid);
 
248391 iOff++;
248392 if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
248393 iOff++;
248394 nDoclist = 0;
248395 }else{
248396 continue;
248397 }
248398 }
248399 }else if( (pDoclist[iOff] & 0x01) ){
248400 fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid);
 
248401 if( p->rc!=SQLITE_OK || pDoclist[iOff]==0x01 ){
248402 iOff++;
248403 continue;
248404 }
248405 }
@@ -255806,11 +255870,11 @@
255806 int nArg, /* Number of args */
255807 sqlite3_value **apUnused /* Function arguments */
255808 ){
255809 assert( nArg==0 );
255810 UNUSED_PARAM2(nArg, apUnused);
255811 sqlite3_result_text(pCtx, "fts5: 2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a", -1, SQLITE_TRANSIENT);
255812 }
255813
255814 /*
255815 ** Implementation of fts5_locale(LOCALE, TEXT) function.
255816 **
255817
--- 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 ** 4a7dd425dc2a0e5082a9049c9b4a9d4f199a 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.49.0"
469 #define SQLITE_VERSION_NUMBER 3049000
470 #define SQLITE_SOURCE_ID "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde"
471
472 /*
473 ** CAPI3REF: Run-Time Library Version Numbers
474 ** KEYWORDS: sqlite3_version sqlite3_sourceid
475 **
@@ -2528,11 +2528,19 @@
2528
2529 /*
2530 ** CAPI3REF: Database Connection Configuration Options
2531 **
2532 ** These constants are the available integer configuration options that
2533 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2534 **
2535 ** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2536 ** variable number of parameters, though always at least two. The number of
2537 ** parameters passed into sqlite3_db_config() depends on which of these
2538 ** constants is given as the second parameter. This documentation page
2539 ** refers to parameters beyond the second as "arguments". Thus, when this
2540 ** page says "the N-th argument" it means "the N-th parameter past the
2541 ** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
2542 **
2543 ** New configuration options may be added in future releases of SQLite.
2544 ** Existing configuration options might be discontinued. Applications
2545 ** should check the return code from [sqlite3_db_config()] to make sure that
2546 ** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2545,11 +2553,13 @@
2553 ** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2554 ** configuration of the lookaside memory allocator within a database
2555 ** connection.
2556 ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2557 ** in the [DBCONFIG arguments|usual format].
2558 ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2559 ** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2560 ** should have a total of five parameters.
2561 ** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2562 ** pointer to a memory buffer to use for lookaside memory.
2563 ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
2564 ** may be NULL in which case SQLite will allocate the
2565 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2647,16 +2657,17 @@
2657 **
2658 ** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2659 ** <dd> ^This option is used to change the name of the "main" database
2660 ** schema. This option does not follow the
2661 ** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2662 ** This option takes exactly one additional argument so that the
2663 ** [sqlite3_db_config()] call has a total of three parameters. The
2664 ** extra argument must be a pointer to a constant UTF8 string which
2665 ** will become the new schema name in place of "main". ^SQLite does
2666 ** not make a copy of the new main schema name string, so the application
2667 ** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
2668 ** is unchanged until after the database connection closes.
2669 ** </dd>
2670 **
2671 ** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
2672 ** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
2673 ** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2663,14 +2674,15 @@
2674 ** database handle, SQLite checks if if there are other connections to the
2675 ** same database, and if there are no other database connection (if the
2676 ** connection being closed is the last open connection to the database),
2677 ** then SQLite performs a [checkpoint] before closing the connection and
2678 ** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2679 ** be used to override that behavior. The first argument passed to this
2680 ** operation (the third parameter to [sqlite3_db_config()]) is an integer
2681 ** which is positive to disable checkpoints-on-close, or zero (the default)
2682 ** to enable them, and negative to leave the setting unchanged.
2683 ** The second argument (the fourth parameter) is a pointer to an integer
2684 ** into which is written 0 or 1 to indicate whether checkpoints-on-close
2685 ** have been disabled - 0 if they are not disabled, 1 if they are.
2686 ** </dd>
2687 **
2688 ** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2904,13 +2916,15 @@
2916 **
2917 ** </dl>
2918 **
2919 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2920 **
2921 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2922 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2923 ** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2924 ** The second argument is a pointer to an integer. If the first argument is 1,
2925 ** then the option becomes enabled. If the first integer argument is 0, then the
2926 ** option is disabled. If the first argument is -1, then the option setting
2927 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2928 ** If the second argument is not NULL, then a value of 0 or 1 is written into
2929 ** the integer to which the second argument points, depending on whether the
2930 ** setting is disabled or enabled after applying any changes specified by
@@ -20205,13 +20219,11 @@
20219 u8 eParseMode; /* PARSE_MODE_XXX constant */
20220 #ifndef SQLITE_OMIT_VIRTUALTABLE
20221 int nVtabLock; /* Number of virtual tables to lock */
20222 #endif
20223 int nHeight; /* Expression tree height of current sub-select */
 
20224 int addrExplain; /* Address of current OP_Explain opcode */
 
20225 VList *pVList; /* Mapping between variable names and numbers */
20226 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
20227 const char *zTail; /* All SQL text past the last semicolon parsed */
20228 Table *pNewTable; /* A table being constructed by CREATE TABLE */
20229 Index *pNewIndex; /* An index being constructed by CREATE INDEX.
@@ -131351,11 +131363,14 @@
131363 ** to initialize it */
131364 if( ALWAYS(p) && type!=SQLITE_NULL ){
131365 assert( p->cnt>0 );
131366 p->cnt--;
131367 if( !p->approx ){
131368 if( sqlite3SubInt64(&p->iSum, sqlite3_value_int64(argv[0])) ){
131369 p->ovrfl = 1;
131370 p->approx = 1;
131371 }
131372 }else if( type==SQLITE_INTEGER ){
131373 i64 iVal = sqlite3_value_int64(argv[0]);
131374 if( iVal!=SMALLEST_INT64 ){
131375 kahanBabuskaNeumaierStepInt64(p, -iVal);
131376 }else{
@@ -188153,10 +188168,11 @@
188168 SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext(
188169 Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *);
188170 SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **);
188171 SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *);
188172 SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr);
188173 SQLITE_PRIVATE int sqlite3Fts3MsrCancel(Fts3Cursor*, Fts3Expr*);
188174
188175 /* fts3_tokenize_vtab.c */
188176 SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3*, Fts3Hash *, void(*xDestroy)(void*));
188177
188178 /* fts3_unicode2.c (functions generated by parsing unicode text files) */
@@ -193670,10 +193686,28 @@
193686
193687 fts3EvalRestart(pCsr, pExpr->pLeft, pRc);
193688 fts3EvalRestart(pCsr, pExpr->pRight, pRc);
193689 }
193690 }
193691
193692 /*
193693 ** Expression node pExpr is an MSR phrase. This function restarts pExpr
193694 ** so that it is a regular phrase query, not an MSR. SQLITE_OK is returned
193695 ** if successful, or an SQLite error code otherwise.
193696 */
193697 SQLITE_PRIVATE int sqlite3Fts3MsrCancel(Fts3Cursor *pCsr, Fts3Expr *pExpr){
193698 int rc = SQLITE_OK;
193699 if( pExpr->bEof==0 ){
193700 i64 iDocid = pExpr->iDocid;
193701 fts3EvalRestart(pCsr, pExpr, &rc);
193702 while( rc==SQLITE_OK && pExpr->iDocid!=iDocid ){
193703 fts3EvalNextRow(pCsr, pExpr, &rc);
193704 if( pExpr->bEof ) rc = FTS_CORRUPT_VTAB;
193705 }
193706 }
193707 return rc;
193708 }
193709
193710 /*
193711 ** After allocating the Fts3Expr.aMI[] array for each phrase in the
193712 ** expression rooted at pExpr, the cursor iterates through all rows matched
193713 ** by pExpr, calling this function for each row. This function increments
@@ -205627,10 +205661,26 @@
205661 pT->iPos = iPos;
205662 }
205663
205664 return rc;
205665 }
205666
205667 /*
205668 ** If expression pExpr is a phrase expression that uses an MSR query,
205669 ** restart it as a regular, non-incremental query. Return SQLITE_OK
205670 ** if successful, or an SQLite error code otherwise.
205671 */
205672 static int fts3ExprRestartIfCb(Fts3Expr *pExpr, int iPhrase, void *ctx){
205673 TermOffsetCtx *p = (TermOffsetCtx*)ctx;
205674 int rc = SQLITE_OK;
205675 UNUSED_PARAMETER(iPhrase);
205676 if( pExpr->pPhrase && pExpr->pPhrase->bIncr ){
205677 rc = sqlite3Fts3MsrCancel(p->pCsr, pExpr);
205678 pExpr->pPhrase->bIncr = 0;
205679 }
205680 return rc;
205681 }
205682
205683 /*
205684 ** Implementation of offsets() function.
205685 */
205686 SQLITE_PRIVATE void sqlite3Fts3Offsets(
@@ -205663,10 +205713,16 @@
205713 rc = SQLITE_NOMEM;
205714 goto offsets_out;
205715 }
205716 sCtx.iDocid = pCsr->iPrevId;
205717 sCtx.pCsr = pCsr;
205718
205719 /* If a query restart will be required, do it here, rather than later of
205720 ** after pointers to poslist buffers that may be invalidated by a restart
205721 ** have been saved. */
205722 rc = sqlite3Fts3ExprIterate(pCsr->pExpr, fts3ExprRestartIfCb, (void*)&sCtx);
205723 if( rc!=SQLITE_OK ) goto offsets_out;
205724
205725 /* Loop through the table columns, appending offset information to
205726 ** string-buffer res for each column.
205727 */
205728 for(iCol=0; iCol<pTab->nColumn; iCol++){
@@ -229279,13 +229335,15 @@
229335 int nStr = sqlite3Strlen30(zStr)*2 + 2 + 2;
229336 if( 0==sessionBufferGrow(p, nStr, pRc) ){
229337 char *zOut = (char *)&p->aBuf[p->nBuf];
229338 const char *zIn = zStr;
229339 *zOut++ = '"';
229340 if( zIn!=0 ){
229341 while( *zIn ){
229342 if( *zIn=='"' ) *zOut++ = '"';
229343 *zOut++ = *(zIn++);
229344 }
229345 }
229346 *zOut++ = '"';
229347 p->nBuf = (int)((u8 *)zOut - p->aBuf);
229348 p->aBuf[p->nBuf] = 0x00;
229349 }
@@ -248255,12 +248313,15 @@
248313
248314 /*
248315 ** This is called as part of flushing a delete to disk in 'secure-delete'
248316 ** mode. It edits the segments within the database described by argument
248317 ** pStruct to remove the entries for term zTerm, rowid iRowid.
248318 **
248319 ** Return SQLITE_OK if successful, or an SQLite error code if an error
248320 ** has occurred. Any error code is also stored in the Fts5Index handle.
248321 */
248322 static int fts5FlushSecureDelete(
248323 Fts5Index *p,
248324 Fts5Structure *pStruct,
248325 const char *zTerm,
248326 int nTerm,
248327 i64 iRowid
@@ -248301,10 +248362,11 @@
248362 fts5DoSecureDelete(p, pSeg);
248363 }
248364 }
248365
248366 fts5MultiIterFree(pIter);
248367 return p->rc;
248368 }
248369
248370
248371 /*
248372 ** Flush the contents of in-memory hash table iHash to a new level-0
@@ -248384,22 +248446,24 @@
248446 /* If in secure delete mode, and if this entry in the poslist is
248447 ** in fact a delete, then edit the existing segments directly
248448 ** using fts5FlushSecureDelete(). */
248449 if( bSecureDelete ){
248450 if( eDetail==FTS5_DETAIL_NONE ){
248451 if( iOff<nDoclist && pDoclist[iOff]==0x00
248452 && !fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid)
248453 ){
248454 iOff++;
248455 if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
248456 iOff++;
248457 nDoclist = 0;
248458 }else{
248459 continue;
248460 }
248461 }
248462 }else if( (pDoclist[iOff] & 0x01)
248463 && !fts5FlushSecureDelete(p, pStruct, zTerm, nTerm, iRowid)
248464 ){
248465 if( p->rc!=SQLITE_OK || pDoclist[iOff]==0x01 ){
248466 iOff++;
248467 continue;
248468 }
248469 }
@@ -255806,11 +255870,11 @@
255870 int nArg, /* Number of args */
255871 sqlite3_value **apUnused /* Function arguments */
255872 ){
255873 assert( nArg==0 );
255874 UNUSED_PARAM2(nArg, apUnused);
255875 sqlite3_result_text(pCtx, "fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde", -1, SQLITE_TRANSIENT);
255876 }
255877
255878 /*
255879 ** Implementation of fts5_locale(LOCALE, TEXT) function.
255880 **
255881
+30 -16
--- 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.49.0"
150150
#define SQLITE_VERSION_NUMBER 3049000
151
-#define SQLITE_SOURCE_ID "2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a"
151
+#define SQLITE_SOURCE_ID "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
@@ -2209,11 +2209,19 @@
22092209
22102210
/*
22112211
** CAPI3REF: Database Connection Configuration Options
22122212
**
22132213
** These constants are the available integer configuration options that
2214
-** can be passed as the second argument to the [sqlite3_db_config()] interface.
2214
+** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2215
+**
2216
+** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2217
+** variable number of parameters, though always at least two. The number of
2218
+** parameters passed into sqlite3_db_config() depends on which of these
2219
+** constants is given as the second parameter. This documentation page
2220
+** refers to parameters beyond the second as "arguments". Thus, when this
2221
+** page says "the N-th argument" it means "the N-th parameter past the
2222
+** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
22152223
**
22162224
** New configuration options may be added in future releases of SQLite.
22172225
** Existing configuration options might be discontinued. Applications
22182226
** should check the return code from [sqlite3_db_config()] to make sure that
22192227
** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2226,11 +2234,13 @@
22262234
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
22272235
** configuration of the lookaside memory allocator within a database
22282236
** connection.
22292237
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
22302238
** in the [DBCONFIG arguments|usual format].
2231
-** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two.
2239
+** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2240
+** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2241
+** should have a total of five parameters.
22322242
** ^The first argument (the third parameter to [sqlite3_db_config()] is a
22332243
** pointer to a memory buffer to use for lookaside memory.
22342244
** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
22352245
** may be NULL in which case SQLite will allocate the
22362246
** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2328,16 +2338,17 @@
23282338
**
23292339
** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
23302340
** <dd> ^This option is used to change the name of the "main" database
23312341
** schema. This option does not follow the
23322342
** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2333
-** This option takes exactly one argument, which ust be a pointer
2334
-** to a constant UTF8 string which will become the new schema name
2335
-** in place of "main". ^SQLite does not make a copy of the new main
2336
-** schema name string, so the application must ensure that the argument
2337
-** passed into SQLITE_DBCONFIG MAINDBNAME is unchanged
2338
-** until after the database connection closes.
2343
+** This option takes exactly one additional argument so that the
2344
+** [sqlite3_db_config()] call has a total of three parameters. The
2345
+** extra argument must be a pointer to a constant UTF8 string which
2346
+** will become the new schema name in place of "main". ^SQLite does
2347
+** not make a copy of the new main schema name string, so the application
2348
+** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
2349
+** is unchanged until after the database connection closes.
23392350
** </dd>
23402351
**
23412352
** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
23422353
** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
23432354
** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2344,14 +2355,15 @@
23442355
** database handle, SQLite checks if if there are other connections to the
23452356
** same database, and if there are no other database connection (if the
23462357
** connection being closed is the last open connection to the database),
23472358
** then SQLite performs a [checkpoint] before closing the connection and
23482359
** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2349
-** be used to override that behavior. The first parameter passed to this
2350
-** operation is an integer - positive to disable checkpoints-on-close, or
2351
-** zero (the default) to enable them, and negative to leave the setting unchanged.
2352
-** The second parameter is a pointer to an integer
2360
+** be used to override that behavior. The first argument passed to this
2361
+** operation (the third parameter to [sqlite3_db_config()]) is an integer
2362
+** which is positive to disable checkpoints-on-close, or zero (the default)
2363
+** to enable them, and negative to leave the setting unchanged.
2364
+** The second argument (the fourth parameter) is a pointer to an integer
23532365
** into which is written 0 or 1 to indicate whether checkpoints-on-close
23542366
** have been disabled - 0 if they are not disabled, 1 if they are.
23552367
** </dd>
23562368
**
23572369
** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2585,13 +2597,15 @@
25852597
**
25862598
** </dl>
25872599
**
25882600
** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
25892601
**
2590
-** <p>Most of the SQLITE_DBCONFIG options take two arguments: an integer
2591
-** and a pointer to an integer. If the first integer argument is 1, then
2592
-** the option becomes enabled. If the first integer argument is 0, then the
2602
+** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2603
+** overall call to [sqlite3_db_config()] has a total of four parameters.
2604
+** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2605
+** The second argument is a pointer to an integer. If the first argument is 1,
2606
+** then the option becomes enabled. If the first integer argument is 0, then the
25932607
** option is disabled. If the first argument is -1, then the option setting
25942608
** is unchanged. The second argument, the pointer to an integer, may be NULL.
25952609
** If the second argument is not NULL, then a value of 0 or 1 is written into
25962610
** the integer to which the second argument points, depending on whether the
25972611
** setting is disabled or enabled after applying any changes specified by
25982612
--- 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.49.0"
150 #define SQLITE_VERSION_NUMBER 3049000
151 #define SQLITE_SOURCE_ID "2025-02-01 23:49:01 4068f586ddadd3a818645574f7584fcee6d373dbf45805c545100883b495598a"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -2209,11 +2209,19 @@
2209
2210 /*
2211 ** CAPI3REF: Database Connection Configuration Options
2212 **
2213 ** These constants are the available integer configuration options that
2214 ** can be passed as the second argument to the [sqlite3_db_config()] interface.
 
 
 
 
 
 
 
 
2215 **
2216 ** New configuration options may be added in future releases of SQLite.
2217 ** Existing configuration options might be discontinued. Applications
2218 ** should check the return code from [sqlite3_db_config()] to make sure that
2219 ** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2226,11 +2234,13 @@
2226 ** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2227 ** configuration of the lookaside memory allocator within a database
2228 ** connection.
2229 ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2230 ** in the [DBCONFIG arguments|usual format].
2231 ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two.
 
 
2232 ** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2233 ** pointer to a memory buffer to use for lookaside memory.
2234 ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
2235 ** may be NULL in which case SQLite will allocate the
2236 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2328,16 +2338,17 @@
2328 **
2329 ** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2330 ** <dd> ^This option is used to change the name of the "main" database
2331 ** schema. This option does not follow the
2332 ** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2333 ** This option takes exactly one argument, which ust be a pointer
2334 ** to a constant UTF8 string which will become the new schema name
2335 ** in place of "main". ^SQLite does not make a copy of the new main
2336 ** schema name string, so the application must ensure that the argument
2337 ** passed into SQLITE_DBCONFIG MAINDBNAME is unchanged
2338 ** until after the database connection closes.
 
2339 ** </dd>
2340 **
2341 ** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
2342 ** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
2343 ** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2344,14 +2355,15 @@
2344 ** database handle, SQLite checks if if there are other connections to the
2345 ** same database, and if there are no other database connection (if the
2346 ** connection being closed is the last open connection to the database),
2347 ** then SQLite performs a [checkpoint] before closing the connection and
2348 ** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2349 ** be used to override that behavior. The first parameter passed to this
2350 ** operation is an integer - positive to disable checkpoints-on-close, or
2351 ** zero (the default) to enable them, and negative to leave the setting unchanged.
2352 ** The second parameter is a pointer to an integer
 
2353 ** into which is written 0 or 1 to indicate whether checkpoints-on-close
2354 ** have been disabled - 0 if they are not disabled, 1 if they are.
2355 ** </dd>
2356 **
2357 ** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2585,13 +2597,15 @@
2585 **
2586 ** </dl>
2587 **
2588 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2589 **
2590 ** <p>Most of the SQLITE_DBCONFIG options take two arguments: an integer
2591 ** and a pointer to an integer. If the first integer argument is 1, then
2592 ** the option becomes enabled. If the first integer argument is 0, then the
 
 
2593 ** option is disabled. If the first argument is -1, then the option setting
2594 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2595 ** If the second argument is not NULL, then a value of 0 or 1 is written into
2596 ** the integer to which the second argument points, depending on whether the
2597 ** setting is disabled or enabled after applying any changes specified by
2598
--- 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.49.0"
150 #define SQLITE_VERSION_NUMBER 3049000
151 #define SQLITE_SOURCE_ID "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -2209,11 +2209,19 @@
2209
2210 /*
2211 ** CAPI3REF: Database Connection Configuration Options
2212 **
2213 ** These constants are the available integer configuration options that
2214 ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2215 **
2216 ** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2217 ** variable number of parameters, though always at least two. The number of
2218 ** parameters passed into sqlite3_db_config() depends on which of these
2219 ** constants is given as the second parameter. This documentation page
2220 ** refers to parameters beyond the second as "arguments". Thus, when this
2221 ** page says "the N-th argument" it means "the N-th parameter past the
2222 ** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
2223 **
2224 ** New configuration options may be added in future releases of SQLite.
2225 ** Existing configuration options might be discontinued. Applications
2226 ** should check the return code from [sqlite3_db_config()] to make sure that
2227 ** the call worked. ^The [sqlite3_db_config()] interface will return a
@@ -2226,11 +2234,13 @@
2234 ** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2235 ** configuration of the lookaside memory allocator within a database
2236 ** connection.
2237 ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2238 ** in the [DBCONFIG arguments|usual format].
2239 ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2240 ** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2241 ** should have a total of five parameters.
2242 ** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2243 ** pointer to a memory buffer to use for lookaside memory.
2244 ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
2245 ** may be NULL in which case SQLite will allocate the
2246 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
@@ -2328,16 +2338,17 @@
2338 **
2339 ** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2340 ** <dd> ^This option is used to change the name of the "main" database
2341 ** schema. This option does not follow the
2342 ** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2343 ** This option takes exactly one additional argument so that the
2344 ** [sqlite3_db_config()] call has a total of three parameters. The
2345 ** extra argument must be a pointer to a constant UTF8 string which
2346 ** will become the new schema name in place of "main". ^SQLite does
2347 ** not make a copy of the new main schema name string, so the application
2348 ** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
2349 ** is unchanged until after the database connection closes.
2350 ** </dd>
2351 **
2352 ** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
2353 ** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
2354 ** <dd> Usually, when a database in [WAL mode] is closed or detached from a
@@ -2344,14 +2355,15 @@
2355 ** database handle, SQLite checks if if there are other connections to the
2356 ** same database, and if there are no other database connection (if the
2357 ** connection being closed is the last open connection to the database),
2358 ** then SQLite performs a [checkpoint] before closing the connection and
2359 ** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2360 ** be used to override that behavior. The first argument passed to this
2361 ** operation (the third parameter to [sqlite3_db_config()]) is an integer
2362 ** which is positive to disable checkpoints-on-close, or zero (the default)
2363 ** to enable them, and negative to leave the setting unchanged.
2364 ** The second argument (the fourth parameter) is a pointer to an integer
2365 ** into which is written 0 or 1 to indicate whether checkpoints-on-close
2366 ** have been disabled - 0 if they are not disabled, 1 if they are.
2367 ** </dd>
2368 **
2369 ** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
@@ -2585,13 +2597,15 @@
2597 **
2598 ** </dl>
2599 **
2600 ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2601 **
2602 ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2603 ** overall call to [sqlite3_db_config()] has a total of four parameters.
2604 ** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2605 ** The second argument is a pointer to an integer. If the first argument is 1,
2606 ** then the option becomes enabled. If the first integer argument is 0, then the
2607 ** option is disabled. If the first argument is -1, then the option setting
2608 ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2609 ** If the second argument is not NULL, then a value of 0 or 1 is written into
2610 ** the integer to which the second argument points, depending on whether the
2611 ** setting is disabled or enabled after applying any changes specified by
2612

Keyboard Shortcuts

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