Fossil SCM

Update the built-in SQLite in order to resolve an unintended C99-ism.

drh 2026-10-17 12:32 UTC trunk
Commit c5bdd31304b92ee7d160798a3f3a3a34ccd798b00e99dd10fad8abd3bad7925b
+52 -22
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -1403,13 +1403,13 @@
14031403
qrfEqpAppend(p, iId, iPid, zo);
14041404
}
14051405
}
14061406
if( p->u.pGraph ) p->u.pGraph->nWidth = nWidth;
14071407
qrfStrErr(p, pLine);
1408
- sqlite3_free(sqlite3_str_finish(pLine));
1408
+ sqlite3_str_free(pLine);
14091409
qrfStrErr(p, pStats);
1410
- sqlite3_free(sqlite3_str_finish(pStats));
1410
+ sqlite3_str_free(pStats);
14111411
#endif
14121412
}
14131413
14141414
14151415
/*
@@ -2921,10 +2921,25 @@
29212921
sumW -= gain;
29222922
pData->a[ix].w -= gain;
29232923
pData->bMultiRow = 1;
29242924
}
29252925
}
2926
+
2927
+/*
2928
+** Invoke sqlite3_str_finish(). But if it returns NULL, try to allocate
2929
+** an empty string to replace the result.
2930
+**
2931
+** The result might still be an empty string, but only after an OOM and
2932
+** in that case qrfOom() has been called already and so it is safe to
2933
+** return immediately.
2934
+*/
2935
+static char *qrfStrFinish(Qrf *p, sqlite3_str *pStr){
2936
+ char *z = sqlite3_str_finish(pStr);
2937
+ if( z==0 ) z = sqlite3_mprintf("");
2938
+ if( z==0 ) qrfOom(p);
2939
+ return z;
2940
+}
29262941
29272942
/*
29282943
** Columnar modes require that the entire query be evaluated first, with
29292944
** results written into memory, so that we can compute appropriate column
29302945
** widths.
@@ -2985,11 +3000,12 @@
29853000
int n, w;
29863001
pStr = sqlite3_str_new(p->db);
29873002
qrfEncodeText(p, pStr, z ? z : "");
29883003
n = sqlite3_str_length(pStr);
29893004
qrfStrErr(p, pStr);
2990
- z = data.az[data.n] = sqlite3_str_finish(pStr);
3005
+ z = data.az[data.n] = qrfStrFinish(p, pStr);
3006
+ if( z==0 ) goto columnar_done;
29913007
if( p->spec.nTitleLimit ){
29923008
nNL = 0;
29933009
data.aiWth[data.n] = w = qrfTitleLimit(data.az[data.n],
29943010
p->spec.nTitleLimit );
29953011
}else{
@@ -3014,11 +3030,12 @@
30143030
int eType = sqlite3_column_type(p->pStmt,i);
30153031
pStr = sqlite3_str_new(p->db);
30163032
qrfRenderValue(p, pStr, i);
30173033
n = sqlite3_str_length(pStr);
30183034
qrfStrErr(p, pStr);
3019
- z = data.az[data.n] = sqlite3_str_finish(pStr);
3035
+ z = data.az[data.n] = qrfStrFinish(p,pStr);
3036
+ if( z==0 ) goto columnar_done;
30203037
data.abNum[data.n] = eType==SQLITE_INTEGER || eType==SQLITE_FLOAT;
30213038
data.aiWth[data.n] = w = qrfDisplayWidth(z, n, &nNL);
30223039
data.n++;
30233040
if( w>data.a[i].mxW ) data.a[i].mxW = w;
30243041
if( nNL ) data.bMultiRow = 1;
@@ -3302,10 +3319,11 @@
33023319
sqlite3_int64 n = p->nRow;
33033320
sqlite3_str_appendf(p->pOut, "(%lld row%s)\n", n, n==1 ? "" : "s");
33043321
}
33053322
qrfWrite(p);
33063323
3324
+columnar_done:
33073325
qrfColDataFree(&data);
33083326
return;
33093327
}
33103328
33113329
/*
@@ -3733,11 +3751,11 @@
37333751
zVal += iNext;
37343752
}while( zVal[0] );
37353753
sqlite3_str_reset(pVal);
37363754
}
37373755
qrfStrErr(p, pVal);
3738
- sqlite3_free(sqlite3_str_finish(pVal));
3756
+ sqlite3_str_free(pVal);
37393757
qrfWrite(p);
37403758
break;
37413759
}
37423760
case QRF_STYLE_Eqp: {
37433761
const char *zEqpLine = (const char*)sqlite3_column_text(p->pStmt,3);
@@ -4016,16 +4034,16 @@
40164034
qrfOom(p);
40174035
}else{
40184036
p->spec.pzOutput[0] = zCombined;
40194037
memcpy(zCombined+sz, sqlite3_str_value(p->pOut), n+1);
40204038
}
4021
- sqlite3_free(sqlite3_str_finish(p->pOut));
4039
+ sqlite3_str_free(p->pOut);
40224040
}else{
4023
- p->spec.pzOutput[0] = sqlite3_str_finish(p->pOut);
4041
+ p->spec.pzOutput[0] = qrfStrFinish(p, p->pOut);
40244042
}
40254043
}else if( p->pOut ){
4026
- sqlite3_free(sqlite3_str_finish(p->pOut));
4044
+ sqlite3_str_free(p->pOut);
40274045
}
40284046
if( p->expMode>0 ){
40294047
sqlite3_stmt_explain(p->pStmt, p->expMode-1);
40304048
}
40314049
if( p->actualWidth ){
@@ -6948,12 +6966,13 @@
69486966
sqlite3_value **argv
69496967
){
69506968
UNUSED_PARAMETER(argc);
69516969
if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){
69526970
int N;
6971
+ Decimal *pA;
69536972
if( decimalSafeInt(context, argv[0], &N) ) return;
6954
- Decimal *pA = decimalPow2(N);
6973
+ pA = decimalPow2(N);
69556974
if( pA ){
69566975
decimal_result_sci(context, pA, 0);
69576976
decimal_free(pA);
69586977
}
69596978
}
@@ -8420,10 +8439,11 @@
84208439
sqlite3_int64 iTerm; /* Terminal value to actually use */
84218440
sqlite3_uint64 iStep; /* The step size */
84228441
sqlite3_int64 iValue; /* Current value */
84238442
u8 bDesc; /* iStep is really negative */
84248443
u8 bDone; /* True if stepped past last element */
8444
+ u8 bLimit; /* There exists a limit clause */
84258445
};
84268446
84278447
/*
84288448
** Computed the difference between two 64-bit signed integers using a
84298449
** convoluted computation designed to work around the silly restriction
@@ -8531,14 +8551,14 @@
85318551
series_cursor *pCur = (series_cursor*)cur;
85328552
if( pCur->iValue==pCur->iTerm ){
85338553
pCur->bDone = 1;
85348554
}else if( pCur->bDesc ){
85358555
pCur->iValue = sub64(pCur->iValue, pCur->iStep);
8536
- assert( pCur->iValue>=pCur->iTerm );
8556
+ assert( pCur->iValue>=pCur->iTerm || pCur->bLimit );
85378557
}else{
85388558
pCur->iValue = add64(pCur->iValue, pCur->iStep);
8539
- assert( pCur->iValue<=pCur->iTerm );
8559
+ assert( pCur->iValue<=pCur->iTerm || pCur->bLimit );
85408560
}
85418561
return SQLITE_OK;
85428562
}
85438563
85448564
/*
@@ -8764,10 +8784,11 @@
87648784
if( idxNum & 0x20 ){
87658785
iLimit = sqlite3_value_int64(argv[iArg++]);
87668786
if( idxNum & 0x40 ){
87678787
iOffset = sqlite3_value_int64(argv[iArg++]);
87688788
}
8789
+ if( iLimit>0 ) pCur->bLimit = 1;
87698790
}
87708791
87718792
/* Narrow the range of iMin and iMax (the minimum and maximum outputs)
87728793
** based on equality and inequality constraints on the "value" column.
87738794
*/
@@ -16235,16 +16256,25 @@
1623516256
char *zName = 0; /* Index name */
1623616257
int collisions = 0;
1623716258
do{
1623816259
int i;
1623916260
char *zFind;
16240
- for(i=0; zCols[i]; i++){
16241
- h += ((h<<3) + zCols[i]);
16242
- }
16261
+
1624316262
sqlite3_free(zName);
16244
- zName = sqlite3_mprintf("%s_idx_%08x", zTable, h);
16263
+ if( collisions<10 ){
16264
+ for(i=0; zCols[i]; i++){
16265
+ h += ((h<<3) + zCols[i]);
16266
+ }
16267
+ zName = sqlite3_mprintf("%s_idx_%08x", zTable, h);
16268
+ }else{
16269
+ /* After several hash attempts, generate a random name */
16270
+ sqlite3_uint64 u;
16271
+ sqlite3_randomness(sizeof(u), &u);
16272
+ zName = sqlite3_mprintf("%s_idx_%llx", zTable, u);
16273
+ }
1624516274
if( zName==0 ) break;
16275
+
1624616276
/* Is is unique among table, view and index names? */
1624716277
zFmt = "SELECT count(*) FROM sqlite_schema WHERE name=%Q"
1624816278
" AND type in ('index','table','view')";
1624916279
zFind = sqlite3_mprintf(zFmt, zName);
1625016280
i = 0;
@@ -16254,12 +16284,12 @@
1625416284
if( i==0 ){
1625516285
collisions = 0;
1625616286
break;
1625716287
}
1625816288
++collisions;
16259
- }while( collisions<50 && zName!=0 );
16260
- if( collisions ){
16289
+ }while( ALWAYS(collisions<500) && zName!=0 );
16290
+ if( NEVER(collisions) ){
1626116291
/* This return means "Gave up trying to find a unique index name." */
1626216292
rc = SQLITE_BUSY_TIMEOUT;
1626316293
}else if( zName==0 ){
1626416294
rc = SQLITE_NOMEM;
1626516295
}else{
@@ -16277,13 +16307,13 @@
1627716307
rc = SQLITE_BUSY_TIMEOUT;
1627816308
}else{
1627916309
idxHashAdd(&rc, &p->hIdx, zName, zIdx);
1628016310
}
1628116311
}
16282
- sqlite3_free(zName);
1628316312
sqlite3_free(zIdx);
1628416313
}
16314
+ sqlite3_free(zName);
1628516315
}
1628616316
1628716317
sqlite3_free(zCols);
1628816318
}
1628916319
return rc;
@@ -34275,14 +34305,14 @@
3427534305
if( i+1>=nArg ){
3427634306
dotCmdError(p, i, "missing argument", 0);
3427734307
return 1;
3427834308
}
3427934309
zW = azArg[++i];
34280
- /* Every width value takes at least 2 bytes in the input string to
34281
- ** specify, so strlen(zW) bytes should be plenty of space to hold the
34282
- ** result. */
34283
- aWidth = malloc( strlen(zW) );
34310
+ /* Every width value except a single-digit final value takes at
34311
+ ** least 2 bytes in the input string to specify, so strlen(zW)+1
34312
+ ** entries is plenty of space to hold the result. */
34313
+ aWidth = malloc( strlen(zW)+1 );
3428434314
while( IsSpace(zW[0]) ) zW++;
3428534315
while( zW[0] ){
3428634316
int w = 0;
3428734317
int nDigit = 0;
3428834318
k = zW[0]=='-' && IsDigit(zW[1]);
3428934319
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -1403,13 +1403,13 @@
1403 qrfEqpAppend(p, iId, iPid, zo);
1404 }
1405 }
1406 if( p->u.pGraph ) p->u.pGraph->nWidth = nWidth;
1407 qrfStrErr(p, pLine);
1408 sqlite3_free(sqlite3_str_finish(pLine));
1409 qrfStrErr(p, pStats);
1410 sqlite3_free(sqlite3_str_finish(pStats));
1411 #endif
1412 }
1413
1414
1415 /*
@@ -2921,10 +2921,25 @@
2921 sumW -= gain;
2922 pData->a[ix].w -= gain;
2923 pData->bMultiRow = 1;
2924 }
2925 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2926
2927 /*
2928 ** Columnar modes require that the entire query be evaluated first, with
2929 ** results written into memory, so that we can compute appropriate column
2930 ** widths.
@@ -2985,11 +3000,12 @@
2985 int n, w;
2986 pStr = sqlite3_str_new(p->db);
2987 qrfEncodeText(p, pStr, z ? z : "");
2988 n = sqlite3_str_length(pStr);
2989 qrfStrErr(p, pStr);
2990 z = data.az[data.n] = sqlite3_str_finish(pStr);
 
2991 if( p->spec.nTitleLimit ){
2992 nNL = 0;
2993 data.aiWth[data.n] = w = qrfTitleLimit(data.az[data.n],
2994 p->spec.nTitleLimit );
2995 }else{
@@ -3014,11 +3030,12 @@
3014 int eType = sqlite3_column_type(p->pStmt,i);
3015 pStr = sqlite3_str_new(p->db);
3016 qrfRenderValue(p, pStr, i);
3017 n = sqlite3_str_length(pStr);
3018 qrfStrErr(p, pStr);
3019 z = data.az[data.n] = sqlite3_str_finish(pStr);
 
3020 data.abNum[data.n] = eType==SQLITE_INTEGER || eType==SQLITE_FLOAT;
3021 data.aiWth[data.n] = w = qrfDisplayWidth(z, n, &nNL);
3022 data.n++;
3023 if( w>data.a[i].mxW ) data.a[i].mxW = w;
3024 if( nNL ) data.bMultiRow = 1;
@@ -3302,10 +3319,11 @@
3302 sqlite3_int64 n = p->nRow;
3303 sqlite3_str_appendf(p->pOut, "(%lld row%s)\n", n, n==1 ? "" : "s");
3304 }
3305 qrfWrite(p);
3306
 
3307 qrfColDataFree(&data);
3308 return;
3309 }
3310
3311 /*
@@ -3733,11 +3751,11 @@
3733 zVal += iNext;
3734 }while( zVal[0] );
3735 sqlite3_str_reset(pVal);
3736 }
3737 qrfStrErr(p, pVal);
3738 sqlite3_free(sqlite3_str_finish(pVal));
3739 qrfWrite(p);
3740 break;
3741 }
3742 case QRF_STYLE_Eqp: {
3743 const char *zEqpLine = (const char*)sqlite3_column_text(p->pStmt,3);
@@ -4016,16 +4034,16 @@
4016 qrfOom(p);
4017 }else{
4018 p->spec.pzOutput[0] = zCombined;
4019 memcpy(zCombined+sz, sqlite3_str_value(p->pOut), n+1);
4020 }
4021 sqlite3_free(sqlite3_str_finish(p->pOut));
4022 }else{
4023 p->spec.pzOutput[0] = sqlite3_str_finish(p->pOut);
4024 }
4025 }else if( p->pOut ){
4026 sqlite3_free(sqlite3_str_finish(p->pOut));
4027 }
4028 if( p->expMode>0 ){
4029 sqlite3_stmt_explain(p->pStmt, p->expMode-1);
4030 }
4031 if( p->actualWidth ){
@@ -6948,12 +6966,13 @@
6948 sqlite3_value **argv
6949 ){
6950 UNUSED_PARAMETER(argc);
6951 if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){
6952 int N;
 
6953 if( decimalSafeInt(context, argv[0], &N) ) return;
6954 Decimal *pA = decimalPow2(N);
6955 if( pA ){
6956 decimal_result_sci(context, pA, 0);
6957 decimal_free(pA);
6958 }
6959 }
@@ -8420,10 +8439,11 @@
8420 sqlite3_int64 iTerm; /* Terminal value to actually use */
8421 sqlite3_uint64 iStep; /* The step size */
8422 sqlite3_int64 iValue; /* Current value */
8423 u8 bDesc; /* iStep is really negative */
8424 u8 bDone; /* True if stepped past last element */
 
