Fossil SCM

Update the built-in SQLite to the latest trunk check-in for beta testing.

drh 2025-10-31 13:48 trunk
Commit 8690598e51c639466d3e0baaa6e54f38c6f71d88d93817b3ef665b78fcc73017
+20 -2
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -24753,10 +24753,13 @@
2475324753
sqlite3_snprintf(sizeof(zStmt), zStmt,
2475424754
"PRAGMA reverse_unordered_selects(%d)", !iSetting);
2475524755
sqlite3_exec(db, zStmt, 0, 0, 0);
2475624756
}
2475724757
24758
+/* Forward reference */
24759
+static int db_int(sqlite3 *db, const char *zSql, ...);
24760
+
2475824761
/*
2475924762
** This is a different callback routine used for dumping the database.
2476024763
** Each row received by this callback consists of a table name,
2476124764
** the table type ("index" or "table") and SQL to create the table.
2476224765
** This routine should print text sufficient to recreate the table.
@@ -24779,11 +24782,25 @@
2477924782
if( zType==0 ) return 0;
2478024783
dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0;
2478124784
noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0;
2478224785
2478324786
if( cli_strcmp(zTable, "sqlite_sequence")==0 && !noSys ){
24784
- /* no-op */
24787
+ /* The sqlite_sequence table is repopulated last. Delete content
24788
+ ** in the sqlite_sequence table added by prior repopulations prior to
24789
+ ** repopulating sqlite_sequence itself. But only do this if the
24790
+ ** table is non-empty, because if it is empty the table might not
24791
+ ** have been recreated by prior repopulations. See forum posts:
24792
+ ** 2024-10-13T17:10:01z and 2025-10-29T19:38:43z
24793
+ */
24794
+ if( db_int(p->db, "SELECT count(*) FROM sqlite_sequence")>0 ){
24795
+ if( !p->writableSchema ){
24796
+ sqlite3_fputs("PRAGMA writable_schema=ON;\n", p->out);
24797
+ p->writableSchema = 1;
24798
+ }
24799
+ sqlite3_fputs("CREATE TABLE IF NOT EXISTS sqlite_sequence(name,seq);\n"
24800
+ "DELETE FROM sqlite_sequence;\n", p->out);
24801
+ }
2478524802
}else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){
2478624803
if( !dataOnly ) sqlite3_fputs("ANALYZE sqlite_schema;\n", p->out);
2478724804
}else if( cli_strncmp(zTable, "sqlite_", 7)==0 ){
2478824805
return 0;
2478924806
}else if( dataOnly ){
@@ -29487,11 +29504,12 @@
2948729504
if( sCtx.z==0 ){
2948829505
import_cleanup(&sCtx);
2948929506
shell_out_of_memory();
2949029507
}
2949129508
/* Below, resources must be freed before exit. */
29492
- while( (nSkip--)>0 ){
29509
+ while( nSkip>0 ){
29510
+ nSkip--;
2949329511
while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
2949429512
}
2949529513
import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
2949629514
if( sqlite3_table_column_metadata(p->db, zSchema, zTable,0,0,0,0,0,0)
2949729515
&& 0==db_int(p->db, "SELECT count(*) FROM \"%w\".sqlite_schema"
2949829516
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -24753,10 +24753,13 @@
24753 sqlite3_snprintf(sizeof(zStmt), zStmt,
24754 "PRAGMA reverse_unordered_selects(%d)", !iSetting);
24755 sqlite3_exec(db, zStmt, 0, 0, 0);
24756 }
24757
 
 
 
24758 /*
24759 ** This is a different callback routine used for dumping the database.
24760 ** Each row received by this callback consists of a table name,
24761 ** the table type ("index" or "table") and SQL to create the table.
24762 ** This routine should print text sufficient to recreate the table.
@@ -24779,11 +24782,25 @@
24779 if( zType==0 ) return 0;
24780 dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0;
24781 noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0;
24782
24783 if( cli_strcmp(zTable, "sqlite_sequence")==0 && !noSys ){
24784 /* no-op */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24785 }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){
24786 if( !dataOnly ) sqlite3_fputs("ANALYZE sqlite_schema;\n", p->out);
24787 }else if( cli_strncmp(zTable, "sqlite_", 7)==0 ){
24788 return 0;
24789 }else if( dataOnly ){
@@ -29487,11 +29504,12 @@
29487 if( sCtx.z==0 ){
29488 import_cleanup(&sCtx);
29489 shell_out_of_memory();
29490 }
29491 /* Below, resources must be freed before exit. */
29492 while( (nSkip--)>0 ){
 
29493 while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
29494 }
29495 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
29496 if( sqlite3_table_column_metadata(p->db, zSchema, zTable,0,0,0,0,0,0)
29497 && 0==db_int(p->db, "SELECT count(*) FROM \"%w\".sqlite_schema"
29498
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -24753,10 +24753,13 @@
24753 sqlite3_snprintf(sizeof(zStmt), zStmt,
24754 "PRAGMA reverse_unordered_selects(%d)", !iSetting);
24755 sqlite3_exec(db, zStmt, 0, 0, 0);
24756 }
24757
24758 /* Forward reference */
24759 static int db_int(sqlite3 *db, const char *zSql, ...);
24760
24761 /*
24762 ** This is a different callback routine used for dumping the database.
24763 ** Each row received by this callback consists of a table name,
24764 ** the table type ("index" or "table") and SQL to create the table.
24765 ** This routine should print text sufficient to recreate the table.
@@ -24779,11 +24782,25 @@
24782 if( zType==0 ) return 0;
24783 dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0;
24784 noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0;
24785
24786 if( cli_strcmp(zTable, "sqlite_sequence")==0 && !noSys ){
24787 /* The sqlite_sequence table is repopulated last. Delete content
24788 ** in the sqlite_sequence table added by prior repopulations prior to
24789 ** repopulating sqlite_sequence itself. But only do this if the
24790 ** table is non-empty, because if it is empty the table might not
24791 ** have been recreated by prior repopulations. See forum posts:
24792 ** 2024-10-13T17:10:01z and 2025-10-29T19:38:43z
24793 */
24794 if( db_int(p->db, "SELECT count(*) FROM sqlite_sequence")>0 ){
24795 if( !p->writableSchema ){
24796 sqlite3_fputs("PRAGMA writable_schema=ON;\n", p->out);
24797 p->writableSchema = 1;
24798 }
24799 sqlite3_fputs("CREATE TABLE IF NOT EXISTS sqlite_sequence(name,seq);\n"
24800 "DELETE FROM sqlite_sequence;\n", p->out);
24801 }
24802 }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){
24803 if( !dataOnly ) sqlite3_fputs("ANALYZE sqlite_schema;\n", p->out);
24804 }else if( cli_strncmp(zTable, "sqlite_", 7)==0 ){
24805 return 0;
24806 }else if( dataOnly ){
@@ -29487,11 +29504,12 @@
29504 if( sCtx.z==0 ){
29505 import_cleanup(&sCtx);
29506 shell_out_of_memory();
29507 }
29508 /* Below, resources must be freed before exit. */
29509 while( nSkip>0 ){
29510 nSkip--;
29511 while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
29512 }
29513 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
29514 if( sqlite3_table_column_metadata(p->db, zSchema, zTable,0,0,0,0,0,0)
29515 && 0==db_int(p->db, "SELECT count(*) FROM \"%w\".sqlite_schema"
29516
+23 -12
--- 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
-** 724f2299f206cc9e7f830f984c50a8fc4ac1 with changes in files:
21
+** c1aa52361b8ede611f64b96f2394174389ce with changes in files:
2222
**
2323
**
2424
*/
2525
#ifndef SQLITE_AMALGAMATION
2626
#define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467467
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468468
** [sqlite_version()] and [sqlite_source_id()].
469469
*/
470470
#define SQLITE_VERSION "3.51.0"
471471
#define SQLITE_VERSION_NUMBER 3051000
472
-#define SQLITE_SOURCE_ID "2025-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060"
472
+#define SQLITE_SOURCE_ID "2025-10-31 13:44:51 c1aa52361b8ede611f64b96f2394174389ce531b1d86b9cfec91d3b03c94f6ea"
473473
#define SQLITE_SCM_BRANCH "trunk"
474474
#define SQLITE_SCM_TAGS ""
475
-#define SQLITE_SCM_DATETIME "2025-10-28T13:24:50.858Z"
475
+#define SQLITE_SCM_DATETIME "2025-10-31T13:44:51.646Z"
476476
477477
/*
478478
** CAPI3REF: Run-Time Library Version Numbers
479479
** KEYWORDS: sqlite3_version sqlite3_sourceid
480480
**
@@ -24373,12 +24373,11 @@
2437324373
Mem oldipk; /* Memory cell holding "old" IPK value */
2437424374
Mem *aNew; /* Array of new.* values */
2437524375
Table *pTab; /* Schema object being updated */
2437624376
Index *pPk; /* PK index if pTab is WITHOUT ROWID */
2437724377
sqlite3_value **apDflt; /* Array of default values, if required */
24378
- union {
24379
- KeyInfo sKey;
24378
+ struct {
2438024379
u8 keyinfoSpace[SZ_KEYINFO_0]; /* Space to hold pKeyinfo[0] content */
2438124380
} uKey;
2438224381
};
2438324382
2438424383
/*
@@ -41031,12 +41030,16 @@
4103141030
rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
4103241031
}
4103341032
return rc;
4103441033
}
4103541034
41035
+#if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL)
4103641036
/* Forward reference */
4103741037
static int unixIsSharingShmNode(unixFile*);
41038
+#else
41039
+#define unixIsSharingShmNode(pFile) (0)
41040
+#endif
4103841041
4103941042
/*
4104041043
** Lock the file with the lock specified by parameter eFileLock - one
4104141044
** of the following:
4104241045
**
@@ -44465,11 +44468,11 @@
4446544468
4446644469
assert( 0==memcmp(pShmNode->aLock, aLock, sizeof(aLock)) );
4446744470
return (memcmp(pShmNode->aLock, aLock, sizeof(aLock))==0);
4446844471
#endif
4446944472
}
44470
-#endif
44473
+#endif /* !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) */
4447144474
4447244475
/*
4447344476
** Change the lock state for a shared-memory segment.
4447444477
**
4447544478
** Note that the relationship between SHARED and EXCLUSIVE locks is a little
@@ -50449,10 +50452,11 @@
5044950452
#endif
5045050453
}
5045150454
#endif
5045250455
}
5045350456
50457
+#ifndef SQLITE_OMIT_WAL
5045450458
/*
5045550459
** Lock a region of nByte bytes starting at offset offset of file hFile.
5045650460
** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock
5045750461
** otherwise. If nMs is greater than zero and the lock cannot be obtained
5045850462
** immediately, block for that many ms before giving up.
@@ -50531,10 +50535,11 @@
5053150535
if( rc==SQLITE_OK && !ret ){
5053250536
rc = SQLITE_BUSY;
5053350537
}
5053450538
return rc;
5053550539
}
50540
+#endif /* #ifndef SQLITE_OMIT_WAL */
5053650541
5053750542
/*
5053850543
** Unlock a file region.
5053950544
*/
5054050545
static BOOL winUnlockFile(
@@ -50565,17 +50570,19 @@
5056550570
#endif
5056650571
}
5056750572
#endif
5056850573
}
5056950574
50575
+#ifndef SQLITE_OMIT_WAL
5057050576
/*
5057150577
** Remove an nByte lock starting at offset iOff from HANDLE h.
5057250578
*/
5057350579
static int winHandleUnlock(HANDLE h, int iOff, int nByte){
5057450580
BOOL ret = winUnlockFile(&h, iOff, 0, nByte, 0);
5057550581
return (ret ? SQLITE_OK : SQLITE_IOERR_UNLOCK);
5057650582
}
50583
+#endif
5057750584
5057850585
/*****************************************************************************
5057950586
** The next group of routines implement the I/O methods specified
5058050587
** by the sqlite3_io_methods object.
5058150588
******************************************************************************/
@@ -50909,10 +50916,11 @@
5090950916
OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
5091050917
osGetCurrentProcessId(), pFile, pFile->h));
5091150918
return SQLITE_OK;
5091250919
}
5091350920
50921
+#ifndef SQLITE_OMIT_WAL
5091450922
/*
5091550923
** Truncate the file opened by handle h to nByte bytes in size.
5091650924
*/
5091750925
static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){
5091850926
int rc = SQLITE_OK; /* Return code */
@@ -50962,10 +50970,11 @@
5096250970
static void winHandleClose(HANDLE h){
5096350971
if( h!=INVALID_HANDLE_VALUE ){
5096450972
osCloseHandle(h);
5096550973
}
5096650974
}
50975
+#endif /* #ifndef SQLITE_OMIT_WAL */
5096750976
5096850977
/*
5096950978
** Truncate an open file to a specified size
5097050979
*/
5097150980
static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
@@ -60766,11 +60775,11 @@
6076660775
** then the Wal object may be holding a write-lock but no read-lock.
6076760776
** This call ensures that the write-lock is dropped as well. We cannot
6076860777
** have sqlite3WalEndReadTransaction() drop the write-lock, as it once
6076960778
** did, because this would break "BEGIN EXCLUSIVE" handling for
6077060779
** SQLITE_ENABLE_SETLK_TIMEOUT builds. */
60771
- sqlite3WalEndWriteTransaction(pPager->pWal);
60780
+ (void)sqlite3WalEndWriteTransaction(pPager->pWal);
6077260781
}
6077360782
sqlite3WalEndReadTransaction(pPager->pWal);
6077460783
pPager->eState = PAGER_OPEN;
6077560784
}else if( !pPager->exclusiveMode ){
6077660785
int rc; /* Error code returned by pagerUnlockDb() */
@@ -70231,11 +70240,11 @@
7023170240
SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){
7023270241
#ifndef SQLITE_ENABLE_SETLK_TIMEOUT
7023370242
assert( pWal->writeLock==0 || pWal->readLock<0 );
7023470243
#endif
7023570244
if( pWal->readLock>=0 ){
70236
- sqlite3WalEndWriteTransaction(pWal);
70245
+ (void)sqlite3WalEndWriteTransaction(pWal);
7023770246
walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock));
7023870247
pWal->readLock = -1;
7023970248
}
7024070249
}
7024170250
@@ -71138,11 +71147,11 @@
7113871147
7113971148
walDisableBlocking(pWal);
7114071149
sqlite3WalDb(pWal, 0);
7114171150
7114271151
/* Release the locks. */
71143
- sqlite3WalEndWriteTransaction(pWal);
71152
+ (void)sqlite3WalEndWriteTransaction(pWal);
7114471153
if( pWal->ckptLock ){
7114571154
walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
7114671155
pWal->ckptLock = 0;
7114771156
}
7114871157
WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok"));
@@ -85966,10 +85975,11 @@
8596685975
testcase( nAlloc==31 );
8596785976
testcase( nAlloc==32 );
8596885977
if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
8596985978
return SQLITE_NOMEM_BKPT;
8597085979
}
85980
+ assert( pMem->z!=0 );
8597185981
memcpy(pMem->z, z, nAlloc);
8597285982
}else{
8597385983
sqlite3VdbeMemRelease(pMem);
8597485984
pMem->z = (char *)z;
8597585985
if( xDel==SQLITE_DYNAMIC ){
@@ -92337,11 +92347,11 @@
9233792347
9233892348
preupdate.v = v;
9233992349
preupdate.pCsr = pCsr;
9234092350
preupdate.op = op;
9234192351
preupdate.iNewReg = iReg;
92342
- preupdate.pKeyinfo = &preupdate.uKey.sKey;
92352
+ preupdate.pKeyinfo = (KeyInfo*)&preupdate.uKey;
9234392353
preupdate.pKeyinfo->db = db;
9234492354
preupdate.pKeyinfo->enc = ENC(db);
9234592355
preupdate.pKeyinfo->nKeyField = pTab->nCol;
9234692356
preupdate.pKeyinfo->aSortFlags = 0; /* Indicate .aColl, .nAllField uninit */
9234792357
preupdate.iKey1 = iKey1;
@@ -116253,11 +116263,11 @@
116253116263
assert( pParse->pVdbe!=0 );
116254116264
v = pParse->pVdbe;
116255116265
pAlt = sqlite3ExprSimplifiedAndOr(pExpr);
116256116266
if( pAlt!=pExpr ){
116257116267
r1 = sqlite3ExprCodeTarget(pParse, pAlt, target);
116258
- sqlite3VdbeAddOp3(v, OP_BitAnd, r1, r1, target);
116268
+ sqlite3VdbeAddOp3(v, OP_And, r1, r1, target);
116259116269
return target;
116260116270
}
116261116271
skipOp = op==TK_AND ? OP_IfNot : OP_If;
116262116272
if( exprEvalRhsFirst(pExpr) ){
116263116273
/* Compute the right operand first. Skip the computation of the left
@@ -153547,10 +153557,11 @@
153547153557
nExtra++; /* One extra column for the OP_Sequence */
153548153558
}
153549153559
if( pFunc->bOBPayload ){
153550153560
/* extra columns for the function arguments */
153551153561
assert( ExprUseXList(pFunc->pFExpr) );
153562
+ assert( pFunc->pFExpr->x.pList!=0 );
153552153563
nExtra += pFunc->pFExpr->x.pList->nExpr;
153553153564
}
153554153565
if( pFunc->bUseSubtype ){
153555153566
nExtra += pFunc->pFExpr->x.pList->nExpr;
153556153567
}
@@ -260266,11 +260277,11 @@
260266260277
int nArg, /* Number of args */
260267260278
sqlite3_value **apUnused /* Function arguments */
260268260279
){
260269260280
assert( nArg==0 );
260270260281
UNUSED_PARAM2(nArg, apUnused);
260271
- sqlite3_result_text(pCtx, "fts5: 2025-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060", -1, SQLITE_TRANSIENT);
260282
+ sqlite3_result_text(pCtx, "fts5: 2025-10-30 11:39:49 c833f26a6780f919551e50c67d308e96293cec8481899354411d805617481f24", -1, SQLITE_TRANSIENT);
260272260283
}
260273260284
260274260285
/*
260275260286
** Implementation of fts5_locale(LOCALE, TEXT) function.
260276260287
**
260277260288
--- 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 ** 724f2299f206cc9e7f830f984c50a8fc4ac1 with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468 ** [sqlite_version()] and [sqlite_source_id()].
469 */
470 #define SQLITE_VERSION "3.51.0"
471 #define SQLITE_VERSION_NUMBER 3051000
472 #define SQLITE_SOURCE_ID "2025-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2025-10-28T13:24:50.858Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -24373,12 +24373,11 @@
24373 Mem oldipk; /* Memory cell holding "old" IPK value */
24374 Mem *aNew; /* Array of new.* values */
24375 Table *pTab; /* Schema object being updated */
24376 Index *pPk; /* PK index if pTab is WITHOUT ROWID */
24377 sqlite3_value **apDflt; /* Array of default values, if required */
24378 union {
24379 KeyInfo sKey;
24380 u8 keyinfoSpace[SZ_KEYINFO_0]; /* Space to hold pKeyinfo[0] content */
24381 } uKey;
24382 };
24383
24384 /*
@@ -41031,12 +41030,16 @@
41031 rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
41032 }
41033 return rc;
41034 }
41035
 
41036 /* Forward reference */
41037 static int unixIsSharingShmNode(unixFile*);
 
 
 
