1
1
/******************************************************************************
2
2
** This file is an amalgamation of many separate C source files from SQLite
3
- ** version 3.43.1 . By combining all the individual C code files into this
3
+ ** version 3.43.2 . By combining all the individual C code files into this
4
4
** single large file, the entire code can be compiled as a single translation
5
5
** unit. This allows many compilers to do optimizations that would not be
6
6
** possible if the files were compiled separately. Performance improvements
18
18
** separate file. This file contains only code for the core SQLite library.
19
19
**
20
20
** The content in this amalgamation comes from Fossil check-in
21
- ** d3a40c05c49e1a49264912b1a05bc2143ac .
21
+ ** 310099cce5a487035fa535dd3002c59ac7f .
22
22
*/
23
23
#define SQLITE_CORE 1
24
24
#define SQLITE_AMALGAMATION 1
@@ -459,9 +459,9 @@ extern "C" {
459
459
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460
460
** [sqlite_version()] and [sqlite_source_id()].
461
461
*/
462
- #define SQLITE_VERSION "3.43.1 "
463
- #define SQLITE_VERSION_NUMBER 3043001
464
- #define SQLITE_SOURCE_ID "2023-09-11 12:01:27 2d3a40c05c49e1a49264912b1a05bc2143ac0e7c3df588276ce80a4cbc9bd1b0 "
462
+ #define SQLITE_VERSION "3.43.2 "
463
+ #define SQLITE_VERSION_NUMBER 3043002
464
+ #define SQLITE_SOURCE_ID "2023-10-10 12:14:04 4310099cce5a487035fa535dd3002c59ac7f1d1bec68d7cf317fd3e769484790 "
465
465
466
466
/*
467
467
** CAPI3REF: Run-Time Library Version Numbers
@@ -35185,29 +35185,29 @@ SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRou
35185
35185
double rr[2];
35186
35186
rr[0] = r;
35187
35187
rr[1] = 0.0;
35188
- if( rr[0]>1.84e+19 ){
35189
- while( rr[0]>1.84e+119 ){
35188
+ if( rr[0]>9.223372036854774784e+18 ){
35189
+ while( rr[0]>9.223372036854774784e+118 ){
35190
35190
exp += 100;
35191
35191
dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117);
35192
35192
}
35193
- while( rr[0]>1.84e+29 ){
35193
+ while( rr[0]>9.223372036854774784e+28 ){
35194
35194
exp += 10;
35195
35195
dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27);
35196
35196
}
35197
- while( rr[0]>1.84e+19 ){
35197
+ while( rr[0]>9.223372036854774784e+18 ){
35198
35198
exp += 1;
35199
35199
dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18);
35200
35200
}
35201
35201
}else{
35202
- while( rr[0]<1.84e-82 ){
35202
+ while( rr[0]<9.223372036854774784e-83 ){
35203
35203
exp -= 100;
35204
35204
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
35205
35205
}
35206
- while( rr[0]<1.84e+08 ){
35206
+ while( rr[0]<9.223372036854774784e+07 ){
35207
35207
exp -= 10;
35208
35208
dekkerMul2(rr, 1.0e+10, 0.0);
35209
35209
}
35210
- while( rr[0]<1.84e+18 ){
35210
+ while( rr[0]<9.22337203685477478e+17 ){
35211
35211
exp -= 1;
35212
35212
dekkerMul2(rr, 1.0e+01, 0.0);
35213
35213
}
@@ -77024,6 +77024,7 @@ static int rebuildPage(
77024
77024
int k; /* Current slot in pCArray->apEnd[] */
77025
77025
u8 *pSrcEnd; /* Current pCArray->apEnd[k] value */
77026
77026
77027
+ assert( nCell>0 );
77027
77028
assert( i<iEnd );
77028
77029
j = get2byte(&aData[hdr+5]);
77029
77030
if( NEVER(j>(u32)usableSize) ){ j = 0; }
@@ -77330,6 +77331,7 @@ static int editPage(
77330
77331
return SQLITE_OK;
77331
77332
editpage_fail:
77332
77333
/* Unable to edit this page. Rebuild it from scratch instead. */
77334
+ if( nNew<1 ) return SQLITE_CORRUPT_BKPT;
77333
77335
populateCellCache(pCArray, iNew, nNew);
77334
77336
return rebuildPage(pCArray, iNew, nNew, pPg);
77335
77337
}
@@ -100833,8 +100835,7 @@ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
100833
100835
/* Set the value of register r[1] in the SQL statement to integer iRow.
100834
100836
** This is done directly as a performance optimization
100835
100837
*/
100836
- v->aMem[1].flags = MEM_Int;
100837
- v->aMem[1].u.i = iRow;
100838
+ sqlite3VdbeMemSetInt64(&v->aMem[1], iRow);
100838
100839
100839
100840
/* If the statement has been run before (and is paused at the OP_ResultRow)
100840
100841
** then back it up to the point where it does the OP_NotExists. This could
@@ -204136,6 +204137,7 @@ static void jsonReplaceFunc(
204136
204137
}
204137
204138
pParse = jsonParseCached(ctx, argv[0], ctx, argc>1);
204138
204139
if( pParse==0 ) return;
204140
+ pParse->nJPRef++;
204139
204141
for(i=1; i<(u32)argc; i+=2){
204140
204142
zPath = (const char*)sqlite3_value_text(argv[i]);
204141
204143
pParse->useMod = 1;
@@ -204148,6 +204150,7 @@ static void jsonReplaceFunc(
204148
204150
jsonReturnJson(pParse, pParse->aNode, ctx, 1);
204149
204151
replace_err:
204150
204152
jsonDebugPrintParse(pParse);
204153
+ jsonParseFree(pParse);
204151
204154
}
204152
204155
204153
204156
@@ -204182,6 +204185,7 @@ static void jsonSetFunc(
204182
204185
}
204183
204186
pParse = jsonParseCached(ctx, argv[0], ctx, argc>1);
204184
204187
if( pParse==0 ) return;
204188
+ pParse->nJPRef++;
204185
204189
for(i=1; i<(u32)argc; i+=2){
204186
204190
zPath = (const char*)sqlite3_value_text(argv[i]);
204187
204191
bApnd = 0;
@@ -204198,9 +204202,8 @@ static void jsonSetFunc(
204198
204202
}
204199
204203
jsonDebugPrintParse(pParse);
204200
204204
jsonReturnJson(pParse, pParse->aNode, ctx, 1);
204201
-
204202
204205
jsonSetDone:
204203
- /* no cleanup required */ ;
204206
+ jsonParseFree(pParse) ;
204204
204207
}
204205
204208
204206
204209
/*
@@ -239689,7 +239692,6 @@ static void fts5DoSecureDelete(
239689
239692
int iIdx = 0;
239690
239693
int iStart = 0;
239691
239694
int iKeyOff = 0;
239692
- int iPrevKeyOff = 0;
239693
239695
int iDelKeyOff = 0; /* Offset of deleted key, if any */
239694
239696
239695
239697
nIdx = nPg-iPgIdx;
@@ -244251,6 +244253,9 @@ static int fts5FilterMethod(
244251
244253
pCsr->iFirstRowid = fts5GetRowidLimit(pRowidGe, SMALLEST_INT64);
244252
244254
}
244253
244255
244256
+ rc = sqlite3Fts5IndexLoadConfig(pTab->p.pIndex);
244257
+ if( rc!=SQLITE_OK ) goto filter_out;
244258
+
244254
244259
if( pTab->pSortCsr ){
244255
244260
/* If pSortCsr is non-NULL, then this call is being made as part of
244256
244261
** processing for a "... MATCH <expr> ORDER BY rank" query (ePlan is
@@ -244273,7 +244278,9 @@ static int fts5FilterMethod(
244273
244278
pCsr->pExpr = pTab->pSortCsr->pExpr;
244274
244279
rc = fts5CursorFirst(pTab, pCsr, bDesc);
244275
244280
}else if( pCsr->pExpr ){
244276
- rc = fts5CursorParseRank(pConfig, pCsr, pRank);
244281
+ if( rc==SQLITE_OK ){
244282
+ rc = fts5CursorParseRank(pConfig, pCsr, pRank);
244283
+ }
244277
244284
if( rc==SQLITE_OK ){
244278
244285
if( bOrderByRank ){
244279
244286
pCsr->ePlan = FTS5_PLAN_SORTED_MATCH;
@@ -245754,7 +245761,7 @@ static void fts5SourceIdFunc(
245754
245761
){
245755
245762
assert( nArg==0 );
245756
245763
UNUSED_PARAM2(nArg, apUnused);
245757
- sqlite3_result_text(pCtx, "fts5: 2023-09-11 12:01:27 2d3a40c05c49e1a49264912b1a05bc2143ac0e7c3df588276ce80a4cbc9bd1b0 ", -1, SQLITE_TRANSIENT);
245764
+ sqlite3_result_text(pCtx, "fts5: 2023-10-10 12:14:04 4310099cce5a487035fa535dd3002c59ac7f1d1bec68d7cf317fd3e769484790 ", -1, SQLITE_TRANSIENT);
245758
245765
}
245759
245766
245760
245767
/*
0 commit comments