8425 };
8426
8427 /*
8428 ** Computed the difference between two 64-bit signed integers using a
8429 ** convoluted computation designed to work around the silly restriction
@@ -8531,14 +8551,14 @@
8531 series_cursor *pCur = (series_cursor*)cur;
8532 if( pCur->iValue==pCur->iTerm ){
8533 pCur->bDone = 1;
8534 }else if( pCur->bDesc ){
8535 pCur->iValue = sub64(pCur->iValue, pCur->iStep);
8536 assert( pCur->iValue>=pCur->iTerm );
8537 }else{
8538 pCur->iValue = add64(pCur->iValue, pCur->iStep);
8539 assert( pCur->iValue<=pCur->iTerm );
8540 }
8541 return SQLITE_OK;
8542 }
8543
8544 /*
@@ -8764,10 +8784,11 @@
8764 if( idxNum & 0x20 ){
8765 iLimit = sqlite3_value_int64(argv[iArg++]);
8766 if( idxNum & 0x40 ){
8767 iOffset = sqlite3_value_int64(argv[iArg++]);
8768 }
 
8769 }
8770
8771 /* Narrow the range of iMin and iMax (the minimum and maximum outputs)
8772 ** based on equality and inequality constraints on the "value" column.
8773 */
@@ -16235,16 +16256,25 @@
16235 char *zName = 0; /* Index name */
16236 int collisions = 0;
16237 do{
16238 int i;
16239 char *zFind;
16240 for(i=0; zCols[i]; i++){
16241 h += ((h<<3) + zCols[i]);
16242 }
16243 sqlite3_free(zName);
16244 zName = sqlite3_mprintf("%s_idx_%08x", zTable, h);
 
 
 
 
 
 
 
 
 
 
16245 if( zName==0 ) break;
 
16246 /* Is is unique among table, view and index names? */
16247 zFmt = "SELECT count(*) FROM sqlite_schema WHERE name=%Q"
16248 " AND type in ('index','table','view')";
16249 zFind = sqlite3_mprintf(zFmt, zName);
16250 i = 0;
@@ -16254,12 +16284,12 @@
16254 if( i==0 ){
16255 collisions = 0;
16256 break;
16257 }
16258 ++collisions;
16259 }while( collisions<50 && zName!=0 );
16260 if( collisions ){
16261 /* This return means "Gave up trying to find a unique index name." */
16262 rc = SQLITE_BUSY_TIMEOUT;
16263 }else if( zName==0 ){
16264 rc = SQLITE_NOMEM;
16265 }else{
@@ -16277,13 +16307,13 @@
16277 rc = SQLITE_BUSY_TIMEOUT;
16278 }else{
16279 idxHashAdd(&rc, &p->hIdx, zName, zIdx);
16280 }
16281 }
16282 sqlite3_free(zName);
16283 sqlite3_free(zIdx);
16284 }
 