41038
41039 /*
41040 ** Lock the file with the lock specified by parameter eFileLock - one
41041 ** of the following:
41042 **
@@ -44465,11 +44468,11 @@
44465
44466 assert( 0==memcmp(pShmNode->aLock, aLock, sizeof(aLock)) );
44467 return (memcmp(pShmNode->aLock, aLock, sizeof(aLock))==0);
44468 #endif
44469 }
44470 #endif
44471
44472 /*
44473 ** Change the lock state for a shared-memory segment.
44474 **
44475 ** Note that the relationship between SHARED and EXCLUSIVE locks is a little
@@ -50449,10 +50452,11 @@
50449 #endif
50450 }
50451 #endif
50452 }
50453
 
50454 /*
50455 ** Lock a region of nByte bytes starting at offset offset of file hFile.
50456 ** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock
50457 ** otherwise. If nMs is greater than zero and the lock cannot be obtained
50458 ** immediately, block for that many ms before giving up.
@@ -50531,10 +50535,11 @@
50531 if( rc==SQLITE_OK && !ret ){
50532 rc = SQLITE_BUSY;
50533 }
50534 return rc;
50535 }
 
50536
50537 /*
50538 ** Unlock a file region.
50539 */
50540 static BOOL winUnlockFile(
@@ -50565,17 +50570,19 @@
50565 #endif
50566 }
50567 #endif
50568 }
50569
 
