Fossil SCM

Update the built-in SQLite to the latest 3.52.0 beta, for testing.

drh 2026-02-28 01:09 trunk
Commit 73512f45dbf51ba27e0cb1e842c04356cf8eb41b410c03b8063a9ba0047873ad
+1 -1
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3489,11 +3489,11 @@
34893489
zVal = sqlite3_str_value(pVal);
34903490
if( zVal==0 ) zVal = "";
34913491
do{
34923492
int nThis, nWide, iNext;
34933493
qrfWrapLine(zVal, mxW, bWW, &nThis, &nWide, &iNext);
3494
- if( cnt ) sqlite3_str_appendchar(p->pOut,p->u.sLine.mxColWth+3,' ');
3494
+ if( cnt ) sqlite3_str_appendchar(p->pOut,p->u.sLine.mxColWth+2,' ');
34953495
cnt++;
34963496
if( cnt>p->mxHeight ){
34973497
zVal = "...";
34983498
nThis = iNext = 3;
34993499
}
35003500
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3489,11 +3489,11 @@
3489 zVal = sqlite3_str_value(pVal);
3490 if( zVal==0 ) zVal = "";
3491 do{
3492 int nThis, nWide, iNext;
3493 qrfWrapLine(zVal, mxW, bWW, &nThis, &nWide, &iNext);
3494 if( cnt ) sqlite3_str_appendchar(p->pOut,p->u.sLine.mxColWth+3,' ');
3495 cnt++;
3496 if( cnt>p->mxHeight ){
3497 zVal = "...";
3498 nThis = iNext = 3;
3499 }
3500
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3489,11 +3489,11 @@
3489 zVal = sqlite3_str_value(pVal);
3490 if( zVal==0 ) zVal = "";
3491 do{
3492 int nThis, nWide, iNext;
3493 qrfWrapLine(zVal, mxW, bWW, &nThis, &nWide, &iNext);
3494 if( cnt ) sqlite3_str_appendchar(p->pOut,p->u.sLine.mxColWth+2,' ');
3495 cnt++;
3496 if( cnt>p->mxHeight ){
3497 zVal = "...";
3498 nThis = iNext = 3;
3499 }
3500
+80 -55
--- 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
-** 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4 with changes in files:
21
+** 0780bce854b962fb2d4a1a19c55c9b5790a9 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.52.0"
471471
#define SQLITE_VERSION_NUMBER 3052000
472
-#define SQLITE_SOURCE_ID "2026-02-23 19:51:54 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4e29f95764fe1027d4d8706a41480"
472
+#define SQLITE_SOURCE_ID "2026-02-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
473473
#define SQLITE_SCM_BRANCH "trunk"
474474
#define SQLITE_SCM_TAGS ""
475
-#define SQLITE_SCM_DATETIME "2026-02-23T19:51:54.706Z"
475
+#define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
476476
477477
/*
478478
** CAPI3REF: Run-Time Library Version Numbers
479479
** KEYWORDS: sqlite3_version sqlite3_sourceid
480480
**
@@ -4772,23 +4772,24 @@
47724772
** fails, the sqlite3_prepare_v3() call returns the same error indications
47734773
** with or without this flag; it just omits the call to [sqlite3_log()] that
47744774
** logs the error.
47754775
**
47764776
** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4777
-** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to behave as if
4778
-** the SQL statement is part of a database schema. This makes a difference
4779
-** when the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] option is set to off.
4780
-** When this option is used and SQLITE_DBCONFIG_TRUSTED_SCHEMA is off,
4781
-** SQL functions may not be called unless they are tagged with
4782
-** [SQLITE_INNOCUOUS] and virtual tables may not be used unless tagged
4783
-** with [SQLITE_VTAB_INNOCUOUS]. Use the SQLITE_PREPARE_FROM_DDL option
4784
-** when preparing SQL that is derived from parts of the database
4785
-** schema. In particular, virtual table implementations that
4786
-** run SQL statements based on the arguments to their CREATE VIRTUAL
4787
-** TABLE statement should use [sqlite3_prepare_v3()] and set the
4788
-** SQLITE_PREPARE_FROM_DLL flag to prevent bypass of the
4789
-** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
4777
+** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to enforce
4778
+** security constraints that would otherwise only be enforced when parsing
4779
+** the database schema. In other words, the SQLITE_PREPARE_FROM_DDL flag
4780
+** causes the SQL compiler to treat the SQL statement being prepared as if
4781
+** it had come from an attacker. When SQLITE_PREPARE_FROM_DDL is used and
4782
+** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] is off, SQL functions may only be called
4783
+** if they are tagged with [SQLITE_INNOCUOUS] and virtual tables may only
4784
+** be used if they are tagged with [SQLITE_VTAB_INNOCUOUS]. Best practice
4785
+** is to use the SQLITE_PREPARE_FROM_DDL option when preparing any SQL that
4786
+** is derived from parts of the database schema. In particular, virtual
4787
+** table implementations that run SQL statements that are derived from
4788
+** arguments to their CREATE VIRTUAL TABLE statement should always use
4789
+** [sqlite3_prepare_v3()] and set the SQLITE_PREPARE_FROM_DDL flag to
4790
+** prevent bypass of the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
47904791
** </dl>
47914792
*/
47924793
#define SQLITE_PREPARE_PERSISTENT 0x01
47934794
#define SQLITE_PREPARE_NORMALIZE 0x02
47944795
#define SQLITE_PREPARE_NO_VTAB 0x04
@@ -17949,14 +17950,14 @@
1794917950
void *pData; /* Page data */
1795017951
void *pExtra; /* Extra content */
1795117952
PCache *pCache; /* PRIVATE: Cache that owns this page */
1795217953
PgHdr *pDirty; /* Transient list of dirty sorted by pgno */
1795317954
Pager *pPager; /* The pager this page is part of */
17954
- Pgno pgno; /* Page number for this page */
1795517955
#ifdef SQLITE_CHECK_PAGES
17956
- u32 pageHash; /* Hash of page content */
17956
+ u64 pageHash; /* Hash of page content */
1795717957
#endif
17958
+ Pgno pgno; /* Page number for this page */
1795817959
u16 flags; /* PGHDR flags defined below */
1795917960
1796017961
/**********************************************************************
1796117962
** Elements above, except pCache, are public. All that follow are
1796217963
** private to pcache.c and should not be accessed by other modules.
@@ -21541,11 +21542,24 @@
2154121542
2154221543
/* Access to mutexes used by sqlite3_status() */
2154321544
SQLITE_PRIVATE sqlite3_mutex *sqlite3Pcache1Mutex(void);
2154421545
SQLITE_PRIVATE sqlite3_mutex *sqlite3MallocMutex(void);
2154521546
21546
-#if defined(SQLITE_ENABLE_MULTITHREADED_CHECKS) && !defined(SQLITE_MUTEX_OMIT)
21547
+
21548
+/* The SQLITE_THREAD_MISUSE_WARNINGS compile-time option used to be called
21549
+** SQLITE_ENABLE_MULTITHREADED_CHECKS. Keep that older macro for backwards
21550
+** compatibility, at least for a while... */
21551
+#ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
21552
+# define SQLITE_THREAD_MISUSE_WARNINGS 1
21553
+#endif
21554
+
21555
+/* SQLITE_THREAD_MISUSE_ABORT implies SQLITE_THREAD_MISUSE_WARNINGS */
21556
+#ifdef SQLITE_THREAD_MISUSE_ABORT
21557
+# define SQLITE_THREAD_MISUSE_WARNINGS 1
21558
+#endif
21559
+
21560
+#if defined(SQLITE_THREAD_MISUSE_WARNINGS) && !defined(SQLITE_MUTEX_OMIT)
2154721561
SQLITE_PRIVATE void sqlite3MutexWarnOnContention(sqlite3_mutex*);
2154821562
#else
2154921563
# define sqlite3MutexWarnOnContention(x)
2155021564
#endif
2155121565
@@ -26951,11 +26965,11 @@
2695126965
DateTime x;
2695226966
if( isDate(context, argc, argv, &x)==0 ){
2695326967
char *zJson;
2695426968
zJson = sqlite3_mprintf(
2695526969
"{iJD:%lld,Y:%d,M:%d,D:%d,h:%d,m:%d,tz:%d,"
26956
- "s:%.3f,validJD:%d,validYMS:%d,validHMS:%d,"
26970
+ "s:%.3f,validJD:%d,validYMD:%d,validHMS:%d,"
2695726971
"nFloor:%d,rawS:%d,isError:%d,useSubsec:%d,"
2695826972
"isUtc:%d,isLocal:%d}",
2695926973
x.iJD, x.Y, x.M, x.D, x.h, x.m, x.tz,
2696026974
x.s, x.validJD, x.validYMD, x.validHMS,
2696126975
x.nFloor, x.rawS, x.isError, x.useSubsec,
@@ -29730,27 +29744,32 @@
2973029744
#endif /* SQLITE_DEBUG && !defined(SQLITE_MUTEX_OMIT) */
2973129745
2973229746
2973329747
#ifndef SQLITE_MUTEX_OMIT
2973429748
29735
-#ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
29749
+#ifdef SQLITE_THREAD_MISUSE_WARNINGS
2973629750
/*
29737
-** This block (enclosed by SQLITE_ENABLE_MULTITHREADED_CHECKS) contains
29751
+** This block (enclosed by SQLITE_THREAD_MISUSE_WARNINGS) contains
2973829752
** the implementation of a wrapper around the system default mutex
2973929753
** implementation (sqlite3DefaultMutex()).
2974029754
**
2974129755
** Most calls are passed directly through to the underlying default
2974229756
** mutex implementation. Except, if a mutex is configured by calling
2974329757
** sqlite3MutexWarnOnContention() on it, then if contention is ever
29744
-** encountered within xMutexEnter() a warning is emitted via sqlite3_log().
29758
+** encountered within xMutexEnter() then a warning is emitted via
29759
+** sqlite3_log(). Furthermore, if SQLITE_THREAD_MISUSE_ABORT is
29760
+** defined then abort() is called after the sqlite3_log() warning.
2974529761
**
29746
-** This type of mutex is used as the database handle mutex when testing
29747
-** apps that usually use SQLITE_CONFIG_MULTITHREAD mode.
29762
+** This type of mutex is used on the database handle mutex when testing
29763
+** apps that usually use SQLITE_CONFIG_MULTITHREAD mode. A failure
29764
+** indicates that the app ought to be using SQLITE_OPEN_FULLMUTEX or
29765
+** similar because it is trying to use the same database handle from
29766
+** two different connections at the same time.
2974829767
*/
2974929768
2975029769
/*
29751
-** Type for all mutexes used when SQLITE_ENABLE_MULTITHREADED_CHECKS
29770
+** Type for all mutexes used when SQLITE_THREAD_MISUSE_WARNINGS
2975229771
** is defined. Variable CheckMutex.mutex is a pointer to the real mutex
2975329772
** allocated by the system mutex implementation. Variable iType is usually set
2975429773
** to the type of mutex requested - SQLITE_MUTEX_RECURSIVE, SQLITE_MUTEX_FAST
2975529774
** or one of the static mutex identifiers. Or, if this is a recursive mutex
2975629775
** that has been configured using sqlite3MutexWarnOnContention(), it is
@@ -29863,10 +29882,13 @@
2986329882
return;
2986429883
}
2986529884
sqlite3_log(SQLITE_MISUSE,
2986629885
"illegal multi-threaded access to database connection"
2986729886
);
29887
+#if SQLITE_THREAD_MISUSE_ABORT
29888
+ abort();
29889
+#endif
2986829890
}
2986929891
pGlobalMutexMethods->xMutexEnter(pCheck->mutex);
2987029892
}
2987129893
2987229894
/*
@@ -29914,11 +29936,11 @@
2991429936
CheckMutex *pCheck = (CheckMutex*)p;
2991529937
assert( pCheck->iType==SQLITE_MUTEX_RECURSIVE );
2991629938
pCheck->iType = SQLITE_MUTEX_WARNONCONTENTION;
2991729939
}
2991829940
}
29919
-#endif /* ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS */
29941
+#endif /* ifdef SQLITE_THREAD_MISUSE_WARNINGS */
2992029942
2992129943
/*
2992229944
** Initialize the mutex system.
2992329945
*/
2992429946
SQLITE_PRIVATE int sqlite3MutexInit(void){
@@ -29931,11 +29953,11 @@
2993129953
*/
2993229954
sqlite3_mutex_methods const *pFrom;
2993329955
sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
2993429956
2993529957
if( sqlite3GlobalConfig.bCoreMutex ){
29936
-#ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
29958
+#ifdef SQLITE_THREAD_MISUSE_WARNINGS
2993729959
pFrom = multiThreadedCheckMutex();
2993829960
#else
2993929961
pFrom = sqlite3DefaultMutex();
2994029962
#endif
2994129963
}else{
@@ -36570,32 +36592,32 @@
3657036592
0xa56fa5b99019a5c8LLU, /* 26: 1.0e+26 >> 23 */
3657136593
};
3657236594
static const u64 aScale[] = {
3657336595
0x8049a4ac0c5811aeLLU, /* 0: 1.0e-351 << 1229 */
3657436596
0xcf42894a5dce35eaLLU, /* 1: 1.0e-324 << 1140 */
36575
- 0xa76c582338ed2621LLU, /* 2: 1.0e-297 << 1050 */
36597
+ 0xa76c582338ed2622LLU, /* 2: 1.0e-297 << 1050 */
3657636598
0x873e4f75e2224e68LLU, /* 3: 1.0e-270 << 960 */
36577
- 0xda7f5bf590966848LLU, /* 4: 1.0e-243 << 871 */
36578
- 0xb080392cc4349decLLU, /* 5: 1.0e-216 << 781 */
36599
+ 0xda7f5bf590966849LLU, /* 4: 1.0e-243 << 871 */
36600
+ 0xb080392cc4349dedLLU, /* 5: 1.0e-216 << 781 */
3657936601
0x8e938662882af53eLLU, /* 6: 1.0e-189 << 691 */
3658036602
0xe65829b3046b0afaLLU, /* 7: 1.0e-162 << 602 */
36581
- 0xba121a4650e4ddebLLU, /* 8: 1.0e-135 << 512 */
36603
+ 0xba121a4650e4ddecLLU, /* 8: 1.0e-135 << 512 */
3658236604
0x964e858c91ba2655LLU, /* 9: 1.0e-108 << 422 */
36583
- 0xf2d56790ab41c2a2LLU, /* 10: 1.0e-81 << 333 */
36584
- 0xc428d05aa4751e4cLLU, /* 11: 1.0e-54 << 243 */
36605
+ 0xf2d56790ab41c2a3LLU, /* 10: 1.0e-81 << 333 */
36606
+ 0xc428d05aa4751e4dLLU, /* 11: 1.0e-54 << 243 */
3658536607
0x9e74d1b791e07e48LLU, /* 12: 1.0e-27 << 153 */
3658636608
0x8000000000000000LLU, /* 13: 1.0e+0 << 63 */
3658736609
0xcecb8f27f4200f3aLLU, /* 14: 1.0e+27 >> 26 */
36588
- 0xa70c3c40a64e6c51LLU, /* 15: 1.0e+54 >> 116 */
36610
+ 0xa70c3c40a64e6c52LLU, /* 15: 1.0e+54 >> 116 */
3658936611
0x86f0ac99b4e8dafdLLU, /* 16: 1.0e+81 >> 206 */
36590
- 0xda01ee641a708de9LLU, /* 17: 1.0e+108 >> 295 */
36612
+ 0xda01ee641a708deaLLU, /* 17: 1.0e+108 >> 295 */
3659136613
0xb01ae745b101e9e4LLU, /* 18: 1.0e+135 >> 385 */
3659236614
0x8e41ade9fbebc27dLLU, /* 19: 1.0e+162 >> 475 */
36593
- 0xe5d3ef282a242e81LLU, /* 20: 1.0e+189 >> 564 */
36615
+ 0xe5d3ef282a242e82LLU, /* 20: 1.0e+189 >> 564 */
3659436616
0xb9a74a0637ce2ee1LLU, /* 21: 1.0e+216 >> 654 */
3659536617
0x95f83d0a1fb69cd9LLU, /* 22: 1.0e+243 >> 744 */
36596
- 0xf24a01a73cf2dccfLLU, /* 23: 1.0e+270 >> 833 */
36618
+ 0xf24a01a73cf2dcd0LLU, /* 23: 1.0e+270 >> 833 */
3659736619
0xc3b8358109e84f07LLU, /* 24: 1.0e+297 >> 923 */
3659836620
0x9e19db92b4e31ba9LLU, /* 25: 1.0e+324 >> 1013 */
3659936621
};
3660036622
int g, n;
3660136623
u64 x, y;
@@ -36618,11 +36640,11 @@
3661836640
if( n==0 ){
3661936641
return y;
3662036642
}
3662136643
x = sqlite3Multiply128(aBase[n],y);
3662236644
if( (U64_BIT(63) & x)==0 ){
36623
- x <<= 1;
36645
+ x = (x<<1)|1;
3662436646
}
3662536647
return x;
3662636648
}
3662736649
3662836650
/*
@@ -36725,11 +36747,11 @@
3672536747
e1--;
3672636748
}
3672736749
if( e1<=(-972) ){
3672836750
return INFINITY;
3672936751
}
36730
- out = (out + 1 + ((out>>2)&1)) >> 2;
36752
+ out = (out + 1) >> 2;
3673136753
if( (out & U64_BIT(52))!=0 ){
3673236754
out = (out & ~U64_BIT(52)) | ((u64)(1075-e1)<<52);
3673336755
}
3673436756
memcpy(&r, &out, 8);
3673536757
return r;
@@ -60272,21 +60294,21 @@
6027260294
** on the cache using a hash function. This is used for testing
6027360295
** and debugging only.
6027460296
*/
6027560297
#ifdef SQLITE_CHECK_PAGES
6027660298
/*
60277
-** Return a 32-bit hash of the page data for pPage.
60299
+** Return a 64-bit hash of the page data for pPage.
6027860300
*/
60279
-static u32 pager_datahash(int nByte, unsigned char *pData){
60280
- u32 hash = 0;
60301
+static u64 pager_datahash(int nByte, unsigned char *pData){
60302
+ u64 hash = 0;
6028160303
int i;
6028260304
for(i=0; i<nByte; i++){
6028360305
hash = (hash*1039) + pData[i];
6028460306
}
6028560307
return hash;
6028660308
}
60287
-static u32 pager_pagehash(PgHdr *pPage){
60309
+static u64 pager_pagehash(PgHdr *pPage){
6028860310
return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData);
6028960311
}
6029060312
static void pager_set_pagehash(PgHdr *pPage){
6029160313
pPage->pageHash = pager_pagehash(pPage);
6029260314
}
@@ -85002,18 +85024,19 @@
8500285024
*/
8500385025
static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){
8500485026
StrAccum acc;
8500585027
assert( p->flags & (MEM_Int|MEM_Real|MEM_IntReal) );
8500685028
assert( sz>22 );
85007
- if( p->flags & (MEM_Int|MEM_IntReal) ){
85008
-#if 0
85009
- /* Work-around for GCC bug
85010
- ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270.
85011
- ** Bug fixed circa 2020, so this work-around removed in 2026. */
85029
+ if( p->flags & (MEM_Int|MEM_IntReal) ){
85030
+#if GCC_VERSION>=7000000 && GCC_VERSION<15000000 && defined(__i386__)
85031
+ /* Work-around for GCC bug or bugs:
85032
+ ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270
85033
+ ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659
85034
+ ** The problem appears to be fixed in GCC 15 */
8501285035
i64 x;
85013
- assert( (p->flags&MEM_Int)*2==sizeof(x) );
85014
- memcpy(&x, (char*)&p->u, (p->flags&MEM_Int)*2);
85036
+ assert( (MEM_Str&~p->flags)*4==sizeof(x) );
85037
+ memcpy(&x, (char*)&p->u, (MEM_Str&~p->flags)*4);
8501585038
p->n = sqlite3Int64ToText(x, zBuf);
8501685039
#else
8501785040
p->n = sqlite3Int64ToText(p->u.i, zBuf);
8501885041
#endif
8501985042
if( p->flags & MEM_IntReal ){
@@ -135184,10 +135207,12 @@
135184135207
}
135185135208
for(nArg=2; nArg<=3; nArg++){
135186135209
sqlite3CreateFunc(db, "like", nArg, SQLITE_UTF8, pInfo, likeFunc,
135187135210
0, 0, 0, 0, 0);
135188135211
pDef = sqlite3FindFunction(db, "like", nArg, SQLITE_UTF8, 0);
135212
+ assert( pDef!=0 ); /* The sqlite3CreateFunc() call above cannot fail
135213
+ ** because the "like" SQL-function already exists */
135189135214
pDef->funcFlags |= flags;
135190135215
pDef->funcFlags &= ~SQLITE_FUNC_UNSAFE;
135191135216
}
135192135217
}
135193135218
@@ -147881,11 +147906,11 @@
147881147906
** how to process the DISTINCT keyword, to simplify passing that information
147882147907
** into the selectInnerLoop() routine.
147883147908
*/
147884147909
typedef struct DistinctCtx DistinctCtx;
147885147910
struct DistinctCtx {
147886
- u8 isTnct; /* 0: Not distinct. 1: DISTICT 2: DISTINCT and ORDER BY */
147911
+ u8 isTnct; /* 0: Not distinct. 1: DISTINCT 2: DISTINCT and ORDER BY */
147887147912
u8 eTnctType; /* One of the WHERE_DISTINCT_* operators */
147888147913
int tabTnct; /* Ephemeral table used for DISTINCT processing */
147889147914
int addrTnct; /* Address of OP_OpenEphemeral opcode for tabTnct */
147890147915
};
147891147916
@@ -170861,11 +170886,11 @@
170861170886
testcase( pLhs->iColumn==XN_ROWID );
170862170887
aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
170863170888
idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
170864170889
if( aff!=idxaff ) break;
170865170890
170866
- pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
170891
+ pColl = sqlite3ExprCompareCollSeq(pParse, pTerm->pExpr);
170867170892
if( pColl==0 ) break;
170868170893
if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
170869170894
}
170870170895
return i;
170871170896
}
@@ -189580,11 +189605,11 @@
189580189605
189581189606
/* Allocate the sqlite data structure */
189582189607
db = sqlite3MallocZero( sizeof(sqlite3) );
189583189608
if( db==0 ) goto opendb_out;
189584189609
if( isThreadsafe
189585
-#ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
189610
+#if defined(SQLITE_THREAD_MISUSE_WARNINGS)
189586189611
|| sqlite3GlobalConfig.bCoreMutex
189587189612
#endif
189588189613
){
189589189614
db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
189590189615
if( db->mutex==0 ){
@@ -261831,11 +261856,11 @@
261831261856
int nArg, /* Number of args */
261832261857
sqlite3_value **apUnused /* Function arguments */
261833261858
){
261834261859
assert( nArg==0 );
261835261860
UNUSED_PARAM2(nArg, apUnused);
261836
- sqlite3_result_text(pCtx, "fts5: 2026-02-23 13:29:29 5da9bf09cc00faf98cc515fb5a10a0af325b8f7608893808d031dfef62380be2", -1, SQLITE_TRANSIENT);
261861
+ sqlite3_result_text(pCtx, "fts5: 2026-02-27 11:36:43 7c5f4dcd748baa60097bbf68d7aca99cc959bb1f7da92bd9ad86a4425a37d391", -1, SQLITE_TRANSIENT);
261837261862
}
261838261863
261839261864
/*
261840261865
** Implementation of fts5_locale(LOCALE, TEXT) function.
261841261866
**
261842261867
--- 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 ** 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4 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.52.0"
471 #define SQLITE_VERSION_NUMBER 3052000
472 #define SQLITE_SOURCE_ID "2026-02-23 19:51:54 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4e29f95764fe1027d4d8706a41480"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-02-23T19:51:54.706Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -4772,23 +4772,24 @@
4772 ** fails, the sqlite3_prepare_v3() call returns the same error indications
4773 ** with or without this flag; it just omits the call to [sqlite3_log()] that
4774 ** logs the error.
4775 **
4776 ** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4777 ** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to behave as if
4778 ** the SQL statement is part of a database schema. This makes a difference
4779 ** when the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] option is set to off.
4780 ** When this option is used and SQLITE_DBCONFIG_TRUSTED_SCHEMA is off,
4781 ** SQL functions may not be called unless they are tagged with
4782 ** [SQLITE_INNOCUOUS] and virtual tables may not be used unless tagged
4783 ** with [SQLITE_VTAB_INNOCUOUS]. Use the SQLITE_PREPARE_FROM_DDL option
4784 ** when preparing SQL that is derived from parts of the database
4785 ** schema. In particular, virtual table implementations that
4786 ** run SQL statements based on the arguments to their CREATE VIRTUAL
4787 ** TABLE statement should use [sqlite3_prepare_v3()] and set the
4788 ** SQLITE_PREPARE_FROM_DLL flag to prevent bypass of the
4789 ** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
 
4790 ** </dl>
4791 */
4792 #define SQLITE_PREPARE_PERSISTENT 0x01
4793 #define SQLITE_PREPARE_NORMALIZE 0x02
4794 #define SQLITE_PREPARE_NO_VTAB 0x04
@@ -17949,14 +17950,14 @@
17949 void *pData; /* Page data */
17950 void *pExtra; /* Extra content */
17951 PCache *pCache; /* PRIVATE: Cache that owns this page */
17952 PgHdr *pDirty; /* Transient list of dirty sorted by pgno */
17953 Pager *pPager; /* The pager this page is part of */
17954 Pgno pgno; /* Page number for this page */
17955 #ifdef SQLITE_CHECK_PAGES
17956 u32 pageHash; /* Hash of page content */
17957 #endif
 
17958 u16 flags; /* PGHDR flags defined below */
17959
17960 /**********************************************************************
17961 ** Elements above, except pCache, are public. All that follow are
17962 ** private to pcache.c and should not be accessed by other modules.
@@ -21541,11 +21542,24 @@
21541
21542 /* Access to mutexes used by sqlite3_status() */
21543 SQLITE_PRIVATE sqlite3_mutex *sqlite3Pcache1Mutex(void);
21544 SQLITE_PRIVATE sqlite3_mutex *sqlite3MallocMutex(void);
21545
21546 #if defined(SQLITE_ENABLE_MULTITHREADED_CHECKS) && !defined(SQLITE_MUTEX_OMIT)
 
 
 
 
 
 
 
 
 
 
 
 
 
21547 SQLITE_PRIVATE void sqlite3MutexWarnOnContention(sqlite3_mutex*);
21548 #else
21549 # define sqlite3MutexWarnOnContention(x)
21550 #endif
21551
@@ -26951,11 +26965,11 @@
26951 DateTime x;
26952 if( isDate(context, argc, argv, &x)==0 ){
26953 char *zJson;
26954 zJson = sqlite3_mprintf(
26955 "{iJD:%lld,Y:%d,M:%d,D:%d,h:%d,m:%d,tz:%d,"
26956 "s:%.3f,validJD:%d,validYMS:%d,validHMS:%d,"
26957 "nFloor:%d,rawS:%d,isError:%d,useSubsec:%d,"
26958 "isUtc:%d,isLocal:%d}",
26959 x.iJD, x.Y, x.M, x.D, x.h, x.m, x.tz,
26960 x.s, x.validJD, x.validYMD, x.validHMS,
26961 x.nFloor, x.rawS, x.isError, x.useSubsec,
@@ -29730,27 +29744,32 @@
29730 #endif /* SQLITE_DEBUG && !defined(SQLITE_MUTEX_OMIT) */
29731
29732
29733 #ifndef SQLITE_MUTEX_OMIT
29734
29735 #ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
29736 /*
29737 ** This block (enclosed by SQLITE_ENABLE_MULTITHREADED_CHECKS) contains
29738 ** the implementation of a wrapper around the system default mutex
29739 ** implementation (sqlite3DefaultMutex()).
29740 **
29741 ** Most calls are passed directly through to the underlying default
29742 ** mutex implementation. Except, if a mutex is configured by calling
29743 ** sqlite3MutexWarnOnContention() on it, then if contention is ever
29744 ** encountered within xMutexEnter() a warning is emitted via sqlite3_log().
 
 
29745 **
29746 ** This type of mutex is used as the database handle mutex when testing
29747 ** apps that usually use SQLITE_CONFIG_MULTITHREAD mode.
 
 
 
29748 */
29749
29750 /*
29751 ** Type for all mutexes used when SQLITE_ENABLE_MULTITHREADED_CHECKS
29752 ** is defined. Variable CheckMutex.mutex is a pointer to the real mutex
29753 ** allocated by the system mutex implementation. Variable iType is usually set
29754 ** to the type of mutex requested - SQLITE_MUTEX_RECURSIVE, SQLITE_MUTEX_FAST
29755 ** or one of the static mutex identifiers. Or, if this is a recursive mutex
29756 ** that has been configured using sqlite3MutexWarnOnContention(), it is
@@ -29863,10 +29882,13 @@
29863 return;
29864 }
29865 sqlite3_log(SQLITE_MISUSE,
29866 "illegal multi-threaded access to database connection"
29867 );
 
 
 
29868 }
29869 pGlobalMutexMethods->xMutexEnter(pCheck->mutex);
29870 }
29871
29872 /*
@@ -29914,11 +29936,11 @@
29914 CheckMutex *pCheck = (CheckMutex*)p;
29915 assert( pCheck->iType==SQLITE_MUTEX_RECURSIVE );
29916 pCheck->iType = SQLITE_MUTEX_WARNONCONTENTION;
29917 }
29918 }
29919 #endif /* ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS */
29920
29921 /*
29922 ** Initialize the mutex system.
29923 */
29924 SQLITE_PRIVATE int sqlite3MutexInit(void){
@@ -29931,11 +29953,11 @@
29931 */
29932 sqlite3_mutex_methods const *pFrom;
29933 sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
29934
29935 if( sqlite3GlobalConfig.bCoreMutex ){
29936 #ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
29937 pFrom = multiThreadedCheckMutex();
29938 #else
29939 pFrom = sqlite3DefaultMutex();
29940 #endif
29941 }else{
@@ -36570,32 +36592,32 @@
36570 0xa56fa5b99019a5c8LLU, /* 26: 1.0e+26 >> 23 */
36571 };
36572 static const u64 aScale[] = {
36573 0x8049a4ac0c5811aeLLU, /* 0: 1.0e-351 << 1229 */
36574 0xcf42894a5dce35eaLLU, /* 1: 1.0e-324 << 1140 */
36575 0xa76c582338ed2621LLU, /* 2: 1.0e-297 << 1050 */
36576 0x873e4f75e2224e68LLU, /* 3: 1.0e-270 << 960 */
36577 0xda7f5bf590966848LLU, /* 4: 1.0e-243 << 871 */
36578 0xb080392cc4349decLLU, /* 5: 1.0e-216 << 781 */
36579 0x8e938662882af53eLLU, /* 6: 1.0e-189 << 691 */
36580 0xe65829b3046b0afaLLU, /* 7: 1.0e-162 << 602 */
36581 0xba121a4650e4ddebLLU, /* 8: 1.0e-135 << 512 */
36582 0x964e858c91ba2655LLU, /* 9: 1.0e-108 << 422 */
36583 0xf2d56790ab41c2a2LLU, /* 10: 1.0e-81 << 333 */
36584 0xc428d05aa4751e4cLLU, /* 11: 1.0e-54 << 243 */
36585 0x9e74d1b791e07e48LLU, /* 12: 1.0e-27 << 153 */
36586 0x8000000000000000LLU, /* 13: 1.0e+0 << 63 */
36587 0xcecb8f27f4200f3aLLU, /* 14: 1.0e+27 >> 26 */
36588 0xa70c3c40a64e6c51LLU, /* 15: 1.0e+54 >> 116 */
36589 0x86f0ac99b4e8dafdLLU, /* 16: 1.0e+81 >> 206 */
36590 0xda01ee641a708de9LLU, /* 17: 1.0e+108 >> 295 */
36591 0xb01ae745b101e9e4LLU, /* 18: 1.0e+135 >> 385 */
36592 0x8e41ade9fbebc27dLLU, /* 19: 1.0e+162 >> 475 */
36593 0xe5d3ef282a242e81LLU, /* 20: 1.0e+189 >> 564 */
36594 0xb9a74a0637ce2ee1LLU, /* 21: 1.0e+216 >> 654 */
36595 0x95f83d0a1fb69cd9LLU, /* 22: 1.0e+243 >> 744 */
36596 0xf24a01a73cf2dccfLLU, /* 23: 1.0e+270 >> 833 */
36597 0xc3b8358109e84f07LLU, /* 24: 1.0e+297 >> 923 */
36598 0x9e19db92b4e31ba9LLU, /* 25: 1.0e+324 >> 1013 */
36599 };
36600 int g, n;
36601 u64 x, y;
@@ -36618,11 +36640,11 @@
36618 if( n==0 ){
36619 return y;
36620 }
36621 x = sqlite3Multiply128(aBase[n],y);
36622 if( (U64_BIT(63) & x)==0 ){
36623 x <<= 1;
36624 }
36625 return x;
36626 }
36627
36628 /*
@@ -36725,11 +36747,11 @@
36725 e1--;
36726 }
36727 if( e1<=(-972) ){
36728 return INFINITY;
36729 }
36730 out = (out + 1 + ((out>>2)&1)) >> 2;
36731 if( (out & U64_BIT(52))!=0 ){
36732 out = (out & ~U64_BIT(52)) | ((u64)(1075-e1)<<52);
36733 }
36734 memcpy(&r, &out, 8);
36735 return r;
@@ -60272,21 +60294,21 @@
60272 ** on the cache using a hash function. This is used for testing
60273 ** and debugging only.
60274 */
60275 #ifdef SQLITE_CHECK_PAGES
60276 /*
60277 ** Return a 32-bit hash of the page data for pPage.
60278 */
60279 static u32 pager_datahash(int nByte, unsigned char *pData){
60280 u32 hash = 0;
60281 int i;
60282 for(i=0; i<nByte; i++){
60283 hash = (hash*1039) + pData[i];
60284 }
60285 return hash;
60286 }
60287 static u32 pager_pagehash(PgHdr *pPage){
60288 return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData);
60289 }
60290 static void pager_set_pagehash(PgHdr *pPage){
60291 pPage->pageHash = pager_pagehash(pPage);
60292 }
@@ -85002,18 +85024,19 @@
85002 */
85003 static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){
85004 StrAccum acc;
85005 assert( p->flags & (MEM_Int|MEM_Real|MEM_IntReal) );
85006 assert( sz>22 );
85007 if( p->flags & (MEM_Int|MEM_IntReal) ){
85008 #if 0
85009 /* Work-around for GCC bug
85010 ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270.
85011 ** Bug fixed circa 2020, so this work-around removed in 2026. */
 
85012 i64 x;
85013 assert( (p->flags&MEM_Int)*2==sizeof(x) );
85014 memcpy(&x, (char*)&p->u, (p->flags&MEM_Int)*2);
85015 p->n = sqlite3Int64ToText(x, zBuf);
85016 #else
85017 p->n = sqlite3Int64ToText(p->u.i, zBuf);
85018 #endif
85019 if( p->flags & MEM_IntReal ){
@@ -135184,10 +135207,12 @@
135184 }
135185 for(nArg=2; nArg<=3; nArg++){
135186 sqlite3CreateFunc(db, "like", nArg, SQLITE_UTF8, pInfo, likeFunc,
135187 0, 0, 0, 0, 0);
135188 pDef = sqlite3FindFunction(db, "like", nArg, SQLITE_UTF8, 0);
 
 
135189 pDef->funcFlags |= flags;
135190 pDef->funcFlags &= ~SQLITE_FUNC_UNSAFE;
135191 }
135192 }
135193
@@ -147881,11 +147906,11 @@
147881 ** how to process the DISTINCT keyword, to simplify passing that information
147882 ** into the selectInnerLoop() routine.
147883 */
147884 typedef struct DistinctCtx DistinctCtx;
147885 struct DistinctCtx {
147886 u8 isTnct; /* 0: Not distinct. 1: DISTICT 2: DISTINCT and ORDER BY */
147887 u8 eTnctType; /* One of the WHERE_DISTINCT_* operators */
147888 int tabTnct; /* Ephemeral table used for DISTINCT processing */
147889 int addrTnct; /* Address of OP_OpenEphemeral opcode for tabTnct */
147890 };
147891
@@ -170861,11 +170886,11 @@
170861 testcase( pLhs->iColumn==XN_ROWID );
170862 aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
170863 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
170864 if( aff!=idxaff ) break;
170865
170866 pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
170867 if( pColl==0 ) break;
170868 if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
170869 }
170870 return i;
170871 }
@@ -189580,11 +189605,11 @@
189580
189581 /* Allocate the sqlite data structure */
189582 db = sqlite3MallocZero( sizeof(sqlite3) );
189583 if( db==0 ) goto opendb_out;
189584 if( isThreadsafe
189585 #ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
189586 || sqlite3GlobalConfig.bCoreMutex
189587 #endif
189588 ){
189589 db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
189590 if( db->mutex==0 ){
@@ -261831,11 +261856,11 @@
261831 int nArg, /* Number of args */
261832 sqlite3_value **apUnused /* Function arguments */
261833 ){
261834 assert( nArg==0 );
261835 UNUSED_PARAM2(nArg, apUnused);
261836 sqlite3_result_text(pCtx, "fts5: 2026-02-23 13:29:29 5da9bf09cc00faf98cc515fb5a10a0af325b8f7608893808d031dfef62380be2", -1, SQLITE_TRANSIENT);
261837 }
261838
261839 /*
261840 ** Implementation of fts5_locale(LOCALE, TEXT) function.
261841 **
261842
--- 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 ** 0780bce854b962fb2d4a1a19c55c9b5790a9 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.52.0"
471 #define SQLITE_VERSION_NUMBER 3052000
472 #define SQLITE_SOURCE_ID "2026-02-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -4772,23 +4772,24 @@
4772 ** fails, the sqlite3_prepare_v3() call returns the same error indications
4773 ** with or without this flag; it just omits the call to [sqlite3_log()] that
4774 ** logs the error.
4775 **
4776 ** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4777 ** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to enforce
4778 ** security constraints that would otherwise only be enforced when parsing
4779 ** the database schema. In other words, the SQLITE_PREPARE_FROM_DDL flag
4780 ** causes the SQL compiler to treat the SQL statement being prepared as if
4781 ** it had come from an attacker. When SQLITE_PREPARE_FROM_DDL is used and
4782 ** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] is off, SQL functions may only be called
4783 ** if they are tagged with [SQLITE_INNOCUOUS] and virtual tables may only
4784 ** be used if they are tagged with [SQLITE_VTAB_INNOCUOUS]. Best practice
4785 ** is to use the SQLITE_PREPARE_FROM_DDL option when preparing any SQL that
4786 ** is derived from parts of the database schema. In particular, virtual
4787 ** table implementations that run SQL statements that are derived from
4788 ** arguments to their CREATE VIRTUAL TABLE statement should always use
4789 ** [sqlite3_prepare_v3()] and set the SQLITE_PREPARE_FROM_DDL flag to
4790 ** prevent bypass of the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
4791 ** </dl>
4792 */
4793 #define SQLITE_PREPARE_PERSISTENT 0x01
4794 #define SQLITE_PREPARE_NORMALIZE 0x02
4795 #define SQLITE_PREPARE_NO_VTAB 0x04
@@ -17949,14 +17950,14 @@
17950 void *pData; /* Page data */
17951 void *pExtra; /* Extra content */
17952 PCache *pCache; /* PRIVATE: Cache that owns this page */
17953 PgHdr *pDirty; /* Transient list of dirty sorted by pgno */
17954 Pager *pPager; /* The pager this page is part of */
 
17955 #ifdef SQLITE_CHECK_PAGES
17956 u64 pageHash; /* Hash of page content */
17957 #endif
17958 Pgno pgno; /* Page number for this page */
17959 u16 flags; /* PGHDR flags defined below */
17960
17961 /**********************************************************************
17962 ** Elements above, except pCache, are public. All that follow are
17963 ** private to pcache.c and should not be accessed by other modules.
@@ -21541,11 +21542,24 @@
21542
21543 /* Access to mutexes used by sqlite3_status() */
21544 SQLITE_PRIVATE sqlite3_mutex *sqlite3Pcache1Mutex(void);
21545 SQLITE_PRIVATE sqlite3_mutex *sqlite3MallocMutex(void);
21546
21547
21548 /* The SQLITE_THREAD_MISUSE_WARNINGS compile-time option used to be called
21549 ** SQLITE_ENABLE_MULTITHREADED_CHECKS. Keep that older macro for backwards
21550 ** compatibility, at least for a while... */
21551 #ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
21552 # define SQLITE_THREAD_MISUSE_WARNINGS 1
21553 #endif
21554
21555 /* SQLITE_THREAD_MISUSE_ABORT implies SQLITE_THREAD_MISUSE_WARNINGS */
21556 #ifdef SQLITE_THREAD_MISUSE_ABORT
21557 # define SQLITE_THREAD_MISUSE_WARNINGS 1
21558 #endif
21559
21560 #if defined(SQLITE_THREAD_MISUSE_WARNINGS) && !defined(SQLITE_MUTEX_OMIT)
21561 SQLITE_PRIVATE void sqlite3MutexWarnOnContention(sqlite3_mutex*);
21562 #else
21563 # define sqlite3MutexWarnOnContention(x)
21564 #endif
21565
@@ -26951,11 +26965,11 @@
26965 DateTime x;
26966 if( isDate(context, argc, argv, &x)==0 ){
26967 char *zJson;
26968 zJson = sqlite3_mprintf(
26969 "{iJD:%lld,Y:%d,M:%d,D:%d,h:%d,m:%d,tz:%d,"
26970 "s:%.3f,validJD:%d,validYMD:%d,validHMS:%d,"
26971 "nFloor:%d,rawS:%d,isError:%d,useSubsec:%d,"
26972 "isUtc:%d,isLocal:%d}",
26973 x.iJD, x.Y, x.M, x.D, x.h, x.m, x.tz,
26974 x.s, x.validJD, x.validYMD, x.validHMS,
26975 x.nFloor, x.rawS, x.isError, x.useSubsec,
@@ -29730,27 +29744,32 @@
29744 #endif /* SQLITE_DEBUG && !defined(SQLITE_MUTEX_OMIT) */
29745
29746
29747 #ifndef SQLITE_MUTEX_OMIT
29748
29749 #ifdef SQLITE_THREAD_MISUSE_WARNINGS
29750 /*
29751 ** This block (enclosed by SQLITE_THREAD_MISUSE_WARNINGS) contains
29752 ** the implementation of a wrapper around the system default mutex
29753 ** implementation (sqlite3DefaultMutex()).
29754 **
29755 ** Most calls are passed directly through to the underlying default
29756 ** mutex implementation. Except, if a mutex is configured by calling
29757 ** sqlite3MutexWarnOnContention() on it, then if contention is ever
29758 ** encountered within xMutexEnter() then a warning is emitted via
29759 ** sqlite3_log(). Furthermore, if SQLITE_THREAD_MISUSE_ABORT is
29760 ** defined then abort() is called after the sqlite3_log() warning.
29761 **
29762 ** This type of mutex is used on the database handle mutex when testing
29763 ** apps that usually use SQLITE_CONFIG_MULTITHREAD mode. A failure
29764 ** indicates that the app ought to be using SQLITE_OPEN_FULLMUTEX or
29765 ** similar because it is trying to use the same database handle from
29766 ** two different connections at the same time.
29767 */
29768
29769 /*
29770 ** Type for all mutexes used when SQLITE_THREAD_MISUSE_WARNINGS
29771 ** is defined. Variable CheckMutex.mutex is a pointer to the real mutex
29772 ** allocated by the system mutex implementation. Variable iType is usually set
29773 ** to the type of mutex requested - SQLITE_MUTEX_RECURSIVE, SQLITE_MUTEX_FAST
29774 ** or one of the static mutex identifiers. Or, if this is a recursive mutex
29775 ** that has been configured using sqlite3MutexWarnOnContention(), it is
@@ -29863,10 +29882,13 @@
29882 return;
29883 }
29884 sqlite3_log(SQLITE_MISUSE,
29885 "illegal multi-threaded access to database connection"
29886 );
29887 #if SQLITE_THREAD_MISUSE_ABORT
29888 abort();
29889 #endif
29890 }
29891 pGlobalMutexMethods->xMutexEnter(pCheck->mutex);
29892 }
29893
29894 /*
@@ -29914,11 +29936,11 @@
29936 CheckMutex *pCheck = (CheckMutex*)p;
29937 assert( pCheck->iType==SQLITE_MUTEX_RECURSIVE );
29938 pCheck->iType = SQLITE_MUTEX_WARNONCONTENTION;
29939 }
29940 }
29941 #endif /* ifdef SQLITE_THREAD_MISUSE_WARNINGS */
29942
29943 /*
29944 ** Initialize the mutex system.
29945 */
29946 SQLITE_PRIVATE int sqlite3MutexInit(void){
@@ -29931,11 +29953,11 @@
29953 */
29954 sqlite3_mutex_methods const *pFrom;
29955 sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
29956
29957 if( sqlite3GlobalConfig.bCoreMutex ){
29958 #ifdef SQLITE_THREAD_MISUSE_WARNINGS
29959 pFrom = multiThreadedCheckMutex();
29960 #else
29961 pFrom = sqlite3DefaultMutex();
29962 #endif
29963 }else{
@@ -36570,32 +36592,32 @@
36592 0xa56fa5b99019a5c8LLU, /* 26: 1.0e+26 >> 23 */
36593 };
36594 static const u64 aScale[] = {
36595 0x8049a4ac0c5811aeLLU, /* 0: 1.0e-351 << 1229 */
36596 0xcf42894a5dce35eaLLU, /* 1: 1.0e-324 << 1140 */
36597 0xa76c582338ed2622LLU, /* 2: 1.0e-297 << 1050 */
36598 0x873e4f75e2224e68LLU, /* 3: 1.0e-270 << 960 */
36599 0xda7f5bf590966849LLU, /* 4: 1.0e-243 << 871 */
36600 0xb080392cc4349dedLLU, /* 5: 1.0e-216 << 781 */
36601 0x8e938662882af53eLLU, /* 6: 1.0e-189 << 691 */
36602 0xe65829b3046b0afaLLU, /* 7: 1.0e-162 << 602 */
36603 0xba121a4650e4ddecLLU, /* 8: 1.0e-135 << 512 */
36604 0x964e858c91ba2655LLU, /* 9: 1.0e-108 << 422 */
36605 0xf2d56790ab41c2a3LLU, /* 10: 1.0e-81 << 333 */
36606 0xc428d05aa4751e4dLLU, /* 11: 1.0e-54 << 243 */
36607 0x9e74d1b791e07e48LLU, /* 12: 1.0e-27 << 153 */
36608 0x8000000000000000LLU, /* 13: 1.0e+0 << 63 */
36609 0xcecb8f27f4200f3aLLU, /* 14: 1.0e+27 >> 26 */
36610 0xa70c3c40a64e6c52LLU, /* 15: 1.0e+54 >> 116 */
36611 0x86f0ac99b4e8dafdLLU, /* 16: 1.0e+81 >> 206 */
36612 0xda01ee641a708deaLLU, /* 17: 1.0e+108 >> 295 */
36613 0xb01ae745b101e9e4LLU, /* 18: 1.0e+135 >> 385 */
36614 0x8e41ade9fbebc27dLLU, /* 19: 1.0e+162 >> 475 */
36615 0xe5d3ef282a242e82LLU, /* 20: 1.0e+189 >> 564 */
36616 0xb9a74a0637ce2ee1LLU, /* 21: 1.0e+216 >> 654 */
36617 0x95f83d0a1fb69cd9LLU, /* 22: 1.0e+243 >> 744 */
36618 0xf24a01a73cf2dcd0LLU, /* 23: 1.0e+270 >> 833 */
36619 0xc3b8358109e84f07LLU, /* 24: 1.0e+297 >> 923 */
36620 0x9e19db92b4e31ba9LLU, /* 25: 1.0e+324 >> 1013 */
36621 };
36622 int g, n;
36623 u64 x, y;
@@ -36618,11 +36640,11 @@
36640 if( n==0 ){
36641 return y;
36642 }
36643 x = sqlite3Multiply128(aBase[n],y);
36644 if( (U64_BIT(63) & x)==0 ){
36645 x = (x<<1)|1;
36646 }
36647 return x;
36648 }
36649
36650 /*
@@ -36725,11 +36747,11 @@
36747 e1--;
36748 }
36749 if( e1<=(-972) ){
36750 return INFINITY;
36751 }
36752 out = (out + 1) >> 2;
36753 if( (out & U64_BIT(52))!=0 ){
36754 out = (out & ~U64_BIT(52)) | ((u64)(1075-e1)<<52);
36755 }
36756 memcpy(&r, &out, 8);
36757 return r;
@@ -60272,21 +60294,21 @@
60294 ** on the cache using a hash function. This is used for testing
60295 ** and debugging only.
60296 */
60297 #ifdef SQLITE_CHECK_PAGES
60298 /*
60299 ** Return a 64-bit hash of the page data for pPage.
60300 */
60301 static u64 pager_datahash(int nByte, unsigned char *pData){
60302 u64 hash = 0;
60303 int i;
60304 for(i=0; i<nByte; i++){
60305 hash = (hash*1039) + pData[i];
60306 }
60307 return hash;
60308 }
60309 static u64 pager_pagehash(PgHdr *pPage){
60310 return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData);
60311 }
60312 static void pager_set_pagehash(PgHdr *pPage){
60313 pPage->pageHash = pager_pagehash(pPage);
60314 }
@@ -85002,18 +85024,19 @@
85024 */
85025 static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){
85026 StrAccum acc;
85027 assert( p->flags & (MEM_Int|MEM_Real|MEM_IntReal) );
85028 assert( sz>22 );
85029 if( p->flags & (MEM_Int|MEM_IntReal) ){
85030 #if GCC_VERSION>=7000000 && GCC_VERSION<15000000 && defined(__i386__)
85031 /* Work-around for GCC bug or bugs:
85032 ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270
85033 ** https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659
85034 ** The problem appears to be fixed in GCC 15 */
85035 i64 x;
85036 assert( (MEM_Str&~p->flags)*4==sizeof(x) );
85037 memcpy(&x, (char*)&p->u, (MEM_Str&~p->flags)*4);
85038 p->n = sqlite3Int64ToText(x, zBuf);
85039 #else
85040 p->n = sqlite3Int64ToText(p->u.i, zBuf);
85041 #endif
85042 if( p->flags & MEM_IntReal ){
@@ -135184,10 +135207,12 @@
135207 }
135208 for(nArg=2; nArg<=3; nArg++){
135209 sqlite3CreateFunc(db, "like", nArg, SQLITE_UTF8, pInfo, likeFunc,
135210 0, 0, 0, 0, 0);
135211 pDef = sqlite3FindFunction(db, "like", nArg, SQLITE_UTF8, 0);
135212 assert( pDef!=0 ); /* The sqlite3CreateFunc() call above cannot fail
135213 ** because the "like" SQL-function already exists */
135214 pDef->funcFlags |= flags;
135215 pDef->funcFlags &= ~SQLITE_FUNC_UNSAFE;
135216 }
135217 }
135218
@@ -147881,11 +147906,11 @@
147906 ** how to process the DISTINCT keyword, to simplify passing that information
147907 ** into the selectInnerLoop() routine.
147908 */
147909 typedef struct DistinctCtx DistinctCtx;
147910 struct DistinctCtx {
147911 u8 isTnct; /* 0: Not distinct. 1: DISTINCT 2: DISTINCT and ORDER BY */
147912 u8 eTnctType; /* One of the WHERE_DISTINCT_* operators */
147913 int tabTnct; /* Ephemeral table used for DISTINCT processing */
147914 int addrTnct; /* Address of OP_OpenEphemeral opcode for tabTnct */
147915 };
147916
@@ -170861,11 +170886,11 @@
170886 testcase( pLhs->iColumn==XN_ROWID );
170887 aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
170888 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
170889 if( aff!=idxaff ) break;
170890
170891 pColl = sqlite3ExprCompareCollSeq(pParse, pTerm->pExpr);
170892 if( pColl==0 ) break;
170893 if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
170894 }
170895 return i;
170896 }
@@ -189580,11 +189605,11 @@
189605
189606 /* Allocate the sqlite data structure */
189607 db = sqlite3MallocZero( sizeof(sqlite3) );
189608 if( db==0 ) goto opendb_out;
189609 if( isThreadsafe
189610 #if defined(SQLITE_THREAD_MISUSE_WARNINGS)
189611 || sqlite3GlobalConfig.bCoreMutex
189612 #endif
189613 ){
189614 db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
189615 if( db->mutex==0 ){
@@ -261831,11 +261856,11 @@
261856 int nArg, /* Number of args */
261857 sqlite3_value **apUnused /* Function arguments */
261858 ){
261859 assert( nArg==0 );
261860 UNUSED_PARAM2(nArg, apUnused);
261861 sqlite3_result_text(pCtx, "fts5: 2026-02-27 11:36:43 7c5f4dcd748baa60097bbf68d7aca99cc959bb1f7da92bd9ad86a4425a37d391", -1, SQLITE_TRANSIENT);
261862 }
261863
261864 /*
261865 ** Implementation of fts5_locale(LOCALE, TEXT) function.
261866 **
261867
+16 -15
--- 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.52.0"
150150
#define SQLITE_VERSION_NUMBER 3052000
151
-#define SQLITE_SOURCE_ID "2026-02-23 19:51:54 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4e29f95764fe1027d4d8706a41480"
151
+#define SQLITE_SOURCE_ID "2026-02-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2026-02-23T19:51:54.706Z"
154
+#define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
155155
156156
/*
157157
** CAPI3REF: Run-Time Library Version Numbers
158158
** KEYWORDS: sqlite3_version sqlite3_sourceid
159159
**
@@ -4451,23 +4451,24 @@
44514451
** fails, the sqlite3_prepare_v3() call returns the same error indications
44524452
** with or without this flag; it just omits the call to [sqlite3_log()] that
44534453
** logs the error.
44544454
**
44554455
** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4456
-** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to behave as if
4457
-** the SQL statement is part of a database schema. This makes a difference
4458
-** when the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] option is set to off.
4459
-** When this option is used and SQLITE_DBCONFIG_TRUSTED_SCHEMA is off,
4460
-** SQL functions may not be called unless they are tagged with
4461
-** [SQLITE_INNOCUOUS] and virtual tables may not be used unless tagged
4462
-** with [SQLITE_VTAB_INNOCUOUS]. Use the SQLITE_PREPARE_FROM_DDL option
4463
-** when preparing SQL that is derived from parts of the database
4464
-** schema. In particular, virtual table implementations that
4465
-** run SQL statements based on the arguments to their CREATE VIRTUAL
4466
-** TABLE statement should use [sqlite3_prepare_v3()] and set the
4467
-** SQLITE_PREPARE_FROM_DLL flag to prevent bypass of the
4468
-** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
4456
+** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to enforce
4457
+** security constraints that would otherwise only be enforced when parsing
4458
+** the database schema. In other words, the SQLITE_PREPARE_FROM_DDL flag
4459
+** causes the SQL compiler to treat the SQL statement being prepared as if
4460
+** it had come from an attacker. When SQLITE_PREPARE_FROM_DDL is used and
4461
+** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] is off, SQL functions may only be called
4462
+** if they are tagged with [SQLITE_INNOCUOUS] and virtual tables may only
4463
+** be used if they are tagged with [SQLITE_VTAB_INNOCUOUS]. Best practice
4464
+** is to use the SQLITE_PREPARE_FROM_DDL option when preparing any SQL that
4465
+** is derived from parts of the database schema. In particular, virtual
4466
+** table implementations that run SQL statements that are derived from
4467
+** arguments to their CREATE VIRTUAL TABLE statement should always use
4468
+** [sqlite3_prepare_v3()] and set the SQLITE_PREPARE_FROM_DDL flag to
4469
+** prevent bypass of the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
44694470
** </dl>
44704471
*/
44714472
#define SQLITE_PREPARE_PERSISTENT 0x01
44724473
#define SQLITE_PREPARE_NORMALIZE 0x02
44734474
#define SQLITE_PREPARE_NO_VTAB 0x04
44744475
--- 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.52.0"
150 #define SQLITE_VERSION_NUMBER 3052000
151 #define SQLITE_SOURCE_ID "2026-02-23 19:51:54 3ca1ed81c4fa41f5f9fdbebf0929dd8421a4e29f95764fe1027d4d8706a41480"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-02-23T19:51:54.706Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
@@ -4451,23 +4451,24 @@
4451 ** fails, the sqlite3_prepare_v3() call returns the same error indications
4452 ** with or without this flag; it just omits the call to [sqlite3_log()] that
4453 ** logs the error.
4454 **
4455 ** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4456 ** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to behave as if
4457 ** the SQL statement is part of a database schema. This makes a difference
4458 ** when the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] option is set to off.
4459 ** When this option is used and SQLITE_DBCONFIG_TRUSTED_SCHEMA is off,
4460 ** SQL functions may not be called unless they are tagged with
4461 ** [SQLITE_INNOCUOUS] and virtual tables may not be used unless tagged
4462 ** with [SQLITE_VTAB_INNOCUOUS]. Use the SQLITE_PREPARE_FROM_DDL option
4463 ** when preparing SQL that is derived from parts of the database
4464 ** schema. In particular, virtual table implementations that
4465 ** run SQL statements based on the arguments to their CREATE VIRTUAL
4466 ** TABLE statement should use [sqlite3_prepare_v3()] and set the
4467 ** SQLITE_PREPARE_FROM_DLL flag to prevent bypass of the
4468 ** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
 
4469 ** </dl>
4470 */
4471 #define SQLITE_PREPARE_PERSISTENT 0x01
4472 #define SQLITE_PREPARE_NORMALIZE 0x02
4473 #define SQLITE_PREPARE_NO_VTAB 0x04
4474
--- 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.52.0"
150 #define SQLITE_VERSION_NUMBER 3052000
151 #define SQLITE_SOURCE_ID "2026-02-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
@@ -4451,23 +4451,24 @@
4451 ** fails, the sqlite3_prepare_v3() call returns the same error indications
4452 ** with or without this flag; it just omits the call to [sqlite3_log()] that
4453 ** logs the error.
4454 **
4455 ** [[SQLITE_PREPARE_FROM_DDL]] <dt>SQLITE_PREPARE_FROM_DDL</dt>
4456 ** <dd>The SQLITE_PREPARE_FROM_DDL flag causes the SQL compiler to enforce
4457 ** security constraints that would otherwise only be enforced when parsing
4458 ** the database schema. In other words, the SQLITE_PREPARE_FROM_DDL flag
4459 ** causes the SQL compiler to treat the SQL statement being prepared as if
4460 ** it had come from an attacker. When SQLITE_PREPARE_FROM_DDL is used and
4461 ** [SQLITE_DBCONFIG_TRUSTED_SCHEMA] is off, SQL functions may only be called
4462 ** if they are tagged with [SQLITE_INNOCUOUS] and virtual tables may only
4463 ** be used if they are tagged with [SQLITE_VTAB_INNOCUOUS]. Best practice
4464 ** is to use the SQLITE_PREPARE_FROM_DDL option when preparing any SQL that
4465 ** is derived from parts of the database schema. In particular, virtual
4466 ** table implementations that run SQL statements that are derived from
4467 ** arguments to their CREATE VIRTUAL TABLE statement should always use
4468 ** [sqlite3_prepare_v3()] and set the SQLITE_PREPARE_FROM_DDL flag to
4469 ** prevent bypass of the [SQLITE_DBCONFIG_TRUSTED_SCHEMA] security checks.
4470 ** </dl>
4471 */
4472 #define SQLITE_PREPARE_PERSISTENT 0x01
4473 #define SQLITE_PREPARE_NORMALIZE 0x02
4474 #define SQLITE_PREPARE_NO_VTAB 0x04
4475

Keyboard Shortcuts

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