16285 }
16286
16287 sqlite3_free(zCols);
16288 }
16289 return rc;
@@ -34275,14 +34305,14 @@
34275 if( i+1>=nArg ){
34276 dotCmdError(p, i, "missing argument", 0);
34277 return 1;
34278 }
34279 zW = azArg[++i];
34280 /* Every width value takes at least 2 bytes in the input string to
34281 ** specify, so strlen(zW) bytes should be plenty of space to hold the
34282 ** result. */
34283 aWidth = malloc( strlen(zW) );
34284 while( IsSpace(zW[0]) ) zW++;
34285 while( zW[0] ){
34286 int w = 0;
34287 int nDigit = 0;
34288 k = zW[0]=='-' && IsDigit(zW[1]);
34289
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -1403,13 +1403,13 @@
1403 qrfEqpAppend(p, iId, iPid, zo);
1404 }
1405 }
1406 if( p->u.pGraph ) p->u.pGraph->nWidth = nWidth;
1407 qrfStrErr(p, pLine);
1408 sqlite3_str_free(pLine);
1409 qrfStrErr(p, pStats);
1410 sqlite3_str_free(pStats);
1411 #endif
1412 }
1413
1414
1415 /*
@@ -2921,10 +2921,25 @@
2921 sumW -= gain;
2922 pData->a[ix].w -= gain;
2923 pData->bMultiRow = 1;
2924 }
2925 }
2926
2927 /*
2928 ** Invoke sqlite3_str_finish(). But if it returns NULL, try to allocate
2929 ** an empty string to replace the result.
2930 **
2931 ** The result might still be an empty string, but only after an OOM and
2932 ** in that case qrfOom() has been called already and so it is safe to
2933 ** return immediately.
2934 */
2935 static char *qrfStrFinish(Qrf *p, sqlite3_str *pStr){
2936 char *z = sqlite3_str_finish(pStr);
2937 if( z==0 ) z = sqlite3_mprintf("");
2938 if( z==0 ) qrfOom(p);
2939 return z;
2940 }
2941
2942 /*
2943 ** Columnar modes require that the entire query be evaluated first, with
2944 ** results written into memory, so that we can compute appropriate column
2945 ** widths.
@@ -2985,11 +3000,12 @@
3000 int n, w;
3001 pStr = sqlite3_str_new(p->db);
3002 qrfEncodeText(p, pStr, z ? z : "");
3003 n = sqlite3_str_length(pStr);
3004 qrfStrErr(p, pStr);
3005 z = data.az[data.n] = qrfStrFinish(p, pStr);
3006 if( z==0 ) goto columnar_done;
3007 if( p->spec.nTitleLimit ){
3008 nNL = 0;
3009 data.aiWth[data.n] = w = qrfTitleLimit(data.az[data.n],
3010 p->spec.nTitleLimit );
3011 }else{
@@ -3014,11 +3030,12 @@
3030 int eType = sqlite3_column_type(p->pStmt,i);
3031 pStr = sqlite3_str_new(p->db);
3032 qrfRenderValue(p, pStr, i);
3033 n = sqlite3_str_length(pStr);
3034 qrfStrErr(p, pStr);
3035 z = data.az[data.n] = qrfStrFinish(p,pStr);
3036 if( z==0 ) goto columnar_done;
3037 data.abNum[data.n] = eType==SQLITE_INTEGER || eType==SQLITE_FLOAT;
3038 data.aiWth[data.n] = w = qrfDisplayWidth(z, n, &nNL);
3039 data.n++;
3040 if( w>data.a[i].mxW ) data.a[i].mxW = w;
3041 if( nNL ) data.bMultiRow = 1;
@@ -3302,10 +3319,11 @@
3319 sqlite3_int64 n = p->nRow;
3320 sqlite3_str_appendf(p->pOut, "(%lld row%s)\n", n, n==1 ? "" : "s");
3321 }
3322 qrfWrite(p);
3323
3324 columnar_done:
3325 qrfColDataFree(&data);
3326 return;
3327 }
3328
3329 /*
@@ -3733,11 +3751,11 @@
3751 zVal += iNext;
3752 }while( zVal[0] );
3753 sqlite3_str_reset(pVal);
3754 }
3755 qrfStrErr(p, pVal);
3756 sqlite3_str_free(pVal);
3757 qrfWrite(p);
3758 break;
3759 }
3760 case QRF_STYLE_Eqp: {
3761 const char *zEqpLine = (const char*)sqlite3_column_text(p->pStmt,3);
@@ -4016,16 +4034,16 @@
4034 qrfOom(p);
4035 }else{
4036 p->spec.pzOutput[0] = zCombined;
4037 memcpy(zCombined+sz, sqlite3_str_value(p->pOut), n+1);
4038 }
4039 sqlite3_str_free(p->pOut);
4040 }else{
4041 p->spec.pzOutput[0] = qrfStrFinish(p, p->pOut);
4042 }
4043 }else if( p->pOut ){
4044 sqlite3_str_free(p->pOut);
4045 }
4046 if( p->expMode>0 ){
4047 sqlite3_stmt_explain(p->pStmt, p->expMode-1);
4048 }
4049 if( p->actualWidth ){
@@ -6948,12 +6966,13 @@
6966 sqlite3_value **argv
6967 ){
6968 UNUSED_PARAMETER(argc);
6969 if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){
6970 int N;
6971 Decimal *pA;
6972 if( decimalSafeInt(context, argv[0], &N) ) return;
6973 pA = decimalPow2(N);
6974 if( pA ){
6975 decimal_result_sci(context, pA, 0);
6976 decimal_free(pA);
6977 }
6978 }
@@ -8420,10 +8439,11 @@
8439 sqlite3_int64 iTerm; /* Terminal value to actually use */
8440 sqlite3_uint64 iStep; /* The step size */
8441 sqlite3_int64 iValue; /* Current value */
8442 u8 bDesc; /* iStep is really negative */
8443 u8 bDone; /* True if stepped past last element */
8444 u8 bLimit; /* There exists a limit clause */
8445 };
8446
8447 /*
8448 ** Computed the difference between two 64-bit signed integers using a
8449 ** convoluted computation designed to work around the silly restriction
@@ -8531,14 +8551,14 @@
8551 series_cursor *pCur = (series_cursor*)cur;
8552 if( pCur->iValue==pCur->iTerm ){
8553 pCur->bDone = 1;
8554 }else if( pCur->bDesc ){
8555 pCur->iValue = sub64(pCur->iValue, pCur->iStep);
8556 assert( pCur->iValue>=pCur->iTerm || pCur->bLimit );
8557 }else{
8558 pCur->iValue = add64(pCur->iValue, pCur->iStep);
8559 assert( pCur->iValue<=pCur->iTerm || pCur->bLimit );
8560 }
8561 return SQLITE_OK;
8562 }
8563
8564 /*
@@ -8764,10 +8784,11 @@
8784 if( idxNum & 0x20 ){
8785 iLimit = sqlite3_value_int64(argv[iArg++]);
8786 if( idxNum & 0x40 ){
8787 iOffset = sqlite3_value_int64(argv[iArg++]);
8788 }
8789 if( iLimit>0 ) pCur->bLimit = 1;
8790 }
8791
8792 /* Narrow the range of iMin and iMax (the minimum and maximum outputs)
8793 ** based on equality and inequality constraints on the "value" column.
8794 */
@@ -16235,16 +16256,25 @@
16256 char *zName = 0; /* Index name */
16257 int collisions = 0;
16258 do{
16259 int i;
16260 char *zFind;
16261
 
 
16262 sqlite3_free(zName);
16263 if( collisions<10 ){
16264 for(i=0; zCols[i]; i++){
16265 h += ((h<<3) + zCols[i]);
16266 }
16267 zName = sqlite3_mprintf("%s_idx_%08x", zTable, h);
16268 }else{
16269 /* After several hash attempts, generate a random name */
16270 sqlite3_uint64 u;
16271 sqlite3_randomness(sizeof(u), &u);
16272 zName = sqlite3_mprintf("%s_idx_%llx", zTable, u);
16273 }
16274 if( zName==0 ) break;
16275
16276 /* Is is unique among table, view and index names? */
16277 zFmt = "SELECT count(*) FROM sqlite_schema WHERE name=%Q"
16278 " AND type in ('index','table','view')";
16279 zFind = sqlite3_mprintf(zFmt, zName);
16280 i = 0;
@@ -16254,12 +16284,12 @@
16284 if( i==0 ){
16285 collisions = 0;
16286 break;
16287 }
16288 ++collisions;
16289 }while( ALWAYS(collisions<500) && zName!=0 );
16290 if( NEVER(collisions) ){
16291 /* This return means "Gave up trying to find a unique index name." */
16292 rc = SQLITE_BUSY_TIMEOUT;
16293 }else if( zName==0 ){
16294 rc = SQLITE_NOMEM;
16295 }else{
@@ -16277,13 +16307,13 @@
16307 rc = SQLITE_BUSY_TIMEOUT;
16308 }else{
16309 idxHashAdd(&rc, &p->hIdx, zName, zIdx);
16310 }
16311 }
 