50570 /*
50571 ** Remove an nByte lock starting at offset iOff from HANDLE h.
50572 */
50573 static int winHandleUnlock(HANDLE h, int iOff, int nByte){
50574 BOOL ret = winUnlockFile(&h, iOff, 0, nByte, 0);
50575 return (ret ? SQLITE_OK : SQLITE_IOERR_UNLOCK);
50576 }
 
50577
50578 /*****************************************************************************
50579 ** The next group of routines implement the I/O methods specified
50580 ** by the sqlite3_io_methods object.
50581 ******************************************************************************/
@@ -50909,10 +50916,11 @@
50909 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
50910 osGetCurrentProcessId(), pFile, pFile->h));
50911 return SQLITE_OK;
50912 }
50913
 
50914 /*
50915 ** Truncate the file opened by handle h to nByte bytes in size.
50916 */
50917 static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){
50918 int rc = SQLITE_OK; /* Return code */
@@ -50962,10 +50970,11 @@
50962 static void winHandleClose(HANDLE h){
50963 if( h!=INVALID_HANDLE_VALUE ){
50964 osCloseHandle(h);
50965 }
50966 }
 
50967
50968 /*
50969 ** Truncate an open file to a specified size
50970 */
50971 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
@@ -60766,11 +60775,11 @@
60766 ** then the Wal object may be holding a write-lock but no read-lock.
60767 ** This call ensures that the write-lock is dropped as well. We cannot
60768 ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once
60769 ** did, because this would break "BEGIN EXCLUSIVE" handling for
60770 ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */
60771 sqlite3WalEndWriteTransaction(pPager->pWal);
60772 }
60773 sqlite3WalEndReadTransaction(pPager->pWal);
60774 pPager->eState = PAGER_OPEN;
60775 }else if( !pPager->exclusiveMode ){
60776 int rc; /* Error code returned by pagerUnlockDb() */
@@ -70231,11 +70240,11 @@
70231 SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){
70232 #ifndef SQLITE_ENABLE_SETLK_TIMEOUT
70233 assert( pWal->writeLock==0 || pWal->readLock<0 );
70234 #endif
70235 if( pWal->readLock>=0 ){
70236 sqlite3WalEndWriteTransaction(pWal);
70237 walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock));
70238 pWal->readLock = -1;
70239 }
70240 }
70241
@@ -71138,11 +71147,11 @@
71138
71139 walDisableBlocking(pWal);
71140 sqlite3WalDb(pWal, 0);
71141
71142 /* Release the locks. */
71143 sqlite3WalEndWriteTransaction(pWal);
71144 if( pWal->ckptLock ){
71145 walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
71146 pWal->ckptLock = 0;
71147 }
71148 WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok"));
@@ -85966,10 +85975,11 @@
85966 testcase( nAlloc==31 );
85967 testcase( nAlloc==32 );
85968 if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
85969 return SQLITE_NOMEM_BKPT;
85970 }
 
