Fossil SCM

Update the built-in SQLite to the latest 3.52.0 beta

drh 2026-03-02 21:31 trunk
Commit ba8756ac35322a12400a580d0b39495d3623f328b8817bcb80b4d516814922ac
+8 -3
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3759,11 +3759,11 @@
37593759
if( p->spec.pzOutput[0] ){
37603760
sqlite3_int64 n, sz;
37613761
char *zCombined;
37623762
sz = strlen(p->spec.pzOutput[0]);
37633763
n = sqlite3_str_length(p->pOut);
3764
- zCombined = sqlite3_realloc(p->spec.pzOutput[0], sz+n+1);
3764
+ zCombined = sqlite3_realloc64(p->spec.pzOutput[0], sz+n+1);
37653765
if( zCombined==0 ){
37663766
sqlite3_free(p->spec.pzOutput[0]);
37673767
p->spec.pzOutput[0] = 0;
37683768
qrfOom(p);
37693769
}else{
@@ -13532,11 +13532,16 @@
1353213532
static int zipfileScanExtra(u8 *aExtra, int nExtra, u32 *pmTime){
1353313533
int ret = 0;
1353413534
u8 *p = aExtra;
1353513535
u8 *pEnd = &aExtra[nExtra];
1353613536
13537
- while( p<pEnd ){
13537
+ /* Stop when there are less than 9 bytes left to scan in the buffer. This
13538
+ ** is because the timestamp field requires exactly 9 bytes - 4 bytes of
13539
+ ** header fields and 5 bytes of data. If there are less than 9 bytes
13540
+ ** remaining, either it is some other field or else the extra data
13541
+ ** is corrupt. Either way, do not process it. */
13542
+ while( p+(2*sizeof(u16) + 1 + sizeof(u32))<=pEnd ){
1353813543
u16 id = zipfileRead16(p);
1353913544
u16 nByte = zipfileRead16(p);
1354013545
1354113546
switch( id ){
1354213547
case ZIPFILE_EXTRA_TIMESTAMP: {
@@ -18153,11 +18158,11 @@
1815318158
*/
1815418159
static int intckGetToken(const char *z){
1815518160
char c = z[0];
1815618161
int iRet = 1;
1815718162
if( c=='\'' || c=='"' || c=='`' ){
18158
- while( 1 ){
18163
+ while( z[iRet] ){
1815918164
if( z[iRet]==c ){
1816018165
iRet++;
1816118166
if( z[iRet]!=c ) break;
1816218167
}
1816318168
iRet++;
1816418169
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3759,11 +3759,11 @@
3759 if( p->spec.pzOutput[0] ){
3760 sqlite3_int64 n, sz;
3761 char *zCombined;
3762 sz = strlen(p->spec.pzOutput[0]);
3763 n = sqlite3_str_length(p->pOut);
3764 zCombined = sqlite3_realloc(p->spec.pzOutput[0], sz+n+1);
3765 if( zCombined==0 ){
3766 sqlite3_free(p->spec.pzOutput[0]);
3767 p->spec.pzOutput[0] = 0;
3768 qrfOom(p);
3769 }else{
@@ -13532,11 +13532,16 @@
13532 static int zipfileScanExtra(u8 *aExtra, int nExtra, u32 *pmTime){
13533 int ret = 0;
13534 u8 *p = aExtra;
13535 u8 *pEnd = &aExtra[nExtra];
13536
13537 while( p<pEnd ){
 
 
 
 
 
13538 u16 id = zipfileRead16(p);
13539 u16 nByte = zipfileRead16(p);
13540
13541 switch( id ){
13542 case ZIPFILE_EXTRA_TIMESTAMP: {
@@ -18153,11 +18158,11 @@
18153 */
18154 static int intckGetToken(const char *z){
18155 char c = z[0];
18156 int iRet = 1;
18157 if( c=='\'' || c=='"' || c=='`' ){
18158 while( 1 ){
18159 if( z[iRet]==c ){
18160 iRet++;
18161 if( z[iRet]!=c ) break;
18162 }
18163 iRet++;
18164
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -3759,11 +3759,11 @@
3759 if( p->spec.pzOutput[0] ){
3760 sqlite3_int64 n, sz;
3761 char *zCombined;
3762 sz = strlen(p->spec.pzOutput[0]);
3763 n = sqlite3_str_length(p->pOut);
3764 zCombined = sqlite3_realloc64(p->spec.pzOutput[0], sz+n+1);
3765 if( zCombined==0 ){
3766 sqlite3_free(p->spec.pzOutput[0]);
3767 p->spec.pzOutput[0] = 0;
3768 qrfOom(p);
3769 }else{
@@ -13532,11 +13532,16 @@
13532 static int zipfileScanExtra(u8 *aExtra, int nExtra, u32 *pmTime){
13533 int ret = 0;
13534 u8 *p = aExtra;
13535 u8 *pEnd = &aExtra[nExtra];
13536
13537 /* Stop when there are less than 9 bytes left to scan in the buffer. This
13538 ** is because the timestamp field requires exactly 9 bytes - 4 bytes of
13539 ** header fields and 5 bytes of data. If there are less than 9 bytes
13540 ** remaining, either it is some other field or else the extra data
13541 ** is corrupt. Either way, do not process it. */
13542 while( p+(2*sizeof(u16) + 1 + sizeof(u32))<=pEnd ){
13543 u16 id = zipfileRead16(p);
13544 u16 nByte = zipfileRead16(p);
13545
13546 switch( id ){
13547 case ZIPFILE_EXTRA_TIMESTAMP: {
@@ -18153,11 +18158,11 @@
18158 */
18159 static int intckGetToken(const char *z){
18160 char c = z[0];
18161 int iRet = 1;
18162 if( c=='\'' || c=='"' || c=='`' ){
18163 while( z[iRet] ){
18164 if( z[iRet]==c ){
18165 iRet++;
18166 if( z[iRet]!=c ) break;
18167 }
18168 iRet++;
18169
+48 -48
--- 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
-** 0780bce854b962fb2d4a1a19c55c9b5790a9 with changes in files:
21
+** 88dce64242552e7443d9fb496f6f3ad71dc5 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-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
472
+#define SQLITE_SOURCE_ID "2026-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61"
473473
#define SQLITE_SCM_BRANCH "trunk"
474474
#define SQLITE_SCM_TAGS ""
475
-#define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
475
+#define SQLITE_SCM_DATETIME "2026-03-02T17:11:44.720Z"
476476
477477
/*
478478
** CAPI3REF: Run-Time Library Version Numbers
479479
** KEYWORDS: sqlite3_version sqlite3_sourceid
480480
**
@@ -36714,14 +36714,14 @@
3671436714
/*
3671536715
** Return an IEEE754 floating point value that approximates d*pow(10,p).
3671636716
*/
3671736717
static double sqlite3Fp10Convert2(u64 d, int p){
3671836718
u64 out;
36719
- int b;
3672036719
int e1;
36721
- int e2;
36720
+ int lz;
3672236721
int lp;
36722
+ int x;
3672336723
u64 h;
3672436724
double r;
3672536725
assert( (d & U64_BIT(63))==0 );
3672636726
assert( d!=0 );
3672736727
if( p<POWERSOF10_FIRST ){
@@ -36728,30 +36728,30 @@
3672836728
return 0.0;
3672936729
}
3673036730
if( p>POWERSOF10_LAST ){
3673136731
return INFINITY;
3673236732
}
36733
- b = 64 - countLeadingZeros(d);
36733
+ lz = countLeadingZeros(d);
3673436734
lp = pwr10to2(p);
36735
- e1 = 53 - b - lp;
36735
+ e1 = lz - (lp + 11);
3673636736
if( e1>1074 ){
36737
- if( -(b + lp) >= 1077 ) return 0.0;
36737
+ if( e1>=1130 ) return 0.0;
3673836738
e1 = 1074;
3673936739
}
36740
- e2 = e1 - (64-b);
36741
- h = sqlite3Multiply128(d<<(64-b), powerOfTen(p));
36742
- assert( -(e2 + lp + 3) >=0 );
36743
- assert( -(e2 + lp + 3) <64 );
36744
- out = (h >> -(e2 + lp + 3)) | 1;
36740
+ h = sqlite3Multiply128(d<<lz, powerOfTen(p));
36741
+ x = lz - (e1 + lp + 3);
36742
+ assert( x >= 0 );
36743
+ assert( x <= 63 );
36744
+ out = h >> x;
3674536745
if( out >= U64_BIT(55)-2 ){
36746
- out = (out>>1) | (out&1);
36746
+ out >>= 1;
3674736747
e1--;
3674836748
}
3674936749
if( e1<=(-972) ){
3675036750
return INFINITY;
3675136751
}
36752
- out = (out + 1) >> 2;
36752
+ out = (out + 2) >> 2;
3675336753
if( (out & U64_BIT(52))!=0 ){
3675436754
out = (out & ~U64_BIT(52)) | ((u64)(1075-e1)<<52);
3675536755
}
3675636756
memcpy(&r, &out, 8);
3675736757
return r;
@@ -44829,11 +44829,11 @@
4482944829
}
4483044830
}
4483144831
}
4483244832
4483344833
/* Map the requested memory region into this processes address space. */
44834
- apNew = (char **)sqlite3_realloc(
44834
+ apNew = (char **)sqlite3_realloc64(
4483544835
pShmNode->apRegion, nReqRegion*sizeof(char *)
4483644836
);
4483744837
if( !apNew ){
4483844838
rc = SQLITE_IOERR_NOMEM_BKPT;
4483944839
goto shmpage_out;
@@ -157891,10 +157891,11 @@
157891157891
|| (pList->bReturning && pList->pNext==0) );
157892157892
if( pList!=0 ){
157893157893
p = pList;
157894157894
if( (pParse->db->flags & SQLITE_EnableTrigger)==0
157895157895
&& pTab->pTrigger!=0
157896
+ && sqlite3SchemaToIndex(pParse->db, pTab->pTrigger->pSchema)!=1
157896157897
){
157897157898
/* The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that
157898157899
** only TEMP triggers are allowed. Truncate the pList so that it
157899157900
** includes only TEMP triggers */
157900157901
if( pList==pTab->pTrigger ){
@@ -227233,12 +227234,12 @@
227233227234
for(i=0; zSql[i]; i++){
227234227235
char c = zSql[i];
227235227236
227236227237
/* If necessary, grow the pIter->aIdxCol[] array */
227237227238
if( iIdxCol==nIdxAlloc ){
227238
- RbuSpan *aIdxCol = (RbuSpan*)sqlite3_realloc(
227239
- pIter->aIdxCol, (nIdxAlloc+16)*sizeof(RbuSpan)
227239
+ RbuSpan *aIdxCol = (RbuSpan*)sqlite3_realloc64(
227240
+ pIter->aIdxCol, nIdxAlloc*sizeof(RbuSpan) + 16*sizeof(RbuSpan)
227240227241
);
227241227242
if( aIdxCol==0 ){
227242227243
rc = SQLITE_NOMEM;
227243227244
break;
227244227245
}
@@ -242927,11 +242928,11 @@
242927242928
zEllips = fts5ValueToText(apVal[3]);
242928242929
nToken = sqlite3_value_int(apVal[4]);
242929242930
242930242931
iBestCol = (iCol>=0 ? iCol : 0);
242931242932
nPhrase = pApi->xPhraseCount(pFts);
242932
- aSeen = sqlite3_malloc(nPhrase);
242933
+ aSeen = sqlite3_malloc64(nPhrase);
242933242934
if( aSeen==0 ){
242934242935
rc = SQLITE_NOMEM;
242935242936
}
242936242937
if( rc==SQLITE_OK ){
242937242938
rc = pApi->xInstCount(pFts, &nInst);
@@ -243582,11 +243583,11 @@
243582243583
char *zRet = 0;
243583243584
if( *pRc==SQLITE_OK ){
243584243585
if( nIn<0 ){
243585243586
nIn = (int)strlen(pIn);
243586243587
}
243587
- zRet = (char*)sqlite3_malloc(nIn+1);
243588
+ zRet = (char*)sqlite3_malloc64((i64)nIn+1);
243588243589
if( zRet ){
243589243590
memcpy(zRet, pIn, nIn);
243590243591
zRet[nIn] = '\0';
243591243592
}else{
243592243593
*pRc = SQLITE_NOMEM;
@@ -244282,11 +244283,11 @@
244282244283
Fts5Config *pRet; /* New object to return */
244283244284
int i;
244284244285
sqlite3_int64 nByte;
244285244286
int bUnindexed = 0; /* True if there are one or more UNINDEXED */
244286244287
244287
- *ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config));
244288
+ *ppOut = pRet = (Fts5Config*)sqlite3_malloc64(sizeof(Fts5Config));
244288244289
if( pRet==0 ) return SQLITE_NOMEM;
244289244290
memset(pRet, 0, sizeof(Fts5Config));
244290244291
pRet->pGlobal = pGlobal;
244291244292
pRet->db = db;
244292244293
pRet->iCookie = -1;
@@ -244830,12 +244831,10 @@
244830244831
}
244831244832
244832244833
va_end(ap);
244833244834
}
244834244835
244835
-
244836
-
244837244836
/*
244838244837
** 2014 May 31
244839244838
**
244840244839
** The author disclaims copyright to this source code. In place of
244841244840
** a legal notice, here is a blessing:
@@ -245148,11 +245147,11 @@
245148245147
}
245149245148
}
245150245149
245151245150
assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 );
245152245151
if( sParse.rc==SQLITE_OK ){
245153
- *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr));
245152
+ *ppNew = pNew = sqlite3_malloc64(sizeof(Fts5Expr));
245154245153
if( pNew==0 ){
245155245154
sParse.rc = SQLITE_NOMEM;
245156245155
sqlite3Fts5ParseNodeFree(sParse.pExpr);
245157245156
}else{
245158245157
pNew->pRoot = sParse.pExpr;
@@ -245300,11 +245299,11 @@
245300245299
245301245300
p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
245302245301
p2->pRoot = 0;
245303245302
245304245303
if( sParse.rc==SQLITE_OK ){
245305
- Fts5ExprPhrase **ap = (Fts5ExprPhrase**)sqlite3_realloc(
245304
+ Fts5ExprPhrase **ap = (Fts5ExprPhrase**)sqlite3_realloc64(
245306245305
p1->apExprPhrase, nPhrase * sizeof(Fts5ExprPhrase*)
245307245306
);
245308245307
if( ap==0 ){
245309245308
sParse.rc = SQLITE_NOMEM;
245310245309
}else{
@@ -248212,11 +248211,11 @@
248212248211
*/
248213248212
static int sqlite3Fts5HashNew(Fts5Config *pConfig, Fts5Hash **ppNew, int *pnByte){
248214248213
int rc = SQLITE_OK;
248215248214
Fts5Hash *pNew;
248216248215
248217
- *ppNew = pNew = (Fts5Hash*)sqlite3_malloc(sizeof(Fts5Hash));
248216
+ *ppNew = pNew = (Fts5Hash*)sqlite3_malloc64(sizeof(Fts5Hash));
248218248217
if( pNew==0 ){
248219248218
rc = SQLITE_NOMEM;
248220248219
}else{
248221248220
sqlite3_int64 nByte;
248222248221
memset(pNew, 0, sizeof(Fts5Hash));
@@ -250805,11 +250804,11 @@
250805250804
i += fts5GetVarint(&a[i], &iDelta);
250806250805
pIter->iRowid += iDelta;
250807250806
250808250807
/* If necessary, grow the pIter->aRowidOffset[] array. */
250809250808
if( iRowidOffset>=pIter->nRowidOffset ){
250810
- int nNew = pIter->nRowidOffset + 8;
250809
+ i64 nNew = pIter->nRowidOffset + 8;
250811250810
int *aNew = (int*)sqlite3_realloc64(pIter->aRowidOffset,nNew*sizeof(int));
250812250811
if( aNew==0 ){
250813250812
p->rc = SQLITE_NOMEM;
250814250813
break;
250815250814
}
@@ -255130,20 +255129,20 @@
255130255129
** of Fts5TokenDataMap structures, which are used to find the token required
255131255130
** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and
255132255131
** aMap[] variables.
255133255132
*/
255134255133
struct Fts5TokenDataIter {
255135
- int nMapAlloc; /* Allocated size of aMap[] in entries */
255136
- int nMap; /* Number of valid entries in aMap[] */
255134
+ i64 nMapAlloc; /* Allocated size of aMap[] in entries */
255135
+ i64 nMap; /* Number of valid entries in aMap[] */
255137255136
Fts5TokenDataMap *aMap; /* Array of (rowid+pos -> token) mappings */
255138255137
255139255138
/* The following are used for prefix-queries only. */
255140255139
Fts5Buffer terms;
255141255140
255142255141
/* The following are used for other full-token tokendata queries only. */
255143
- int nIter;
255144
- int nIterAlloc;
255142
+ i64 nIter;
255143
+ i64 nIterAlloc;
255145255144
Fts5PoslistReader *aPoslistReader;
255146255145
int *aPoslistToIter;
255147255146
Fts5Iter *apIter[FLEXARRAY];
255148255147
};
255149255148
@@ -255195,15 +255194,15 @@
255195255194
i64 iRowid,
255196255195
i64 iPos
255197255196
){
255198255197
if( p->rc==SQLITE_OK ){
255199255198
if( pT->nMap==pT->nMapAlloc ){
255200
- int nNew = pT->nMapAlloc ? pT->nMapAlloc*2 : 64;
255201
- int nAlloc = nNew * sizeof(Fts5TokenDataMap);
255199
+ i64 nNew = pT->nMapAlloc ? pT->nMapAlloc*2 : 64;
255200
+ i64 nAlloc = nNew * sizeof(Fts5TokenDataMap);
255202255201
Fts5TokenDataMap *aNew;
255203255202
255204
- aNew = (Fts5TokenDataMap*)sqlite3_realloc(pT->aMap, nAlloc);
255203
+ aNew = (Fts5TokenDataMap*)sqlite3_realloc64(pT->aMap, nAlloc);
255205255204
if( aNew==0 ){
255206255205
p->rc = SQLITE_NOMEM;
255207255206
return;
255208255207
}
255209255208
@@ -255225,11 +255224,11 @@
255225255224
** The sorting algorithm requires a malloc(). If this fails, an error code
255226255225
** is left in Fts5Index.rc before returning.
255227255226
*/
255228255227
static void fts5TokendataIterSortMap(Fts5Index *p, Fts5TokenDataIter *pT){
255229255228
Fts5TokenDataMap *aTmp = 0;
255230
- int nByte = pT->nMap * sizeof(Fts5TokenDataMap);
255229
+ i64 nByte = pT->nMap * sizeof(Fts5TokenDataMap);
255231255230
255232255231
aTmp = (Fts5TokenDataMap*)sqlite3Fts5MallocZero(&p->rc, nByte);
255233255232
if( aTmp ){
255234255233
Fts5TokenDataMap *a1 = pT->aMap;
255235255234
Fts5TokenDataMap *a2 = aTmp;
@@ -255759,13 +255758,14 @@
255759255758
){
255760255759
Fts5TokenDataIter *pRet = pIn;
255761255760
255762255761
if( p->rc==SQLITE_OK ){
255763255762
if( pIn==0 || pIn->nIter==pIn->nIterAlloc ){
255764
- int nAlloc = pIn ? pIn->nIterAlloc*2 : 16;
255765
- int nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
255766
- Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte);
255763
+ i64 nAlloc = pIn ? pIn->nIterAlloc*2 : 16;
255764
+ i64 nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
255765
+ Fts5TokenDataIter *pNew;
255766
+ pNew = (Fts5TokenDataIter*)sqlite3_realloc64(pIn, nByte);
255767255767
255768255768
if( pNew==0 ){
255769255769
p->rc = SQLITE_NOMEM;
255770255770
}else{
255771255771
if( pIn==0 ) memset(pNew, 0, nByte);
@@ -255858,12 +255858,12 @@
255858255858
return;
255859255859
}
255860255860
255861255861
/* Ensure the token-mapping is large enough */
255862255862
if( eDetail==FTS5_DETAIL_FULL && pT->nMapAlloc<(pT->nMap + nByte) ){
255863
- int nNew = (pT->nMapAlloc + nByte) * 2;
255864
- Fts5TokenDataMap *aNew = (Fts5TokenDataMap*)sqlite3_realloc(
255863
+ i64 nNew = (pT->nMapAlloc + nByte) * 2;
255864
+ Fts5TokenDataMap *aNew = (Fts5TokenDataMap*)sqlite3_realloc64(
255865255865
pT->aMap, nNew*sizeof(Fts5TokenDataMap)
255866255866
);
255867255867
if( aNew==0 ){
255868255868
pIter->pIndex->rc = SQLITE_NOMEM;
255869255869
return;
@@ -258888,11 +258888,11 @@
258888258888
"recursively defined fts5 content table"
258889258889
);
258890258890
return SQLITE_ERROR;
258891258891
}
258892258892
258893
- idxStr = (char*)sqlite3_malloc(pInfo->nConstraint * 8 + 1);
258893
+ idxStr = (char*)sqlite3_malloc64((i64)pInfo->nConstraint * 8 + 1);
258894258894
if( idxStr==0 ) return SQLITE_NOMEM;
258895258895
pInfo->idxStr = idxStr;
258896258896
pInfo->needToFreeIdxStr = 1;
258897258897
258898258898
for(i=0; i<pInfo->nConstraint; i++){
@@ -261856,11 +261856,11 @@
261856261856
int nArg, /* Number of args */
261857261857
sqlite3_value **apUnused /* Function arguments */
261858261858
){
261859261859
assert( nArg==0 );
261860261860
UNUSED_PARAM2(nArg, apUnused);
261861
- sqlite3_result_text(pCtx, "fts5: 2026-02-27 11:36:43 7c5f4dcd748baa60097bbf68d7aca99cc959bb1f7da92bd9ad86a4425a37d391", -1, SQLITE_TRANSIENT);
261861
+ sqlite3_result_text(pCtx, "fts5: 2026-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61", -1, SQLITE_TRANSIENT);
261862261862
}
261863261863
261864261864
/*
261865261865
** Implementation of fts5_locale(LOCALE, TEXT) function.
261866261866
**
@@ -262020,11 +262020,11 @@
262020262020
};
262021262021
262022262022
int rc;
262023262023
Fts5Global *pGlobal = 0;
262024262024
262025
- pGlobal = (Fts5Global*)sqlite3_malloc(sizeof(Fts5Global));
262025
+ pGlobal = (Fts5Global*)sqlite3_malloc64(sizeof(Fts5Global));
262026262026
if( pGlobal==0 ){
262027262027
rc = SQLITE_NOMEM;
262028262028
}else{
262029262029
void *p = (void*)pGlobal;
262030262030
memset(pGlobal, 0, sizeof(Fts5Global));
@@ -263736,11 +263736,11 @@
263736263736
AsciiTokenizer *p = 0;
263737263737
UNUSED_PARAM(pUnused);
263738263738
if( nArg%2 ){
263739263739
rc = SQLITE_ERROR;
263740263740
}else{
263741
- p = sqlite3_malloc(sizeof(AsciiTokenizer));
263741
+ p = sqlite3_malloc64(sizeof(AsciiTokenizer));
263742263742
if( p==0 ){
263743263743
rc = SQLITE_NOMEM;
263744263744
}else{
263745263745
int i;
263746263746
memset(p, 0, sizeof(AsciiTokenizer));
@@ -264031,11 +264031,11 @@
264031264031
UNUSED_PARAM(pUnused);
264032264032
264033264033
if( nArg%2 ){
264034264034
rc = SQLITE_ERROR;
264035264035
}else{
264036
- p = (Unicode61Tokenizer*)sqlite3_malloc(sizeof(Unicode61Tokenizer));
264036
+ p = (Unicode61Tokenizer*)sqlite3_malloc64(sizeof(Unicode61Tokenizer));
264037264037
if( p ){
264038264038
const char *zCat = "L* N* Co";
264039264039
int i;
264040264040
memset(p, 0, sizeof(Unicode61Tokenizer));
264041264041
@@ -264254,11 +264254,11 @@
264254264254
264255264255
if( nArg>0 ){
264256264256
zBase = azArg[0];
264257264257
}
264258264258
264259
- pRet = (PorterTokenizer*)sqlite3_malloc(sizeof(PorterTokenizer));
264259
+ pRet = (PorterTokenizer*)sqlite3_malloc64(sizeof(PorterTokenizer));
264260264260
if( pRet ){
264261264261
memset(pRet, 0, sizeof(PorterTokenizer));
264262264262
rc = pApi->xFindTokenizer_v2(pApi, zBase, &pUserdata, &pV2);
264263264263
}else{
264264264264
rc = SQLITE_NOMEM;
@@ -264961,11 +264961,11 @@
264961264961
UNUSED_PARAM(pUnused);
264962264962
if( nArg%2 ){
264963264963
rc = SQLITE_ERROR;
264964264964
}else{
264965264965
int i;
264966
- pNew = (TrigramTokenizer*)sqlite3_malloc(sizeof(*pNew));
264966
+ pNew = (TrigramTokenizer*)sqlite3_malloc64(sizeof(*pNew));
264967264967
if( pNew==0 ){
264968264968
rc = SQLITE_NOMEM;
264969264969
}else{
264970264970
pNew->bFold = 1;
264971264971
pNew->iFoldParam = 0;
@@ -266947,11 +266947,11 @@
266947266947
}
266948266948
if( pLe ){
266949266949
const char *zCopy = (const char *)sqlite3_value_text(pLe);
266950266950
if( zCopy==0 ) zCopy = "";
266951266951
pCsr->nLeTerm = sqlite3_value_bytes(pLe);
266952
- pCsr->zLeTerm = sqlite3_malloc(pCsr->nLeTerm+1);
266952
+ pCsr->zLeTerm = sqlite3_malloc64((i64)pCsr->nLeTerm+1);
266953266953
if( pCsr->zLeTerm==0 ){
266954266954
rc = SQLITE_NOMEM;
266955266955
}else{
266956266956
memcpy(pCsr->zLeTerm, zCopy, pCsr->nLeTerm+1);
266957266957
}
266958266958
--- 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 **
@@ -36714,14 +36714,14 @@
36714 /*
36715 ** Return an IEEE754 floating point value that approximates d*pow(10,p).
36716 */
36717 static double sqlite3Fp10Convert2(u64 d, int p){
36718 u64 out;
36719 int b;
36720 int e1;
36721 int e2;
36722 int lp;
 
36723 u64 h;
36724 double r;
36725 assert( (d & U64_BIT(63))==0 );
36726 assert( d!=0 );
36727 if( p<POWERSOF10_FIRST ){
@@ -36728,30 +36728,30 @@
36728 return 0.0;
36729 }
36730 if( p>POWERSOF10_LAST ){
36731 return INFINITY;
36732 }
36733 b = 64 - countLeadingZeros(d);
36734 lp = pwr10to2(p);
36735 e1 = 53 - b - lp;
36736 if( e1>1074 ){
36737 if( -(b + lp) >= 1077 ) return 0.0;
36738 e1 = 1074;
36739 }
36740 e2 = e1 - (64-b);
36741 h = sqlite3Multiply128(d<<(64-b), powerOfTen(p));
36742 assert( -(e2 + lp + 3) >=0 );
36743 assert( -(e2 + lp + 3) <64 );
36744 out = (h >> -(e2 + lp + 3)) | 1;
36745 if( out >= U64_BIT(55)-2 ){
36746 out = (out>>1) | (out&1);
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;
@@ -44829,11 +44829,11 @@
44829 }
44830 }
44831 }
44832
44833 /* Map the requested memory region into this processes address space. */
44834 apNew = (char **)sqlite3_realloc(
44835 pShmNode->apRegion, nReqRegion*sizeof(char *)
44836 );
44837 if( !apNew ){
44838 rc = SQLITE_IOERR_NOMEM_BKPT;
44839 goto shmpage_out;
@@ -157891,10 +157891,11 @@
157891 || (pList->bReturning && pList->pNext==0) );
157892 if( pList!=0 ){
157893 p = pList;
157894 if( (pParse->db->flags & SQLITE_EnableTrigger)==0
157895 && pTab->pTrigger!=0
 
157896 ){
157897 /* The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that
157898 ** only TEMP triggers are allowed. Truncate the pList so that it
157899 ** includes only TEMP triggers */
157900 if( pList==pTab->pTrigger ){
@@ -227233,12 +227234,12 @@
227233 for(i=0; zSql[i]; i++){
227234 char c = zSql[i];
227235
227236 /* If necessary, grow the pIter->aIdxCol[] array */
227237 if( iIdxCol==nIdxAlloc ){
227238 RbuSpan *aIdxCol = (RbuSpan*)sqlite3_realloc(
227239 pIter->aIdxCol, (nIdxAlloc+16)*sizeof(RbuSpan)
227240 );
227241 if( aIdxCol==0 ){
227242 rc = SQLITE_NOMEM;
227243 break;
227244 }
@@ -242927,11 +242928,11 @@
242927 zEllips = fts5ValueToText(apVal[3]);
242928 nToken = sqlite3_value_int(apVal[4]);
242929
242930 iBestCol = (iCol>=0 ? iCol : 0);
242931 nPhrase = pApi->xPhraseCount(pFts);
242932 aSeen = sqlite3_malloc(nPhrase);
242933 if( aSeen==0 ){
242934 rc = SQLITE_NOMEM;
242935 }
242936 if( rc==SQLITE_OK ){
242937 rc = pApi->xInstCount(pFts, &nInst);
@@ -243582,11 +243583,11 @@
243582 char *zRet = 0;
243583 if( *pRc==SQLITE_OK ){
243584 if( nIn<0 ){
243585 nIn = (int)strlen(pIn);
243586 }
243587 zRet = (char*)sqlite3_malloc(nIn+1);
243588 if( zRet ){
243589 memcpy(zRet, pIn, nIn);
243590 zRet[nIn] = '\0';
243591 }else{
243592 *pRc = SQLITE_NOMEM;
@@ -244282,11 +244283,11 @@
244282 Fts5Config *pRet; /* New object to return */
244283 int i;
244284 sqlite3_int64 nByte;
244285 int bUnindexed = 0; /* True if there are one or more UNINDEXED */
244286
244287 *ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config));
244288 if( pRet==0 ) return SQLITE_NOMEM;
244289 memset(pRet, 0, sizeof(Fts5Config));
244290 pRet->pGlobal = pGlobal;
244291 pRet->db = db;
244292 pRet->iCookie = -1;
@@ -244830,12 +244831,10 @@
244830 }
244831
244832 va_end(ap);
244833 }
244834
244835
244836
244837 /*
244838 ** 2014 May 31
244839 **
244840 ** The author disclaims copyright to this source code. In place of
244841 ** a legal notice, here is a blessing:
@@ -245148,11 +245147,11 @@
245148 }
245149 }
245150
245151 assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 );
245152 if( sParse.rc==SQLITE_OK ){
245153 *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr));
245154 if( pNew==0 ){
245155 sParse.rc = SQLITE_NOMEM;
245156 sqlite3Fts5ParseNodeFree(sParse.pExpr);
245157 }else{
245158 pNew->pRoot = sParse.pExpr;
@@ -245300,11 +245299,11 @@
245300
245301 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
245302 p2->pRoot = 0;
245303
245304 if( sParse.rc==SQLITE_OK ){
245305 Fts5ExprPhrase **ap = (Fts5ExprPhrase**)sqlite3_realloc(
245306 p1->apExprPhrase, nPhrase * sizeof(Fts5ExprPhrase*)
245307 );
245308 if( ap==0 ){
245309 sParse.rc = SQLITE_NOMEM;
245310 }else{
@@ -248212,11 +248211,11 @@
248212 */
248213 static int sqlite3Fts5HashNew(Fts5Config *pConfig, Fts5Hash **ppNew, int *pnByte){
248214 int rc = SQLITE_OK;
248215 Fts5Hash *pNew;
248216
248217 *ppNew = pNew = (Fts5Hash*)sqlite3_malloc(sizeof(Fts5Hash));
248218 if( pNew==0 ){
248219 rc = SQLITE_NOMEM;
248220 }else{
248221 sqlite3_int64 nByte;
248222 memset(pNew, 0, sizeof(Fts5Hash));
@@ -250805,11 +250804,11 @@
250805 i += fts5GetVarint(&a[i], &iDelta);
250806 pIter->iRowid += iDelta;
250807
250808 /* If necessary, grow the pIter->aRowidOffset[] array. */
250809 if( iRowidOffset>=pIter->nRowidOffset ){
250810 int nNew = pIter->nRowidOffset + 8;
250811 int *aNew = (int*)sqlite3_realloc64(pIter->aRowidOffset,nNew*sizeof(int));
250812 if( aNew==0 ){
250813 p->rc = SQLITE_NOMEM;
250814 break;
250815 }
@@ -255130,20 +255129,20 @@
255130 ** of Fts5TokenDataMap structures, which are used to find the token required
255131 ** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and
255132 ** aMap[] variables.
255133 */
255134 struct Fts5TokenDataIter {
255135 int nMapAlloc; /* Allocated size of aMap[] in entries */
255136 int nMap; /* Number of valid entries in aMap[] */
255137 Fts5TokenDataMap *aMap; /* Array of (rowid+pos -> token) mappings */
255138
255139 /* The following are used for prefix-queries only. */
255140 Fts5Buffer terms;
255141
255142 /* The following are used for other full-token tokendata queries only. */
255143 int nIter;
255144 int nIterAlloc;
255145 Fts5PoslistReader *aPoslistReader;
255146 int *aPoslistToIter;
255147 Fts5Iter *apIter[FLEXARRAY];
255148 };
255149
@@ -255195,15 +255194,15 @@
255195 i64 iRowid,
255196 i64 iPos
255197 ){
255198 if( p->rc==SQLITE_OK ){
255199 if( pT->nMap==pT->nMapAlloc ){
255200 int nNew = pT->nMapAlloc ? pT->nMapAlloc*2 : 64;
255201 int nAlloc = nNew * sizeof(Fts5TokenDataMap);
255202 Fts5TokenDataMap *aNew;
255203
255204 aNew = (Fts5TokenDataMap*)sqlite3_realloc(pT->aMap, nAlloc);
255205 if( aNew==0 ){
255206 p->rc = SQLITE_NOMEM;
255207 return;
255208 }
255209
@@ -255225,11 +255224,11 @@
255225 ** The sorting algorithm requires a malloc(). If this fails, an error code
255226 ** is left in Fts5Index.rc before returning.
255227 */
255228 static void fts5TokendataIterSortMap(Fts5Index *p, Fts5TokenDataIter *pT){
255229 Fts5TokenDataMap *aTmp = 0;
255230 int nByte = pT->nMap * sizeof(Fts5TokenDataMap);
255231
255232 aTmp = (Fts5TokenDataMap*)sqlite3Fts5MallocZero(&p->rc, nByte);
255233 if( aTmp ){
255234 Fts5TokenDataMap *a1 = pT->aMap;
255235 Fts5TokenDataMap *a2 = aTmp;
@@ -255759,13 +255758,14 @@
255759 ){
255760 Fts5TokenDataIter *pRet = pIn;
255761
255762 if( p->rc==SQLITE_OK ){
255763 if( pIn==0 || pIn->nIter==pIn->nIterAlloc ){
255764 int nAlloc = pIn ? pIn->nIterAlloc*2 : 16;
255765 int nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
255766 Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte);
 
255767
255768 if( pNew==0 ){
255769 p->rc = SQLITE_NOMEM;
255770 }else{
255771 if( pIn==0 ) memset(pNew, 0, nByte);
@@ -255858,12 +255858,12 @@
255858 return;
255859 }
255860
255861 /* Ensure the token-mapping is large enough */
255862 if( eDetail==FTS5_DETAIL_FULL && pT->nMapAlloc<(pT->nMap + nByte) ){
255863 int nNew = (pT->nMapAlloc + nByte) * 2;
255864 Fts5TokenDataMap *aNew = (Fts5TokenDataMap*)sqlite3_realloc(
255865 pT->aMap, nNew*sizeof(Fts5TokenDataMap)
255866 );
255867 if( aNew==0 ){
255868 pIter->pIndex->rc = SQLITE_NOMEM;
255869 return;
@@ -258888,11 +258888,11 @@
258888 "recursively defined fts5 content table"
258889 );
258890 return SQLITE_ERROR;
258891 }
258892
258893 idxStr = (char*)sqlite3_malloc(pInfo->nConstraint * 8 + 1);
258894 if( idxStr==0 ) return SQLITE_NOMEM;
258895 pInfo->idxStr = idxStr;
258896 pInfo->needToFreeIdxStr = 1;
258897
258898 for(i=0; i<pInfo->nConstraint; i++){
@@ -261856,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 **
@@ -262020,11 +262020,11 @@
262020 };
262021
262022 int rc;
262023 Fts5Global *pGlobal = 0;
262024
262025 pGlobal = (Fts5Global*)sqlite3_malloc(sizeof(Fts5Global));
262026 if( pGlobal==0 ){
262027 rc = SQLITE_NOMEM;
262028 }else{
262029 void *p = (void*)pGlobal;
262030 memset(pGlobal, 0, sizeof(Fts5Global));
@@ -263736,11 +263736,11 @@
263736 AsciiTokenizer *p = 0;
263737 UNUSED_PARAM(pUnused);
263738 if( nArg%2 ){
263739 rc = SQLITE_ERROR;
263740 }else{
263741 p = sqlite3_malloc(sizeof(AsciiTokenizer));
263742 if( p==0 ){
263743 rc = SQLITE_NOMEM;
263744 }else{
263745 int i;
263746 memset(p, 0, sizeof(AsciiTokenizer));
@@ -264031,11 +264031,11 @@
264031 UNUSED_PARAM(pUnused);
264032
264033 if( nArg%2 ){
264034 rc = SQLITE_ERROR;
264035 }else{
264036 p = (Unicode61Tokenizer*)sqlite3_malloc(sizeof(Unicode61Tokenizer));
264037 if( p ){
264038 const char *zCat = "L* N* Co";
264039 int i;
264040 memset(p, 0, sizeof(Unicode61Tokenizer));
264041
@@ -264254,11 +264254,11 @@
264254
264255 if( nArg>0 ){
264256 zBase = azArg[0];
264257 }
264258
264259 pRet = (PorterTokenizer*)sqlite3_malloc(sizeof(PorterTokenizer));
264260 if( pRet ){
264261 memset(pRet, 0, sizeof(PorterTokenizer));
264262 rc = pApi->xFindTokenizer_v2(pApi, zBase, &pUserdata, &pV2);
264263 }else{
264264 rc = SQLITE_NOMEM;
@@ -264961,11 +264961,11 @@
264961 UNUSED_PARAM(pUnused);
264962 if( nArg%2 ){
264963 rc = SQLITE_ERROR;
264964 }else{
264965 int i;
264966 pNew = (TrigramTokenizer*)sqlite3_malloc(sizeof(*pNew));
264967 if( pNew==0 ){
264968 rc = SQLITE_NOMEM;
264969 }else{
264970 pNew->bFold = 1;
264971 pNew->iFoldParam = 0;
@@ -266947,11 +266947,11 @@
266947 }
266948 if( pLe ){
266949 const char *zCopy = (const char *)sqlite3_value_text(pLe);
266950 if( zCopy==0 ) zCopy = "";
266951 pCsr->nLeTerm = sqlite3_value_bytes(pLe);
266952 pCsr->zLeTerm = sqlite3_malloc(pCsr->nLeTerm+1);
266953 if( pCsr->zLeTerm==0 ){
266954 rc = SQLITE_NOMEM;
266955 }else{
266956 memcpy(pCsr->zLeTerm, zCopy, pCsr->nLeTerm+1);
266957 }
266958
--- 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 ** 88dce64242552e7443d9fb496f6f3ad71dc5 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-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-03-02T17:11:44.720Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -36714,14 +36714,14 @@
36714 /*
36715 ** Return an IEEE754 floating point value that approximates d*pow(10,p).
36716 */
36717 static double sqlite3Fp10Convert2(u64 d, int p){
36718 u64 out;
 
36719 int e1;
36720 int lz;
36721 int lp;
36722 int x;
36723 u64 h;
36724 double r;
36725 assert( (d & U64_BIT(63))==0 );
36726 assert( d!=0 );
36727 if( p<POWERSOF10_FIRST ){
@@ -36728,30 +36728,30 @@
36728 return 0.0;
36729 }
36730 if( p>POWERSOF10_LAST ){
36731 return INFINITY;
36732 }
36733 lz = countLeadingZeros(d);
36734 lp = pwr10to2(p);
36735 e1 = lz - (lp + 11);
36736 if( e1>1074 ){
36737 if( e1>=1130 ) return 0.0;
36738 e1 = 1074;
36739 }
36740 h = sqlite3Multiply128(d<<lz, powerOfTen(p));
36741 x = lz - (e1 + lp + 3);
36742 assert( x >= 0 );
36743 assert( x <= 63 );
36744 out = h >> x;
36745 if( out >= U64_BIT(55)-2 ){
36746 out >>= 1;
36747 e1--;
36748 }
36749 if( e1<=(-972) ){
36750 return INFINITY;
36751 }
36752 out = (out + 2) >> 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;
@@ -44829,11 +44829,11 @@
44829 }
44830 }
44831 }
44832
44833 /* Map the requested memory region into this processes address space. */
44834 apNew = (char **)sqlite3_realloc64(
44835 pShmNode->apRegion, nReqRegion*sizeof(char *)
44836 );
44837 if( !apNew ){
44838 rc = SQLITE_IOERR_NOMEM_BKPT;
44839 goto shmpage_out;
@@ -157891,10 +157891,11 @@
157891 || (pList->bReturning && pList->pNext==0) );
157892 if( pList!=0 ){
157893 p = pList;
157894 if( (pParse->db->flags & SQLITE_EnableTrigger)==0
157895 && pTab->pTrigger!=0
157896 && sqlite3SchemaToIndex(pParse->db, pTab->pTrigger->pSchema)!=1
157897 ){
157898 /* The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that
157899 ** only TEMP triggers are allowed. Truncate the pList so that it
157900 ** includes only TEMP triggers */
157901 if( pList==pTab->pTrigger ){
@@ -227233,12 +227234,12 @@
227234 for(i=0; zSql[i]; i++){
227235 char c = zSql[i];
227236
227237 /* If necessary, grow the pIter->aIdxCol[] array */
227238 if( iIdxCol==nIdxAlloc ){
227239 RbuSpan *aIdxCol = (RbuSpan*)sqlite3_realloc64(
227240 pIter->aIdxCol, nIdxAlloc*sizeof(RbuSpan) + 16*sizeof(RbuSpan)
227241 );
227242 if( aIdxCol==0 ){
227243 rc = SQLITE_NOMEM;
227244 break;
227245 }
@@ -242927,11 +242928,11 @@
242928 zEllips = fts5ValueToText(apVal[3]);
242929 nToken = sqlite3_value_int(apVal[4]);
242930
242931 iBestCol = (iCol>=0 ? iCol : 0);
242932 nPhrase = pApi->xPhraseCount(pFts);
242933 aSeen = sqlite3_malloc64(nPhrase);
242934 if( aSeen==0 ){
242935 rc = SQLITE_NOMEM;
242936 }
242937 if( rc==SQLITE_OK ){
242938 rc = pApi->xInstCount(pFts, &nInst);
@@ -243582,11 +243583,11 @@
243583 char *zRet = 0;
243584 if( *pRc==SQLITE_OK ){
243585 if( nIn<0 ){
243586 nIn = (int)strlen(pIn);
243587 }
243588 zRet = (char*)sqlite3_malloc64((i64)nIn+1);
243589 if( zRet ){
243590 memcpy(zRet, pIn, nIn);
243591 zRet[nIn] = '\0';
243592 }else{
243593 *pRc = SQLITE_NOMEM;
@@ -244282,11 +244283,11 @@
244283 Fts5Config *pRet; /* New object to return */
244284 int i;
244285 sqlite3_int64 nByte;
244286 int bUnindexed = 0; /* True if there are one or more UNINDEXED */
244287
244288 *ppOut = pRet = (Fts5Config*)sqlite3_malloc64(sizeof(Fts5Config));
244289 if( pRet==0 ) return SQLITE_NOMEM;
244290 memset(pRet, 0, sizeof(Fts5Config));
244291 pRet->pGlobal = pGlobal;
244292 pRet->db = db;
244293 pRet->iCookie = -1;
@@ -244830,12 +244831,10 @@
244831 }
244832
244833 va_end(ap);
244834 }
244835
 
 
244836 /*
244837 ** 2014 May 31
244838 **
244839 ** The author disclaims copyright to this source code. In place of
244840 ** a legal notice, here is a blessing:
@@ -245148,11 +245147,11 @@
245147 }
245148 }
245149
245150 assert( sParse.rc!=SQLITE_OK || sParse.zErr==0 );
245151 if( sParse.rc==SQLITE_OK ){
245152 *ppNew = pNew = sqlite3_malloc64(sizeof(Fts5Expr));
245153 if( pNew==0 ){
245154 sParse.rc = SQLITE_NOMEM;
245155 sqlite3Fts5ParseNodeFree(sParse.pExpr);
245156 }else{
245157 pNew->pRoot = sParse.pExpr;
@@ -245300,11 +245299,11 @@
245299
245300 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
245301 p2->pRoot = 0;
245302
245303 if( sParse.rc==SQLITE_OK ){
245304 Fts5ExprPhrase **ap = (Fts5ExprPhrase**)sqlite3_realloc64(
245305 p1->apExprPhrase, nPhrase * sizeof(Fts5ExprPhrase*)
245306 );
245307 if( ap==0 ){
245308 sParse.rc = SQLITE_NOMEM;
245309 }else{
@@ -248212,11 +248211,11 @@
248211 */
248212 static int sqlite3Fts5HashNew(Fts5Config *pConfig, Fts5Hash **ppNew, int *pnByte){
248213 int rc = SQLITE_OK;
248214 Fts5Hash *pNew;
248215
248216 *ppNew = pNew = (Fts5Hash*)sqlite3_malloc64(sizeof(Fts5Hash));
248217 if( pNew==0 ){
248218 rc = SQLITE_NOMEM;
248219 }else{
248220 sqlite3_int64 nByte;
248221 memset(pNew, 0, sizeof(Fts5Hash));
@@ -250805,11 +250804,11 @@
250804 i += fts5GetVarint(&a[i], &iDelta);
250805 pIter->iRowid += iDelta;
250806
250807 /* If necessary, grow the pIter->aRowidOffset[] array. */
250808 if( iRowidOffset>=pIter->nRowidOffset ){
250809 i64 nNew = pIter->nRowidOffset + 8;
250810 int *aNew = (int*)sqlite3_realloc64(pIter->aRowidOffset,nNew*sizeof(int));
250811 if( aNew==0 ){
250812 p->rc = SQLITE_NOMEM;
250813 break;
250814 }
@@ -255130,20 +255129,20 @@
255129 ** of Fts5TokenDataMap structures, which are used to find the token required
255130 ** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and
255131 ** aMap[] variables.
255132 */
255133 struct Fts5TokenDataIter {
255134 i64 nMapAlloc; /* Allocated size of aMap[] in entries */
255135 i64 nMap; /* Number of valid entries in aMap[] */
255136 Fts5TokenDataMap *aMap; /* Array of (rowid+pos -> token) mappings */
255137
255138 /* The following are used for prefix-queries only. */
255139 Fts5Buffer terms;
255140
255141 /* The following are used for other full-token tokendata queries only. */
255142 i64 nIter;
255143 i64 nIterAlloc;
255144 Fts5PoslistReader *aPoslistReader;
255145 int *aPoslistToIter;
255146 Fts5Iter *apIter[FLEXARRAY];
255147 };
255148
@@ -255195,15 +255194,15 @@
255194 i64 iRowid,
255195 i64 iPos
255196 ){
255197 if( p->rc==SQLITE_OK ){
255198 if( pT->nMap==pT->nMapAlloc ){
255199 i64 nNew = pT->nMapAlloc ? pT->nMapAlloc*2 : 64;
255200 i64 nAlloc = nNew * sizeof(Fts5TokenDataMap);
255201 Fts5TokenDataMap *aNew;
255202
255203 aNew = (Fts5TokenDataMap*)sqlite3_realloc64(pT->aMap, nAlloc);
255204 if( aNew==0 ){
255205 p->rc = SQLITE_NOMEM;
255206 return;
255207 }
255208
@@ -255225,11 +255224,11 @@
255224 ** The sorting algorithm requires a malloc(). If this fails, an error code
255225 ** is left in Fts5Index.rc before returning.
255226 */
255227 static void fts5TokendataIterSortMap(Fts5Index *p, Fts5TokenDataIter *pT){
255228 Fts5TokenDataMap *aTmp = 0;
255229 i64 nByte = pT->nMap * sizeof(Fts5TokenDataMap);
255230
255231 aTmp = (Fts5TokenDataMap*)sqlite3Fts5MallocZero(&p->rc, nByte);
255232 if( aTmp ){
255233 Fts5TokenDataMap *a1 = pT->aMap;
255234 Fts5TokenDataMap *a2 = aTmp;
@@ -255759,13 +255758,14 @@
255758 ){
255759 Fts5TokenDataIter *pRet = pIn;
255760
255761 if( p->rc==SQLITE_OK ){
255762 if( pIn==0 || pIn->nIter==pIn->nIterAlloc ){
255763 i64 nAlloc = pIn ? pIn->nIterAlloc*2 : 16;
255764 i64 nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
255765 Fts5TokenDataIter *pNew;
255766 pNew = (Fts5TokenDataIter*)sqlite3_realloc64(pIn, nByte);
255767
255768 if( pNew==0 ){
255769 p->rc = SQLITE_NOMEM;
255770 }else{
255771 if( pIn==0 ) memset(pNew, 0, nByte);
@@ -255858,12 +255858,12 @@
255858 return;
255859 }
255860
255861 /* Ensure the token-mapping is large enough */
255862 if( eDetail==FTS5_DETAIL_FULL && pT->nMapAlloc<(pT->nMap + nByte) ){
255863 i64 nNew = (pT->nMapAlloc + nByte) * 2;
255864 Fts5TokenDataMap *aNew = (Fts5TokenDataMap*)sqlite3_realloc64(
255865 pT->aMap, nNew*sizeof(Fts5TokenDataMap)
255866 );
255867 if( aNew==0 ){
255868 pIter->pIndex->rc = SQLITE_NOMEM;
255869 return;
@@ -258888,11 +258888,11 @@
258888 "recursively defined fts5 content table"
258889 );
258890 return SQLITE_ERROR;
258891 }
258892
258893 idxStr = (char*)sqlite3_malloc64((i64)pInfo->nConstraint * 8 + 1);
258894 if( idxStr==0 ) return SQLITE_NOMEM;
258895 pInfo->idxStr = idxStr;
258896 pInfo->needToFreeIdxStr = 1;
258897
258898 for(i=0; i<pInfo->nConstraint; i++){
@@ -261856,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-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61", -1, SQLITE_TRANSIENT);
261862 }
261863
261864 /*
261865 ** Implementation of fts5_locale(LOCALE, TEXT) function.
261866 **
@@ -262020,11 +262020,11 @@
262020 };
262021
262022 int rc;
262023 Fts5Global *pGlobal = 0;
262024
262025 pGlobal = (Fts5Global*)sqlite3_malloc64(sizeof(Fts5Global));
262026 if( pGlobal==0 ){
262027 rc = SQLITE_NOMEM;
262028 }else{
262029 void *p = (void*)pGlobal;
262030 memset(pGlobal, 0, sizeof(Fts5Global));
@@ -263736,11 +263736,11 @@
263736 AsciiTokenizer *p = 0;
263737 UNUSED_PARAM(pUnused);
263738 if( nArg%2 ){
263739 rc = SQLITE_ERROR;
263740 }else{
263741 p = sqlite3_malloc64(sizeof(AsciiTokenizer));
263742 if( p==0 ){
263743 rc = SQLITE_NOMEM;
263744 }else{
263745 int i;
263746 memset(p, 0, sizeof(AsciiTokenizer));
@@ -264031,11 +264031,11 @@
264031 UNUSED_PARAM(pUnused);
264032
264033 if( nArg%2 ){
264034 rc = SQLITE_ERROR;
264035 }else{
264036 p = (Unicode61Tokenizer*)sqlite3_malloc64(sizeof(Unicode61Tokenizer));
264037 if( p ){
264038 const char *zCat = "L* N* Co";
264039 int i;
264040 memset(p, 0, sizeof(Unicode61Tokenizer));
264041
@@ -264254,11 +264254,11 @@
264254
264255 if( nArg>0 ){
264256 zBase = azArg[0];
264257 }
264258
264259 pRet = (PorterTokenizer*)sqlite3_malloc64(sizeof(PorterTokenizer));
264260 if( pRet ){
264261 memset(pRet, 0, sizeof(PorterTokenizer));
264262 rc = pApi->xFindTokenizer_v2(pApi, zBase, &pUserdata, &pV2);
264263 }else{
264264 rc = SQLITE_NOMEM;
@@ -264961,11 +264961,11 @@
264961 UNUSED_PARAM(pUnused);
264962 if( nArg%2 ){
264963 rc = SQLITE_ERROR;
264964 }else{
264965 int i;
264966 pNew = (TrigramTokenizer*)sqlite3_malloc64(sizeof(*pNew));
264967 if( pNew==0 ){
264968 rc = SQLITE_NOMEM;
264969 }else{
264970 pNew->bFold = 1;
264971 pNew->iFoldParam = 0;
@@ -266947,11 +266947,11 @@
266947 }
266948 if( pLe ){
266949 const char *zCopy = (const char *)sqlite3_value_text(pLe);
266950 if( zCopy==0 ) zCopy = "";
266951 pCsr->nLeTerm = sqlite3_value_bytes(pLe);
266952 pCsr->zLeTerm = sqlite3_malloc64((i64)pCsr->nLeTerm+1);
266953 if( pCsr->zLeTerm==0 ){
266954 rc = SQLITE_NOMEM;
266955 }else{
266956 memcpy(pCsr->zLeTerm, zCopy, pCsr->nLeTerm+1);
266957 }
266958
--- 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-27 22:59:46 0780bce854b962fb2d4a1a19c55c9b5790a9669f26e1ff8b5f1f1733cfc647e0"
151
+#define SQLITE_SOURCE_ID "2026-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2026-02-27T22:59:46.633Z"
154
+#define SQLITE_SCM_DATETIME "2026-03-02T17:11:44.720Z"
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.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 **
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.52.0"
150 #define SQLITE_VERSION_NUMBER 3052000
151 #define SQLITE_SOURCE_ID "2026-03-02 17:11:44 88dce64242552e7443d9fb496f6f3ad71dc5b4a882ce21b7ef1d5ea4e26f1e61"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-03-02T17:11:44.720Z"
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