16312 sqlite3_free(zIdx);
16313 }
16314 sqlite3_free(zName);
16315 }
16316
16317 sqlite3_free(zCols);
16318 }
16319 return rc;
@@ -34275,14 +34305,14 @@
34305 if( i+1>=nArg ){
34306 dotCmdError(p, i, "missing argument", 0);
34307 return 1;
34308 }
34309 zW = azArg[++i];
34310 /* Every width value except a single-digit final value takes at
34311 ** least 2 bytes in the input string to specify, so strlen(zW)+1
34312 ** entries is plenty of space to hold the result. */
34313 aWidth = malloc( strlen(zW)+1 );
34314 while( IsSpace(zW[0]) ) zW++;
34315 while( zW[0] ){
34316 int w = 0;
34317 int nDigit = 0;
34318 k = zW[0]=='-' && IsDigit(zW[1]);
34319
+36 -15
--- 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
-** 668541c592b89d32716420615450d55d9faf with changes in files:
21
+** c75eff906c11d8f17ae198e5f6cfea34636d 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.55.0"
471471
#define SQLITE_VERSION_NUMBER 3055000
472
-#define SQLITE_SOURCE_ID "2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98"
472
+#define SQLITE_SOURCE_ID "2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918"
473473
#define SQLITE_SCM_BRANCH "trunk"
474474
#define SQLITE_SCM_TAGS ""
475
-#define SQLITE_SCM_DATETIME "2026-10-16T14:31:53.543Z"
475
+#define SQLITE_SCM_DATETIME "2026-10-17T12:10:02.088Z"
476476
477477
/*
478478
** CAPI3REF: Run-Time Library Version Numbers
479479
** KEYWORDS: sqlite3_version sqlite3_sourceid
480480
**
@@ -86455,15 +86455,20 @@
8645586455
** stored without allocating memory, then it is. If a memory allocation
8645686456
** is required to store the string, then value of pMem is unchanged. In
8645786457
** either case, SQLITE_TOOBIG is returned.
8645886458
**
8645986459
** The "enc" parameter is the text encoding for the string, or zero
86460
-** to store a blob.
86460
+** to store a blob. If enc not 0 or SQLITE_UTF8 and the string
86461
+** begins with a BOM, the BOM is removed. To retain the BOM on a UTF16
86462
+** string, use a non-negative "n" and set enc to SQLITE_UTF8, and
86463
+** separately set pMem->enc to the correct encoding after this function
86464
+** returns.
8646186465
**
86462
-** If n is negative, then the string consists of all bytes up to but
86463
-** excluding the first zero character. The n parameter must be
86464
-** non-negative for blobs.
86466
+** If n is negative and enc is not zero and is set correctly, then the
86467
+** string consists of all bytes up to but excluding the first zero
86468
+** character. The n parameter must be non-negative for blobs or if
86469
+** enc is not set accurately.
8646586470
*/
8646686471
SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
8646786472
Mem *pMem, /* Memory cell to set to string value */
8646886473
const char *z, /* String pointer */
8646986474
i64 n, /* Bytes in string, or negative */
@@ -86548,10 +86553,14 @@
8654886553
pMem->n = (int)(nByte & 0x7fffffff);
8654986554
pMem->flags = flags;
8655086555
pMem->enc = enc;
8655186556
8655286557
#ifndef SQLITE_OMIT_UTF16
86558
+ /* tag-20261016-1: To retain the BOM, use enc==SQLITE_UTF8, even
86559
+ ** for UTF-16 text, and then set pMem->enc correctly after this
86560
+ ** function returns. Note, however, that n must be non-negative
86561
+ ** for this trick to work. */
8655386562
if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
8655486563
return SQLITE_NOMEM_BKPT;
8655586564
}
8655686565
#endif
8655786566
@@ -93405,10 +93414,11 @@
9340593414
*/
9340693415
SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
9340793416
int i;
9340893417
int rc = SQLITE_OK;
9340993418
Vdbe *p = (Vdbe*)pStmt;
93419
+ u32 maskSmallInt = 0; /* Bitmask of bindings with value 0 or 1 */
9341093420
#if SQLITE_THREADSAFE
9341193421
sqlite3_mutex *mutex;
9341293422
#endif
9341393423
#ifdef SQLITE_ENABLE_API_ARMOR
9341493424
if( pStmt==0 ){
@@ -93416,17 +93426,22 @@
9341693426
}
9341793427
#endif
9341893428
#if SQLITE_THREADSAFE
9341993429
mutex = p->db->mutex;
9342093430
#endif
93431
+
9342193432
sqlite3_mutex_enter(mutex);
9342293433
for(i=0; i<p->nVar; i++){
93423
- sqlite3VdbeMemRelease(&p->aVar[i]);
93424
- p->aVar[i].flags = MEM_Null;
93434
+ Mem *pVar = &p->aVar[i];
93435
+ if( (pVar->flags & MEM_Int)!=0 && pVar->u.i>=0 && pVar->u.i<=1 ){
93436
+ maskSmallInt |= i>=31 ? 0x80000000 : ((u32)1)<<i;
93437
+ }
93438
+ sqlite3VdbeMemRelease(pVar);
93439
+ pVar->flags = MEM_Null;
9342593440
}
9342693441
assert( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 || p->expmask==0 );
93427
- if( p->expmask ){
93442
+ if( (p->expmask&~p->smimask)!=0 || (p->smimask&maskSmallInt)!=0 ){
9342893443
p->expired = 1;
9342993444
}
9343093445
sqlite3_mutex_leave(mutex);
9343193446
return rc;
9343293447
}
@@ -97077,18 +97092,22 @@
9707797092
pBuf = pCache->pCValue;
9707897093
}
9707997094
assert( t>=12 );
9708097095
sqlite3RCStrRef(pBuf);
9708197096
if( t&1 ){
97082
- rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, encoding,
97097
+ /* Prevents the removal of a BOM in UTF16 text. Otherwise
97098
+ ** it causes no harm as long as len>=0, and pDest->enc is set
97099
+ ** to the correct encoding afterwards: ----
97100
+ ** (tag-20261016-1) `vvvvvvvvvvv */
97101
+ rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, SQLITE_UTF8,
9708397102
sqlite3RCStrUnref);
9708497103
pDest->flags |= MEM_Term;
9708597104
}else{
9708697105
rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, 0,
9708797106
sqlite3RCStrUnref);
97088
- pDest->enc = encoding;
97089
- }
97107
+ }
97108
+ pDest->enc = encoding;
9709097109
}else{
9709197110
rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, iOffset, len, pDest);
9709297111
if( rc ) return rc;
9709397112
sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
9709497113
if( (t&1)!=0 && encoding==SQLITE_UTF8 ){
@@ -136644,11 +136663,11 @@
136644136663
pGCC->str.nChar = 0;
136645136664
}else{
136646136665
pGCC->str.nChar -= nVS;
136647136666
memmove(pGCC->str.zText, &pGCC->str.zText[nVS], pGCC->str.nChar);
136648136667
}
136649
- if( pGCC->str.nChar==0 ){
136668
+ if( pGCC->nAccum==0 ){
136650136669
pGCC->str.mxAlloc = 0;
136651136670
sqlite3_free(pGCC->pnSepLengths);
136652136671
pGCC->pnSepLengths = 0;
136653136672
}
136654136673
}
@@ -155892,10 +155911,11 @@
155892155911
assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
155893155912
zTName = pE->pLeft->u.zToken;
155894155913
assert( ExprUseWOfst(pE->pLeft) );
155895155914
iErrOfst = pE->pRight->w.iOfst;
155896155915
}else{
155916
+ assert( pE->pLeft==0 );
155897155917
assert( ExprUseWOfst(pE) );
155898155918
iErrOfst = pE->w.iOfst;
155899155919
}
155900155920
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
155901155921
int nAdd; /* Number of cols including rowid */
@@ -156014,10 +156034,11 @@
156014156034
){
156015156035
Expr *pLeft;
156016156036
pLeft = sqlite3Expr(db, TK_ID, zTabName);
156017156037
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
156018156038
if( IN_RENAME_OBJECT && pE->pLeft ){
156039
+ assert( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK );
156019156040
sqlite3RenameTokenRemap(pParse, pLeft, pE->pLeft);
156020156041
}
156021156042
if( zSchemaName ){
156022156043
pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
156023156044
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
@@ -265750,11 +265771,11 @@
265750265771
int nArg, /* Number of args */
265751265772
sqlite3_value **apUnused /* Function arguments */
265752265773
){
265753265774
assert( nArg==0 );
265754265775
UNUSED_PARAM2(nArg, apUnused);
265755
- sqlite3_result_text(pCtx, "fts5: 2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98", -1, SQLITE_TRANSIENT);
265776
+ sqlite3_result_text(pCtx, "fts5: 2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918", -1, SQLITE_TRANSIENT);
265756265777
}
265757265778
265758265779
/*
265759265780
** Implementation of fts5_locale(LOCALE, TEXT) function.
265760265781
**
265761265782
--- 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 ** 668541c592b89d32716420615450d55d9faf 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.55.0"
471 #define SQLITE_VERSION_NUMBER 3055000
472 #define SQLITE_SOURCE_ID "2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-10-16T14:31:53.543Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -86455,15 +86455,20 @@
86455 ** stored without allocating memory, then it is. If a memory allocation
86456 ** is required to store the string, then value of pMem is unchanged. In
86457 ** either case, SQLITE_TOOBIG is returned.
86458 **
86459 ** The "enc" parameter is the text encoding for the string, or zero
86460 ** to store a blob.
 
 
 
 
86461 **
86462 ** If n is negative, then the string consists of all bytes up to but
86463 ** excluding the first zero character. The n parameter must be
86464 ** non-negative for blobs.
 
86465 */
86466 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
86467 Mem *pMem, /* Memory cell to set to string value */
86468 const char *z, /* String pointer */
86469 i64 n, /* Bytes in string, or negative */
@@ -86548,10 +86553,14 @@
86548 pMem->n = (int)(nByte & 0x7fffffff);
86549 pMem->flags = flags;
86550 pMem->enc = enc;
86551
86552 #ifndef SQLITE_OMIT_UTF16
 
 
 
 
86553 if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
86554 return SQLITE_NOMEM_BKPT;
86555 }
86556 #endif
86557
@@ -93405,10 +93414,11 @@
93405 */
93406 SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
93407 int i;
93408 int rc = SQLITE_OK;
93409 Vdbe *p = (Vdbe*)pStmt;
 