85971 memcpy(pMem->z, z, nAlloc);
85972 }else{
85973 sqlite3VdbeMemRelease(pMem);
85974 pMem->z = (char *)z;
85975 if( xDel==SQLITE_DYNAMIC ){
@@ -92337,11 +92347,11 @@
92337
92338 preupdate.v = v;
92339 preupdate.pCsr = pCsr;
92340 preupdate.op = op;
92341 preupdate.iNewReg = iReg;
92342 preupdate.pKeyinfo = &preupdate.uKey.sKey;
92343 preupdate.pKeyinfo->db = db;
92344 preupdate.pKeyinfo->enc = ENC(db);
92345 preupdate.pKeyinfo->nKeyField = pTab->nCol;
92346 preupdate.pKeyinfo->aSortFlags = 0; /* Indicate .aColl, .nAllField uninit */
92347 preupdate.iKey1 = iKey1;
@@ -116253,11 +116263,11 @@
116253 assert( pParse->pVdbe!=0 );
116254 v = pParse->pVdbe;
116255 pAlt = sqlite3ExprSimplifiedAndOr(pExpr);
116256 if( pAlt!=pExpr ){
116257 r1 = sqlite3ExprCodeTarget(pParse, pAlt, target);
116258 sqlite3VdbeAddOp3(v, OP_BitAnd, r1, r1, target);
116259 return target;
116260 }
116261 skipOp = op==TK_AND ? OP_IfNot : OP_If;
116262 if( exprEvalRhsFirst(pExpr) ){
116263 /* Compute the right operand first. Skip the computation of the left
@@ -153547,10 +153557,11 @@
153547 nExtra++; /* One extra column for the OP_Sequence */
153548 }
153549 if( pFunc->bOBPayload ){
153550 /* extra columns for the function arguments */
153551 assert( ExprUseXList(pFunc->pFExpr) );
 
153552 nExtra += pFunc->pFExpr->x.pList->nExpr;
153553 }
153554 if( pFunc->bUseSubtype ){
153555 nExtra += pFunc->pFExpr->x.pList->nExpr;
153556 }
@@ -260266,11 +260277,11 @@
260266 int nArg, /* Number of args */
260267 sqlite3_value **apUnused /* Function arguments */
260268 ){
260269 assert( nArg==0 );
260270 UNUSED_PARAM2(nArg, apUnused);
260271 sqlite3_result_text(pCtx, "fts5: 2025-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060", -1, SQLITE_TRANSIENT);
260272 }
260273
260274 /*
260275 ** Implementation of fts5_locale(LOCALE, TEXT) function.
260276 **
260277
--- 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 ** c1aa52361b8ede611f64b96f2394174389ce with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468 ** [sqlite_version()] and [sqlite_source_id()].
469 */
470 #define SQLITE_VERSION "3.51.0"
471 #define SQLITE_VERSION_NUMBER 3051000
472 #define SQLITE_SOURCE_ID "2025-10-31 13:44:51 c1aa52361b8ede611f64b96f2394174389ce531b1d86b9cfec91d3b03c94f6ea"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2025-10-31T13:44:51.646Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -24373,12 +24373,11 @@
24373 Mem oldipk; /* Memory cell holding "old" IPK value */
24374 Mem *aNew; /* Array of new.* values */
24375 Table *pTab; /* Schema object being updated */
24376 Index *pPk; /* PK index if pTab is WITHOUT ROWID */
24377 sqlite3_value **apDflt; /* Array of default values, if required */
24378 struct {
 
24379 u8 keyinfoSpace[SZ_KEYINFO_0]; /* Space to hold pKeyinfo[0] content */
24380 } uKey;
24381 };
24382
24383 /*
@@ -41031,12 +41030,16 @@
41030 rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
41031 }
41032 return rc;
41033 }
41034
41035 #if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL)
41036 /* Forward reference */
41037 static int unixIsSharingShmNode(unixFile*);
41038 #else
41039 #define unixIsSharingShmNode(pFile) (0)
41040 #endif
41041
41042 /*
41043 ** Lock the file with the lock specified by parameter eFileLock - one
41044 ** of the following:
41045 **
@@ -44465,11 +44468,11 @@
44468
44469 assert( 0==memcmp(pShmNode->aLock, aLock, sizeof(aLock)) );
44470 return (memcmp(pShmNode->aLock, aLock, sizeof(aLock))==0);
44471 #endif
44472 }
44473 #endif /* !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) */
44474
44475 /*
44476 ** Change the lock state for a shared-memory segment.
44477 **
44478 ** Note that the relationship between SHARED and EXCLUSIVE locks is a little
@@ -50449,10 +50452,11 @@
50452 #endif
50453 }
50454 #endif
50455 }
50456
50457 #ifndef SQLITE_OMIT_WAL
50458 /*
50459 ** Lock a region of nByte bytes starting at offset offset of file hFile.
50460 ** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock
50461 ** otherwise. If nMs is greater than zero and the lock cannot be obtained
50462 ** immediately, block for that many ms before giving up.
@@ -50531,10 +50535,11 @@
50535 if( rc==SQLITE_OK && !ret ){
50536 rc = SQLITE_BUSY;
50537 }
50538 return rc;
50539 }
50540 #endif /* #ifndef SQLITE_OMIT_WAL */
50541
50542 /*
50543 ** Unlock a file region.
50544 */
50545 static BOOL winUnlockFile(
@@ -50565,17 +50570,19 @@
50570 #endif
50571 }
50572 #endif
50573 }
50574
50575 #ifndef SQLITE_OMIT_WAL
50576 /*
50577 ** Remove an nByte lock starting at offset iOff from HANDLE h.
50578 */
50579 static int winHandleUnlock(HANDLE h, int iOff, int nByte){
50580 BOOL ret = winUnlockFile(&h, iOff, 0, nByte, 0);
50581 return (ret ? SQLITE_OK : SQLITE_IOERR_UNLOCK);
50582 }
50583 #endif
50584
50585 /*****************************************************************************
50586 ** The next group of routines implement the I/O methods specified
50587 ** by the sqlite3_io_methods object.
50588 ******************************************************************************/
@@ -50909,10 +50916,11 @@
50916 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
50917 osGetCurrentProcessId(), pFile, pFile->h));
50918 return SQLITE_OK;
50919 }
50920
50921 #ifndef SQLITE_OMIT_WAL
50922 /*
50923 ** Truncate the file opened by handle h to nByte bytes in size.
50924 */
50925 static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){
50926 int rc = SQLITE_OK; /* Return code */
@@ -50962,10 +50970,11 @@
50970 static void winHandleClose(HANDLE h){
50971 if( h!=INVALID_HANDLE_VALUE ){
50972 osCloseHandle(h);
50973 }
50974 }
50975 #endif /* #ifndef SQLITE_OMIT_WAL */
50976
50977 /*
50978 ** Truncate an open file to a specified size
50979 */
50980 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
@@ -60766,11 +60775,11 @@
60775 ** then the Wal object may be holding a write-lock but no read-lock.
60776 ** This call ensures that the write-lock is dropped as well. We cannot
60777 ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once
60778 ** did, because this would break "BEGIN EXCLUSIVE" handling for
60779 ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */
60780 (void)sqlite3WalEndWriteTransaction(pPager->pWal);
60781 }
60782 sqlite3WalEndReadTransaction(pPager->pWal);
60783 pPager->eState = PAGER_OPEN;
60784 }else if( !pPager->exclusiveMode ){
60785 int rc; /* Error code returned by pagerUnlockDb() */
@@ -70231,11 +70240,11 @@
70240 SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){
70241 #ifndef SQLITE_ENABLE_SETLK_TIMEOUT
70242 assert( pWal->writeLock==0 || pWal->readLock<0 );
70243 #endif
70244 if( pWal->readLock>=0 ){
70245 (void)sqlite3WalEndWriteTransaction(pWal);
70246 walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock));
70247 pWal->readLock = -1;
70248 }
70249 }
70250
@@ -71138,11 +71147,11 @@
71147
71148 walDisableBlocking(pWal);
71149 sqlite3WalDb(pWal, 0);
71150
71151 /* Release the locks. */
71152 (void)sqlite3WalEndWriteTransaction(pWal);
71153 if( pWal->ckptLock ){
71154 walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
71155 pWal->ckptLock = 0;
71156 }
71157 WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok"));
@@ -85966,10 +85975,11 @@
85975 testcase( nAlloc==31 );
85976 testcase( nAlloc==32 );
85977 if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
85978 return SQLITE_NOMEM_BKPT;
85979 }
85980 assert( pMem->z!=0 );
85981 memcpy(pMem->z, z, nAlloc);
85982 }else{
85983 sqlite3VdbeMemRelease(pMem);
85984 pMem->z = (char *)z;
85985 if( xDel==SQLITE_DYNAMIC ){
@@ -92337,11 +92347,11 @@
92347
92348 preupdate.v = v;
92349 preupdate.pCsr = pCsr;
92350 preupdate.op = op;
92351 preupdate.iNewReg = iReg;
92352 preupdate.pKeyinfo = (KeyInfo*)&preupdate.uKey;
92353 preupdate.pKeyinfo->db = db;
92354 preupdate.pKeyinfo->enc = ENC(db);
92355 preupdate.pKeyinfo->nKeyField = pTab->nCol;
92356 preupdate.pKeyinfo->aSortFlags = 0; /* Indicate .aColl, .nAllField uninit */
92357 preupdate.iKey1 = iKey1;
@@ -116253,11 +116263,11 @@
116263 assert( pParse->pVdbe!=0 );
116264 v = pParse->pVdbe;
116265 pAlt = sqlite3ExprSimplifiedAndOr(pExpr);
116266 if( pAlt!=pExpr ){
116267 r1 = sqlite3ExprCodeTarget(pParse, pAlt, target);
116268 sqlite3VdbeAddOp3(v, OP_And, r1, r1, target);
116269 return target;
116270 }
116271 skipOp = op==TK_AND ? OP_IfNot : OP_If;
116272 if( exprEvalRhsFirst(pExpr) ){
116273 /* Compute the right operand first. Skip the computation of the left
@@ -153547,10 +153557,11 @@
153557 nExtra++; /* One extra column for the OP_Sequence */
153558 }
153559 if( pFunc->bOBPayload ){
153560 /* extra columns for the function arguments */
153561 assert( ExprUseXList(pFunc->pFExpr) );
153562 assert( pFunc->pFExpr->x.pList!=0 );
153563 nExtra += pFunc->pFExpr->x.pList->nExpr;
153564 }
153565 if( pFunc->bUseSubtype ){
153566 nExtra += pFunc->pFExpr->x.pList->nExpr;
153567 }
@@ -260266,11 +260277,11 @@
260277 int nArg, /* Number of args */
260278 sqlite3_value **apUnused /* Function arguments */
260279 ){
260280 assert( nArg==0 );
260281 UNUSED_PARAM2(nArg, apUnused);
260282 sqlite3_result_text(pCtx, "fts5: 2025-10-30 11:39:49 c833f26a6780f919551e50c67d308e96293cec8481899354411d805617481f24", -1, SQLITE_TRANSIENT);
260283 }
260284
260285 /*
260286 ** Implementation of fts5_locale(LOCALE, TEXT) function.
260287 **
260288
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
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-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060"
151
+#define SQLITE_SOURCE_ID "2025-10-31 13:44:51 c1aa52361b8ede611f64b96f2394174389ce531b1d86b9cfec91d3b03c94f6ea"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2025-10-28T13:24:50.858Z"
154
+#define SQLITE_SCM_DATETIME "2025-10-31T13:44:51.646Z"
155155
156156
/*
157157
** CAPI3REF: Run-Time Library Version Numbers
158158
** KEYWORDS: sqlite3_version sqlite3_sourceid
159159
**
160160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
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-10-28 13:24:50 724f2299f206cc9e7f830f984c50a8fc4ac1c17210d71d9affe657b45252b060"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2025-10-28T13:24:50.858Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
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-10-31 13:44:51 c1aa52361b8ede611f64b96f2394174389ce531b1d86b9cfec91d3b03c94f6ea"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2025-10-31T13:44:51.646Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160

Keyboard Shortcuts

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