93410 #if SQLITE_THREADSAFE
93411 sqlite3_mutex *mutex;
93412 #endif
93413 #ifdef SQLITE_ENABLE_API_ARMOR
93414 if( pStmt==0 ){
@@ -93416,17 +93426,22 @@
93416 }
93417 #endif
93418 #if SQLITE_THREADSAFE
93419 mutex = p->db->mutex;
93420 #endif
 
93421 sqlite3_mutex_enter(mutex);
93422 for(i=0; i<p->nVar; i++){
93423 sqlite3VdbeMemRelease(&p->aVar[i]);
93424 p->aVar[i].flags = MEM_Null;
 
 
 
 
93425 }
93426 assert( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 || p->expmask==0 );
93427 if( p->expmask ){
93428 p->expired = 1;
93429 }
93430 sqlite3_mutex_leave(mutex);
93431 return rc;
93432 }
@@ -97077,18 +97092,22 @@
97077 pBuf = pCache->pCValue;
97078 }
97079 assert( t>=12 );
97080 sqlite3RCStrRef(pBuf);
97081 if( t&1 ){
97082 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, encoding,
 
 
 
 
97083 sqlite3RCStrUnref);
97084 pDest->flags |= MEM_Term;
97085 }else{
97086 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, 0,
97087 sqlite3RCStrUnref);
97088 pDest->enc = encoding;
97089 }
97090 }else{
97091 rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, iOffset, len, pDest);
97092 if( rc ) return rc;
97093 sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
97094 if( (t&1)!=0 && encoding==SQLITE_UTF8 ){
@@ -136644,11 +136663,11 @@
136644 pGCC->str.nChar = 0;
136645 }else{
136646 pGCC->str.nChar -= nVS;
136647 memmove(pGCC->str.zText, &pGCC->str.zText[nVS], pGCC->str.nChar);
136648 }
136649 if( pGCC->str.nChar==0 ){
136650 pGCC->str.mxAlloc = 0;
136651 sqlite3_free(pGCC->pnSepLengths);
136652 pGCC->pnSepLengths = 0;
136653 }
136654 }
@@ -155892,10 +155911,11 @@
155892 assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
155893 zTName = pE->pLeft->u.zToken;
155894 assert( ExprUseWOfst(pE->pLeft) );
155895 iErrOfst = pE->pRight->w.iOfst;
155896 }else{
 
155897 assert( ExprUseWOfst(pE) );
155898 iErrOfst = pE->w.iOfst;
155899 }
155900 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
155901 int nAdd; /* Number of cols including rowid */
@@ -156014,10 +156034,11 @@
156014 ){
156015 Expr *pLeft;
156016 pLeft = sqlite3Expr(db, TK_ID, zTabName);
156017 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
156018 if( IN_RENAME_OBJECT && pE->pLeft ){
 
156019 sqlite3RenameTokenRemap(pParse, pLeft, pE->pLeft);
156020 }
156021 if( zSchemaName ){
156022 pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
156023 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
@@ -265750,11 +265771,11 @@
265750 int nArg, /* Number of args */
265751 sqlite3_value **apUnused /* Function arguments */
265752 ){
265753 assert( nArg==0 );
265754 UNUSED_PARAM2(nArg, apUnused);
265755 sqlite3_result_text(pCtx, "fts5: 2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98", -1, SQLITE_TRANSIENT);
265756 }
265757
265758 /*
265759 ** Implementation of fts5_locale(LOCALE, TEXT) function.
265760 **
265761
--- 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 ** c75eff906c11d8f17ae198e5f6cfea34636d 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.55.0"
471 #define SQLITE_VERSION_NUMBER 3055000
472 #define SQLITE_SOURCE_ID "2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-10-17T12:10:02.088Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -86455,15 +86455,20 @@
86455 ** stored without allocating memory, then it is. If a memory allocation
86456 ** is required to store the string, then value of pMem is unchanged. In
86457 ** either case, SQLITE_TOOBIG is returned.
86458 **
86459 ** The "enc" parameter is the text encoding for the string, or zero
86460 ** to store a blob. If enc not 0 or SQLITE_UTF8 and the string
86461 ** begins with a BOM, the BOM is removed. To retain the BOM on a UTF16
86462 ** string, use a non-negative "n" and set enc to SQLITE_UTF8, and
86463 ** separately set pMem->enc to the correct encoding after this function
86464 ** returns.
86465 **
86466 ** If n is negative and enc is not zero and is set correctly, then the
86467 ** string consists of all bytes up to but excluding the first zero
86468 ** character. The n parameter must be non-negative for blobs or if
86469 ** enc is not set accurately.
86470 */
86471 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
86472 Mem *pMem, /* Memory cell to set to string value */
86473 const char *z, /* String pointer */
86474 i64 n, /* Bytes in string, or negative */
@@ -86548,10 +86553,14 @@
86553 pMem->n = (int)(nByte & 0x7fffffff);
86554 pMem->flags = flags;
86555 pMem->enc = enc;
86556
86557 #ifndef SQLITE_OMIT_UTF16
86558 /* tag-20261016-1: To retain the BOM, use enc==SQLITE_UTF8, even
86559 ** for UTF-16 text, and then set pMem->enc correctly after this
86560 ** function returns. Note, however, that n must be non-negative
86561 ** for this trick to work. */
86562 if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
86563 return SQLITE_NOMEM_BKPT;
86564 }
86565 #endif
86566
@@ -93405,10 +93414,11 @@
93414 */
93415 SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
93416 int i;
93417 int rc = SQLITE_OK;
93418 Vdbe *p = (Vdbe*)pStmt;
93419 u32 maskSmallInt = 0; /* Bitmask of bindings with value 0 or 1 */
93420 #if SQLITE_THREADSAFE
93421 sqlite3_mutex *mutex;
93422 #endif
93423 #ifdef SQLITE_ENABLE_API_ARMOR
93424 if( pStmt==0 ){
@@ -93416,17 +93426,22 @@
93426 }
93427 #endif
93428 #if SQLITE_THREADSAFE
93429 mutex = p->db->mutex;
93430 #endif
93431
93432 sqlite3_mutex_enter(mutex);
93433 for(i=0; i<p->nVar; i++){
93434 Mem *pVar = &p->aVar[i];
93435 if( (pVar->flags & MEM_Int)!=0 && pVar->u.i>=0 && pVar->u.i<=1 ){
93436 maskSmallInt |= i>=31 ? 0x80000000 : ((u32)1)<<i;
93437 }
93438 sqlite3VdbeMemRelease(pVar);
93439 pVar->flags = MEM_Null;
93440 }
93441 assert( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 || p->expmask==0 );
93442 if( (p->expmask&~p->smimask)!=0 || (p->smimask&maskSmallInt)!=0 ){
93443 p->expired = 1;
93444 }
93445 sqlite3_mutex_leave(mutex);
93446 return rc;
93447 }
@@ -97077,18 +97092,22 @@
97092 pBuf = pCache->pCValue;
97093 }
97094 assert( t>=12 );
97095 sqlite3RCStrRef(pBuf);
97096 if( t&1 ){
97097 /* Prevents the removal of a BOM in UTF16 text. Otherwise
97098 ** it causes no harm as long as len>=0, and pDest->enc is set
97099 ** to the correct encoding afterwards: ----
97100 ** (tag-20261016-1) `vvvvvvvvvvv */
97101 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, SQLITE_UTF8,
97102 sqlite3RCStrUnref);
97103 pDest->flags |= MEM_Term;
97104 }else{
97105 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, 0,
97106 sqlite3RCStrUnref);
97107 }
97108 pDest->enc = encoding;
97109 }else{
97110 rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, iOffset, len, pDest);
97111 if( rc ) return rc;
97112 sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
97113 if( (t&1)!=0 && encoding==SQLITE_UTF8 ){
@@ -136644,11 +136663,11 @@
136663 pGCC->str.nChar = 0;
136664 }else{
136665 pGCC->str.nChar -= nVS;
136666 memmove(pGCC->str.zText, &pGCC->str.zText[nVS], pGCC->str.nChar);
136667 }
136668 if( pGCC->nAccum==0 ){
136669 pGCC->str.mxAlloc = 0;
136670 sqlite3_free(pGCC->pnSepLengths);
136671 pGCC->pnSepLengths = 0;
136672 }
136673 }
@@ -155892,10 +155911,11 @@
155911 assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
155912 zTName = pE->pLeft->u.zToken;
155913 assert( ExprUseWOfst(pE->pLeft) );
155914 iErrOfst = pE->pRight->w.iOfst;
155915 }else{
155916 assert( pE->pLeft==0 );
155917 assert( ExprUseWOfst(pE) );
155918 iErrOfst = pE->w.iOfst;
155919 }
155920 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
155921 int nAdd; /* Number of cols including rowid */
@@ -156014,10 +156034,11 @@
156034 ){
156035 Expr *pLeft;
156036 pLeft = sqlite3Expr(db, TK_ID, zTabName);
156037 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
156038 if( IN_RENAME_OBJECT && pE->pLeft ){
156039 assert( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK );
156040 sqlite3RenameTokenRemap(pParse, pLeft, pE->pLeft);
156041 }
156042 if( zSchemaName ){
156043 pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
156044 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
@@ -265750,11 +265771,11 @@
265771 int nArg, /* Number of args */
265772 sqlite3_value **apUnused /* Function arguments */
265773 ){
265774 assert( nArg==0 );
265775 UNUSED_PARAM2(nArg, apUnused);
265776 sqlite3_result_text(pCtx, "fts5: 2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918", -1, SQLITE_TRANSIENT);
265777 }
265778
265779 /*
265780 ** Implementation of fts5_locale(LOCALE, TEXT) function.
265781 **
265782
--- 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.55.0"
150150
#define SQLITE_VERSION_NUMBER 3055000
151
-#define SQLITE_SOURCE_ID "2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98"
151
+#define SQLITE_SOURCE_ID "2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2026-10-16T14:31:53.543Z"
154
+#define SQLITE_SCM_DATETIME "2026-10-17T12:10:02.088Z"
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.55.0"
150 #define SQLITE_VERSION_NUMBER 3055000
151 #define SQLITE_SOURCE_ID "2026-10-16 14:31:53 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-10-16T14:31:53.543Z"
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.55.0"
150 #define SQLITE_VERSION_NUMBER 3055000
151 #define SQLITE_SOURCE_ID "2026-10-17 12:10:02 c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-10-17T12:10:02.088Z"
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