Fossil SCM

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

drh 2023-02-14 11:42 trunk
Commit 7b5057745a201da631f4e6835f0378c2e915daef344f1bb16db4969d6b3a61c6
+2 -2
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -20619,11 +20619,11 @@
2061920619
i64 i, iStart;
2062020620
sqlite3_stmt *pStmt = 0;
2062120621
char *zSql;
2062220622
char zBuf[1000];
2062320623
20624
- if( nLine>sizeof(zBuf)-30 ) return;
20624
+ if( nLine>(i64)sizeof(zBuf)-30 ) return;
2062520625
if( zLine[0]=='.' || zLine[0]=='#') return;
2062620626
for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
2062720627
if( i==nLine-1 ) return;
2062820628
iStart = i+1;
2062920629
memcpy(zBuf, zLine, iStart);
@@ -20635,11 +20635,11 @@
2063520635
sqlite3_free(zSql);
2063620636
sqlite3_exec(globalDb, "PRAGMA page_count", 0, 0, 0); /* Load the schema */
2063720637
while( sqlite3_step(pStmt)==SQLITE_ROW ){
2063820638
const char *zCompletion = (const char*)sqlite3_column_text(pStmt, 0);
2063920639
int nCompletion = sqlite3_column_bytes(pStmt, 0);
20640
- if( iStart+nCompletion < sizeof(zBuf)-1 && zCompletion ){
20640
+ if( iStart+nCompletion < (i64)sizeof(zBuf)-1 && zCompletion ){
2064120641
memcpy(zBuf+iStart, zCompletion, nCompletion+1);
2064220642
linenoiseAddCompletion(lc, zBuf);
2064320643
}
2064420644
}
2064520645
sqlite3_finalize(pStmt);
2064620646
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -20619,11 +20619,11 @@
20619 i64 i, iStart;
20620 sqlite3_stmt *pStmt = 0;
20621 char *zSql;
20622 char zBuf[1000];
20623
20624 if( nLine>sizeof(zBuf)-30 ) return;
20625 if( zLine[0]=='.' || zLine[0]=='#') return;
20626 for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
20627 if( i==nLine-1 ) return;
20628 iStart = i+1;
20629 memcpy(zBuf, zLine, iStart);
@@ -20635,11 +20635,11 @@
20635 sqlite3_free(zSql);
20636 sqlite3_exec(globalDb, "PRAGMA page_count", 0, 0, 0); /* Load the schema */
20637 while( sqlite3_step(pStmt)==SQLITE_ROW ){
20638 const char *zCompletion = (const char*)sqlite3_column_text(pStmt, 0);
20639 int nCompletion = sqlite3_column_bytes(pStmt, 0);
20640 if( iStart+nCompletion < sizeof(zBuf)-1 && zCompletion ){
20641 memcpy(zBuf+iStart, zCompletion, nCompletion+1);
20642 linenoiseAddCompletion(lc, zBuf);
20643 }
20644 }
20645 sqlite3_finalize(pStmt);
20646
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -20619,11 +20619,11 @@
20619 i64 i, iStart;
20620 sqlite3_stmt *pStmt = 0;
20621 char *zSql;
20622 char zBuf[1000];
20623
20624 if( nLine>(i64)sizeof(zBuf)-30 ) return;
20625 if( zLine[0]=='.' || zLine[0]=='#') return;
20626 for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
20627 if( i==nLine-1 ) return;
20628 iStart = i+1;
20629 memcpy(zBuf, zLine, iStart);
@@ -20635,11 +20635,11 @@
20635 sqlite3_free(zSql);
20636 sqlite3_exec(globalDb, "PRAGMA page_count", 0, 0, 0); /* Load the schema */
20637 while( sqlite3_step(pStmt)==SQLITE_ROW ){
20638 const char *zCompletion = (const char*)sqlite3_column_text(pStmt, 0);
20639 int nCompletion = sqlite3_column_bytes(pStmt, 0);
20640 if( iStart+nCompletion < (i64)sizeof(zBuf)-1 && zCompletion ){
20641 memcpy(zBuf+iStart, zCompletion, nCompletion+1);
20642 linenoiseAddCompletion(lc, zBuf);
20643 }
20644 }
20645 sqlite3_finalize(pStmt);
20646
+146 -146
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452452
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453453
** [sqlite_version()] and [sqlite_source_id()].
454454
*/
455455
#define SQLITE_VERSION "3.41.0"
456456
#define SQLITE_VERSION_NUMBER 3041000
457
-#define SQLITE_SOURCE_ID "2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355"
457
+#define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
458458
459459
/*
460460
** CAPI3REF: Run-Time Library Version Numbers
461461
** KEYWORDS: sqlite3_version sqlite3_sourceid
462462
**
@@ -14400,19 +14400,13 @@
1440014400
*/
1440114401
#define SQLITE_MAX_U32 ((((u64)1)<<32)-1)
1440214402
1440314403
/*
1440414404
** The datatype used to store estimates of the number of rows in a
14405
-** table or index. This is an unsigned integer type. For 99.9% of
14406
-** the world, a 32-bit integer is sufficient. But a 64-bit integer
14407
-** can be used at compile-time if desired.
14405
+** table or index.
1440814406
*/
14409
-#ifdef SQLITE_64BIT_STATS
14410
- typedef u64 tRowcnt; /* 64-bit only if requested at compile-time */
14411
-#else
14412
- typedef u32 tRowcnt; /* 32-bit is the default */
14413
-#endif
14407
+typedef u64 tRowcnt;
1441414408
1441514409
/*
1441614410
** Estimated quantities used for query planning are stored as 16-bit
1441714411
** logarithms. For quantity X, the value stored is 10*log2(X). This
1441814412
** gives a possible range of values of approximately 1.0e986 to 1e-986.
@@ -17116,11 +17110,10 @@
1711617110
u8 mTrace; /* zero or more SQLITE_TRACE flags */
1711717111
u8 noSharedCache; /* True if no shared-cache backends */
1711817112
u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
1711917113
u8 eOpenState; /* Current condition of the connection */
1712017114
int nextPagesize; /* Pagesize after VACUUM if >0 */
17121
- i64 txnTime; /* Timestamp for current transaction */
1712217115
i64 nChange; /* Value returned by sqlite3_changes() */
1712317116
i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
1712417117
int aLimit[SQLITE_N_LIMIT]; /* Limits */
1712517118
int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
1712617119
struct sqlite3InitInfo { /* Information used during initialization */
@@ -20836,11 +20829,11 @@
2083620829
SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
2083720830
#if (defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)) \
2083820831
&& !defined(SQLITE_OMIT_VIRTUALTABLE)
2083920832
SQLITE_PRIVATE void sqlite3VtabUsesAllSchemas(sqlite3_index_info*);
2084020833
#endif
20841
-SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*, int);
20834
+SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
2084220835
SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
2084320836
SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
2084420837
SQLITE_PRIVATE void sqlite3ParseObjectInit(Parse*,sqlite3*);
2084520838
SQLITE_PRIVATE void sqlite3ParseObjectReset(Parse*);
2084620839
SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
@@ -23824,20 +23817,16 @@
2382423817
}
2382523818
return 0;
2382623819
}
2382723820
2382823821
/*
23829
-** Set the time to the current time reported for the prepared statement
23830
-** that is currently executing. The same time is reported for all
23831
-** invocations of this routine from within the same call to sqlite3_step().
23832
-**
23833
-** Or if bTxn is true, use the transaction time.
23822
+** Set the time to the current time reported by the VFS.
2383423823
**
2383523824
** Return the number of errors.
2383623825
*/
23837
-static int setCurrentStmtTime(sqlite3_context *context, DateTime *p, int bTxn){
23838
- p->iJD = sqlite3StmtCurrentTime(context, bTxn);
23826
+static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
23827
+ p->iJD = sqlite3StmtCurrentTime(context);
2383923828
if( p->iJD>0 ){
2384023829
p->validJD = 1;
2384123830
return 0;
2384223831
}else{
2384323832
return 1;
@@ -23884,13 +23873,11 @@
2388423873
if( parseYyyyMmDd(zDate,p)==0 ){
2388523874
return 0;
2388623875
}else if( parseHhMmSs(zDate, p)==0 ){
2388723876
return 0;
2388823877
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
23889
- return setCurrentStmtTime(context, p, 0);
23890
- }else if( sqlite3StrICmp(zDate,"txn")==0 && sqlite3NotPureFunc(context) ){
23891
- return setCurrentStmtTime(context, p, 1);
23878
+ return setDateTimeToCurrent(context, p);
2389223879
}else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
2389323880
setRawDateNumber(p, r);
2389423881
return 0;
2389523882
}
2389623883
return 1;
@@ -24248,11 +24235,11 @@
2424824235
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
2424924236
if( p->tzSet==0 ){
2425024237
i64 iOrigJD; /* Original localtime */
2425124238
i64 iGuess; /* Guess at the corresponding utc time */
2425224239
int cnt = 0; /* Safety to prevent infinite loop */
24253
- int iErr; /* Guess is off by this much */
24240
+ i64 iErr; /* Guess is off by this much */
2425424241
2425524242
computeJD(p);
2425624243
iGuess = iOrigJD = p->iJD;
2425724244
iErr = 0;
2425824245
do{
@@ -24430,15 +24417,12 @@
2443024417
** Process time function arguments. argv[0] is a date-time stamp.
2443124418
** argv[1] and following are modifiers. Parse them all and write
2443224419
** the resulting time into the DateTime structure p. Return 0
2443324420
** on success and 1 if there are any errors.
2443424421
**
24435
-** If there are zero parameters (if argc<=0) then assume a default
24436
-** value of "now" for argv[0] if argc==0 and "txn" if argc<0. SQL
24437
-** functions will always have argc>=0, but the special implementations
24438
-** of CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP set argc to -1
24439
-** in order to force the use of 'txn' semantics.
24422
+** If there are zero parameters (if even argv[0] is undefined)
24423
+** then assume a default value of "now" for argv[0].
2444024424
*/
2444124425
static int isDate(
2444224426
sqlite3_context *context,
2444324427
int argc,
2444424428
sqlite3_value **argv,
@@ -24446,13 +24430,13 @@
2444624430
){
2444724431
int i, n;
2444824432
const unsigned char *z;
2444924433
int eType;
2445024434
memset(p, 0, sizeof(*p));
24451
- if( argc<=0 ){
24435
+ if( argc==0 ){
2445224436
if( !sqlite3NotPureFunc(context) ) return 1;
24453
- return setCurrentStmtTime(context, p, argc<0);
24437
+ return setDateTimeToCurrent(context, p);
2445424438
}
2445524439
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
2445624440
|| eType==SQLITE_INTEGER ){
2445724441
setRawDateNumber(p, sqlite3_value_double(argv[0]));
2445824442
}else{
@@ -24755,11 +24739,11 @@
2475524739
sqlite3_context *context,
2475624740
int NotUsed,
2475724741
sqlite3_value **NotUsed2
2475824742
){
2475924743
UNUSED_PARAMETER2(NotUsed, NotUsed2);
24760
- timeFunc(context, -1, 0);
24744
+ timeFunc(context, 0, 0);
2476124745
}
2476224746
2476324747
/*
2476424748
** current_date()
2476524749
**
@@ -24769,11 +24753,11 @@
2476924753
sqlite3_context *context,
2477024754
int NotUsed,
2477124755
sqlite3_value **NotUsed2
2477224756
){
2477324757
UNUSED_PARAMETER2(NotUsed, NotUsed2);
24774
- dateFunc(context, -1, 0);
24758
+ dateFunc(context, 0, 0);
2477524759
}
2477624760
2477724761
/*
2477824762
** current_timestamp()
2477924763
**
@@ -24783,11 +24767,11 @@
2478324767
sqlite3_context *context,
2478424768
int NotUsed,
2478524769
sqlite3_value **NotUsed2
2478624770
){
2478724771
UNUSED_PARAMETER2(NotUsed, NotUsed2);
24788
- datetimeFunc(context, -1, 0);
24772
+ datetimeFunc(context, 0, 0);
2478924773
}
2479024774
#endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
2479124775
2479224776
#ifdef SQLITE_OMIT_DATETIME_FUNCS
2479324777
/*
@@ -24814,11 +24798,11 @@
2481424798
char zBuf[20];
2481524799
2481624800
UNUSED_PARAMETER(argc);
2481724801
UNUSED_PARAMETER(argv);
2481824802
24819
- iT = sqlite3StmtCurrentTime(context, 1);
24803
+ iT = sqlite3StmtCurrentTime(context);
2482024804
if( iT<=0 ) return;
2482124805
t = iT/1000 - 10000*(sqlite3_int64)21086676;
2482224806
#if HAVE_GMTIME_R
2482324807
pTm = gmtime_r(&t, &sNow);
2482424808
#else
@@ -59055,11 +59039,10 @@
5905559039
** the xSync primitive is called and is relevant to all platforms.
5905659040
**
5905759041
** Numeric values associated with these states are OFF==1, NORMAL=2,
5905859042
** and FULL=3.
5905959043
*/
59060
-#ifndef SQLITE_OMIT_PAGER_PRAGMAS
5906159044
SQLITE_PRIVATE void sqlite3PagerSetFlags(
5906259045
Pager *pPager, /* The pager to set safety level for */
5906359046
unsigned pgFlags /* Various flags */
5906459047
){
5906559048
unsigned level = pgFlags & PAGER_SYNCHRONOUS_MASK;
@@ -59090,11 +59073,10 @@
5909059073
pPager->doNotSpill &= ~SPILLFLAG_OFF;
5909159074
}else{
5909259075
pPager->doNotSpill |= SPILLFLAG_OFF;
5909359076
}
5909459077
}
59095
-#endif
5909659078
5909759079
/*
5909859080
** The following global variable is incremented whenever the library
5909959081
** attempts to open a temporary file. This information is used for
5910059082
** testing and analysis only.
@@ -60494,22 +60476,11 @@
6049460476
pPager->exclusiveMode = (u8)tempFile;
6049560477
pPager->changeCountDone = pPager->tempFile;
6049660478
pPager->memDb = (u8)memDb;
6049760479
pPager->readOnly = (u8)readOnly;
6049860480
assert( useJournal || pPager->tempFile );
60499
- pPager->noSync = pPager->tempFile;
60500
- if( pPager->noSync ){
60501
- assert( pPager->fullSync==0 );
60502
- assert( pPager->extraSync==0 );
60503
- assert( pPager->syncFlags==0 );
60504
- assert( pPager->walSyncFlags==0 );
60505
- }else{
60506
- pPager->fullSync = 1;
60507
- pPager->extraSync = 0;
60508
- pPager->syncFlags = SQLITE_SYNC_NORMAL;
60509
- pPager->walSyncFlags = SQLITE_SYNC_NORMAL | (SQLITE_SYNC_NORMAL<<2);
60510
- }
60481
+ sqlite3PagerSetFlags(pPager, (SQLITE_DEFAULT_SYNCHRONOUS+1)|PAGER_CACHESPILL);
6051160482
/* pPager->pFirst = 0; */
6051260483
/* pPager->pFirstSynced = 0; */
6051360484
/* pPager->pLast = 0; */
6051460485
pPager->nExtra = (u16)nExtra;
6051560486
pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
@@ -81926,15 +81897,15 @@
8192681897
rc = SQLITE_TOOBIG;
8192781898
pCtx->pParse->nErr++;
8192881899
}
8192981900
#endif
8193081901
}
81931
- pCtx->pParse->rc = rc;
8193281902
8193381903
value_from_function_out:
8193481904
if( rc!=SQLITE_OK ){
8193581905
pVal = 0;
81906
+ pCtx->pParse->rc = rc;
8193681907
}
8193781908
if( apVal ){
8193881909
for(i=0; i<nVal; i++){
8193981910
sqlite3ValueFree(apVal[i]);
8194081911
}
@@ -85785,11 +85756,10 @@
8578585756
** by connection db have now been released. Call sqlite3ConnectionUnlocked()
8578685757
** to invoke any required unlock-notify callbacks.
8578785758
*/
8578885759
if( db->autoCommit ){
8578985760
sqlite3ConnectionUnlocked(db);
85790
- db->txnTime = 0;
8579185761
}
8579285762
8579385763
assert( db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0 );
8579485764
return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK);
8579585765
}
@@ -88744,31 +88714,22 @@
8874488714
** Return the current time for a statement. If the current time
8874588715
** is requested more than once within the same run of a single prepared
8874688716
** statement, the exact same time is returned for each invocation regardless
8874788717
** of the amount of time that elapses between invocations. In other words,
8874888718
** the time returned is always the time of the first call.
88749
-**
88750
-** Or, if bTxn, return the transaction time. The transaction time is the
88751
-** same for all calls within the same transaction.
88752
-**
88753
-** bTxn is 0 for SQL like datetime('now') and is 1 for datetime('txn').
8875488719
*/
88755
-SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p, int bTxn){
88720
+SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
8875688721
int rc;
8875788722
#ifndef SQLITE_ENABLE_STAT4
88758
- sqlite3_int64 *piTime;
88759
- sqlite3 *db = p->pOut->db;
88723
+ sqlite3_int64 *piTime = &p->pVdbe->iCurrentTime;
8876088724
assert( p->pVdbe!=0 );
88761
- piTime = bTxn ? &db->txnTime : &p->pVdbe->iCurrentTime;
8876288725
#else
8876388726
sqlite3_int64 iTime = 0;
88764
- sqlite3_int64 *piTime;
88765
- sqlite3 *db = p->pOut->db;
88766
- piTime = bTxn ? &db->txnTime : p->pVdbe!=0 ? &p->pVdbe->iCurrentTime : &iTime;
88727
+ sqlite3_int64 *piTime = p->pVdbe!=0 ? &p->pVdbe->iCurrentTime : &iTime;
8876788728
#endif
8876888729
if( *piTime==0 ){
88769
- rc = sqlite3OsCurrentTimeInt64(db->pVfs, piTime);
88730
+ rc = sqlite3OsCurrentTimeInt64(p->pOut->db->pVfs, piTime);
8877088731
if( rc ) *piTime = 0;
8877188732
}
8877288733
return *piTime;
8877388734
}
8877488735
@@ -109856,14 +109817,17 @@
109856109817
case INLINEFUNC_affinity: {
109857109818
/* The AFFINITY() function evaluates to a string that describes
109858109819
** the type affinity of the argument. This is used for testing of
109859109820
** the SQLite type logic.
109860109821
*/
109861
- const char *azAff[] = { "blob", "text", "numeric", "integer", "real" };
109822
+ const char *azAff[] = { "blob", "text", "numeric", "integer",
109823
+ "real", "flexnum" };
109862109824
char aff;
109863109825
assert( nFarg==1 );
109864109826
aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
109827
+ assert( aff<=SQLITE_AFF_NONE
109828
+ || (aff>=SQLITE_AFF_BLOB && aff<=SQLITE_AFF_FLEXNUM) );
109865109829
sqlite3VdbeLoadString(v, target,
109866109830
(aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]);
109867109831
break;
109868109832
}
109869109833
#endif /* !defined(SQLITE_UNTESTABLE) */
@@ -152720,72 +152684,79 @@
152720152684
int iEq, /* Look at loop terms starting here */
152721152685
WhereLoop *pLoop, /* The current loop */
152722152686
Expr *pX /* The IN expression to be reduced */
152723152687
){
152724152688
sqlite3 *db = pParse->db;
152689
+ Select *pSelect; /* Pointer to the SELECT on the RHS */
152725152690
Expr *pNew;
152726152691
pNew = sqlite3ExprDup(db, pX, 0);
152727152692
if( db->mallocFailed==0 ){
152728
- ExprList *pOrigRhs; /* Original unmodified RHS */
152729
- ExprList *pOrigLhs; /* Original unmodified LHS */
152730
- ExprList *pRhs = 0; /* New RHS after modifications */
152731
- ExprList *pLhs = 0; /* New LHS after mods */
152732
- int i; /* Loop counter */
152733
- Select *pSelect; /* Pointer to the SELECT on the RHS */
152734
-
152735
- assert( ExprUseXSelect(pNew) );
152736
- pOrigRhs = pNew->x.pSelect->pEList;
152737
- assert( pNew->pLeft!=0 );
152738
- assert( ExprUseXList(pNew->pLeft) );
152739
- pOrigLhs = pNew->pLeft->x.pList;
152740
- for(i=iEq; i<pLoop->nLTerm; i++){
152741
- if( pLoop->aLTerm[i]->pExpr==pX ){
152742
- int iField;
152743
- assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 );
152744
- iField = pLoop->aLTerm[i]->u.x.iField - 1;
152745
- if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */
152746
- pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr);
152747
- pOrigRhs->a[iField].pExpr = 0;
152748
- assert( pOrigLhs->a[iField].pExpr!=0 );
152749
- pLhs = sqlite3ExprListAppend(pParse, pLhs, pOrigLhs->a[iField].pExpr);
152750
- pOrigLhs->a[iField].pExpr = 0;
152751
- }
152752
- }
152753
- sqlite3ExprListDelete(db, pOrigRhs);
152754
- sqlite3ExprListDelete(db, pOrigLhs);
152755
- pNew->pLeft->x.pList = pLhs;
152756
- pNew->x.pSelect->pEList = pRhs;
152757
- if( pLhs && pLhs->nExpr==1 ){
152758
- /* Take care here not to generate a TK_VECTOR containing only a
152759
- ** single value. Since the parser never creates such a vector, some
152760
- ** of the subroutines do not handle this case. */
152761
- Expr *p = pLhs->a[0].pExpr;
152762
- pLhs->a[0].pExpr = 0;
152763
- sqlite3ExprDelete(db, pNew->pLeft);
152764
- pNew->pLeft = p;
152765
- }
152766
- pSelect = pNew->x.pSelect;
152767
- if( pSelect->pOrderBy ){
152768
- /* If the SELECT statement has an ORDER BY clause, zero the
152769
- ** iOrderByCol variables. These are set to non-zero when an
152770
- ** ORDER BY term exactly matches one of the terms of the
152771
- ** result-set. Since the result-set of the SELECT statement may
152772
- ** have been modified or reordered, these variables are no longer
152773
- ** set correctly. Since setting them is just an optimization,
152774
- ** it's easiest just to zero them here. */
152775
- ExprList *pOrderBy = pSelect->pOrderBy;
152776
- for(i=0; i<pOrderBy->nExpr; i++){
152777
- pOrderBy->a[i].u.x.iOrderByCol = 0;
152778
- }
152779
- }
152693
+ for(pSelect=pNew->x.pSelect; pSelect; pSelect=pSelect->pPrior){
152694
+ ExprList *pOrigRhs; /* Original unmodified RHS */
152695
+ ExprList *pOrigLhs = 0; /* Original unmodified LHS */
152696
+ ExprList *pRhs = 0; /* New RHS after modifications */
152697
+ ExprList *pLhs = 0; /* New LHS after mods */
152698
+ int i; /* Loop counter */
152699
+
152700
+ assert( ExprUseXSelect(pNew) );
152701
+ pOrigRhs = pSelect->pEList;
152702
+ assert( pNew->pLeft!=0 );
152703
+ assert( ExprUseXList(pNew->pLeft) );
152704
+ if( pSelect==pNew->x.pSelect ){
152705
+ pOrigLhs = pNew->pLeft->x.pList;
152706
+ }
152707
+ for(i=iEq; i<pLoop->nLTerm; i++){
152708
+ if( pLoop->aLTerm[i]->pExpr==pX ){
152709
+ int iField;
152710
+ assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 );
152711
+ iField = pLoop->aLTerm[i]->u.x.iField - 1;
152712
+ if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */
152713
+ pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr);
152714
+ pOrigRhs->a[iField].pExpr = 0;
152715
+ if( pOrigLhs ){
152716
+ assert( pOrigLhs->a[iField].pExpr!=0 );
152717
+ pLhs = sqlite3ExprListAppend(pParse,pLhs,pOrigLhs->a[iField].pExpr);
152718
+ pOrigLhs->a[iField].pExpr = 0;
152719
+ }
152720
+ }
152721
+ }
152722
+ sqlite3ExprListDelete(db, pOrigRhs);
152723
+ if( pOrigLhs ){
152724
+ sqlite3ExprListDelete(db, pOrigLhs);
152725
+ pNew->pLeft->x.pList = pLhs;
152726
+ }
152727
+ pSelect->pEList = pRhs;
152728
+ if( pLhs && pLhs->nExpr==1 ){
152729
+ /* Take care here not to generate a TK_VECTOR containing only a
152730
+ ** single value. Since the parser never creates such a vector, some
152731
+ ** of the subroutines do not handle this case. */
152732
+ Expr *p = pLhs->a[0].pExpr;
152733
+ pLhs->a[0].pExpr = 0;
152734
+ sqlite3ExprDelete(db, pNew->pLeft);
152735
+ pNew->pLeft = p;
152736
+ }
152737
+ if( pSelect->pOrderBy ){
152738
+ /* If the SELECT statement has an ORDER BY clause, zero the
152739
+ ** iOrderByCol variables. These are set to non-zero when an
152740
+ ** ORDER BY term exactly matches one of the terms of the
152741
+ ** result-set. Since the result-set of the SELECT statement may
152742
+ ** have been modified or reordered, these variables are no longer
152743
+ ** set correctly. Since setting them is just an optimization,
152744
+ ** it's easiest just to zero them here. */
152745
+ ExprList *pOrderBy = pSelect->pOrderBy;
152746
+ for(i=0; i<pOrderBy->nExpr; i++){
152747
+ pOrderBy->a[i].u.x.iOrderByCol = 0;
152748
+ }
152749
+ }
152780152750
152781152751
#if 0
152782
- printf("For indexing, change the IN expr:\n");
152783
- sqlite3TreeViewExpr(0, pX, 0);
152784
- printf("Into:\n");
152785
- sqlite3TreeViewExpr(0, pNew, 0);
152752
+ printf("For indexing, change the IN expr:\n");
152753
+ sqlite3TreeViewExpr(0, pX, 0);
152754
+ printf("Into:\n");
152755
+ sqlite3TreeViewExpr(0, pNew, 0);
152786152756
#endif
152757
+ }
152787152758
}
152788152759
return pNew;
152789152760
}
152790152761
152791152762
@@ -155993,60 +155964,70 @@
155993155964
** true even if that particular column is not indexed, because the column
155994155965
** might be added to an automatic index later.
155995155966
*/
155996155967
static SQLITE_NOINLINE int exprMightBeIndexed2(
155997155968
SrcList *pFrom, /* The FROM clause */
155998
- Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
155999155969
int *aiCurCol, /* Write the referenced table cursor and column here */
156000
- Expr *pExpr /* An operand of a comparison operator */
155970
+ Expr *pExpr, /* An operand of a comparison operator */
155971
+ int j /* Start looking with the j-th pFrom entry */
156001155972
){
156002155973
Index *pIdx;
156003155974
int i;
156004155975
int iCur;
156005
- for(i=0; mPrereq>1; i++, mPrereq>>=1){}
156006
- iCur = pFrom->a[i].iCursor;
156007
- for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
156008
- if( pIdx->aColExpr==0 ) continue;
156009
- for(i=0; i<pIdx->nKeyCol; i++){
156010
- if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
156011
- assert( pIdx->bHasExpr );
156012
- if( sqlite3ExprCompareSkip(pExpr, pIdx->aColExpr->a[i].pExpr, iCur)==0 ){
156013
- aiCurCol[0] = iCur;
156014
- aiCurCol[1] = XN_EXPR;
156015
- return 1;
155976
+ do{
155977
+ iCur = pFrom->a[j].iCursor;
155978
+ for(pIdx=pFrom->a[j].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
155979
+ if( pIdx->aColExpr==0 ) continue;
155980
+ for(i=0; i<pIdx->nKeyCol; i++){
155981
+ if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
155982
+ assert( pIdx->bHasExpr );
155983
+ if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
155984
+ && pExpr->op!=TK_STRING
155985
+ ){
155986
+ aiCurCol[0] = iCur;
155987
+ aiCurCol[1] = XN_EXPR;
155988
+ return 1;
155989
+ }
156016155990
}
156017155991
}
156018
- }
155992
+ }while( ++j < pFrom->nSrc );
156019155993
return 0;
156020155994
}
156021155995
static int exprMightBeIndexed(
156022155996
SrcList *pFrom, /* The FROM clause */
156023
- Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
156024155997
int *aiCurCol, /* Write the referenced table cursor & column here */
156025155998
Expr *pExpr, /* An operand of a comparison operator */
156026155999
int op /* The specific comparison operator */
156027156000
){
156001
+ int i;
156002
+
156028156003
/* If this expression is a vector to the left or right of a
156029156004
** inequality constraint (>, <, >= or <=), perform the processing
156030156005
** on the first element of the vector. */
156031156006
assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE );
156032156007
assert( TK_IS<TK_GE && TK_ISNULL<TK_GE && TK_IN<TK_GE );
156033156008
assert( op<=TK_GE );
156034156009
if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){
156035156010
assert( ExprUseXList(pExpr) );
156036156011
pExpr = pExpr->x.pList->a[0].pExpr;
156037
-
156038156012
}
156039156013
156040156014
if( pExpr->op==TK_COLUMN ){
156041156015
aiCurCol[0] = pExpr->iTable;
156042156016
aiCurCol[1] = pExpr->iColumn;
156043156017
return 1;
156044156018
}
156045
- if( mPrereq==0 ) return 0; /* No table references */
156046
- if( (mPrereq&(mPrereq-1))!=0 ) return 0; /* Refs more than one table */
156047
- return exprMightBeIndexed2(pFrom,mPrereq,aiCurCol,pExpr);
156019
+
156020
+ for(i=0; i<pFrom->nSrc; i++){
156021
+ Index *pIdx;
156022
+ for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
156023
+ if( pIdx->aColExpr ){
156024
+ return exprMightBeIndexed2(pFrom,aiCurCol,pExpr,i);
156025
+ }
156026
+ }
156027
+ }
156028
+ return 0;
156048156029
}
156049156030
156050156031
156051156032
/*
156052156033
** The input to this routine is an WhereTerm structure with only the
@@ -156168,19 +156149,19 @@
156168156149
assert( pLeft->op==TK_VECTOR );
156169156150
assert( ExprUseXList(pLeft) );
156170156151
pLeft = pLeft->x.pList->a[pTerm->u.x.iField-1].pExpr;
156171156152
}
156172156153
156173
- if( exprMightBeIndexed(pSrc, prereqLeft, aiCurCol, pLeft, op) ){
156154
+ if( exprMightBeIndexed(pSrc, aiCurCol, pLeft, op) ){
156174156155
pTerm->leftCursor = aiCurCol[0];
156175156156
assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 );
156176156157
pTerm->u.x.leftColumn = aiCurCol[1];
156177156158
pTerm->eOperator = operatorMask(op) & opMask;
156178156159
}
156179156160
if( op==TK_IS ) pTerm->wtFlags |= TERM_IS;
156180156161
if( pRight
156181
- && exprMightBeIndexed(pSrc, pTerm->prereqRight, aiCurCol, pRight, op)
156162
+ && exprMightBeIndexed(pSrc, aiCurCol, pRight, op)
156182156163
&& !ExprHasProperty(pRight, EP_FixedCol)
156183156164
){
156184156165
WhereTerm *pNew;
156185156166
Expr *pDup;
156186156167
u16 eExtraOp = 0; /* Extra bits for pNew->eOperator */
@@ -156387,18 +156368,18 @@
156387156368
sqlite3ExprAddCollateString(pParse,pNewExpr1,zCollSeqName),
156388156369
pStr1);
156389156370
transferJoinMarkings(pNewExpr1, pExpr);
156390156371
idxNew1 = whereClauseInsert(pWC, pNewExpr1, wtFlags);
156391156372
testcase( idxNew1==0 );
156392
- exprAnalyze(pSrc, pWC, idxNew1);
156393156373
pNewExpr2 = sqlite3ExprDup(db, pLeft, 0);
156394156374
pNewExpr2 = sqlite3PExpr(pParse, TK_LT,
156395156375
sqlite3ExprAddCollateString(pParse,pNewExpr2,zCollSeqName),
156396156376
pStr2);
156397156377
transferJoinMarkings(pNewExpr2, pExpr);
156398156378
idxNew2 = whereClauseInsert(pWC, pNewExpr2, wtFlags);
156399156379
testcase( idxNew2==0 );
156380
+ exprAnalyze(pSrc, pWC, idxNew1);
156400156381
exprAnalyze(pSrc, pWC, idxNew2);
156401156382
pTerm = &pWC->a[idxTerm];
156402156383
if( isComplete ){
156403156384
markTermAsChild(pWC, idxNew1, idxTerm);
156404156385
markTermAsChild(pWC, idxNew2, idxTerm);
@@ -156451,11 +156432,11 @@
156451156432
*/
156452156433
else if( pExpr->op==TK_IN
156453156434
&& pTerm->u.x.iField==0
156454156435
&& pExpr->pLeft->op==TK_VECTOR
156455156436
&& ALWAYS( ExprUseXSelect(pExpr) )
156456
- && pExpr->x.pSelect->pPrior==0
156437
+ && (pExpr->x.pSelect->pPrior==0 || (pExpr->x.pSelect->selFlags & SF_Values))
156457156438
#ifndef SQLITE_OMIT_WINDOWFUNC
156458156439
&& pExpr->x.pSelect->pWin==0
156459156440
#endif
156460156441
&& pWC->op==TK_AND
156461156442
){
@@ -171278,10 +171259,15 @@
171278171259
if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){
171279171260
yymsp[-1].minor.yy322->a[0].pExpr = 0;
171280171261
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171281171262
pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
171282171263
yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy528, pRHS);
171264
+ }else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
171265
+ yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
171266
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pRHS->x.pSelect);
171267
+ pRHS->x.pSelect = 0;
171268
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171283171269
}else{
171284171270
yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
171285171271
if( yymsp[-4].minor.yy528==0 ){
171286171272
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171287171273
}else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
@@ -227206,10 +227192,23 @@
227206227192
227207227193
sqlite3_free(sParse.apPhrase);
227208227194
*pzErr = sParse.zErr;
227209227195
return sParse.rc;
227210227196
}
227197
+
227198
+/*
227199
+** Assuming that buffer z is at least nByte bytes in size and contains a
227200
+** valid utf-8 string, return the number of characters in the string.
227201
+*/
227202
+static int fts5ExprCountChar(const char *z, int nByte){
227203
+ int nRet = 0;
227204
+ int ii;
227205
+ for(ii=0; ii<nByte; ii++){
227206
+ if( (z[ii] & 0xC0)!=0x80 ) nRet++;
227207
+ }
227208
+ return nRet;
227209
+}
227211227210
227212227211
/*
227213227212
** This function is only called when using the special 'trigram' tokenizer.
227214227213
** Argument zText contains the text of a LIKE or GLOB pattern matched
227215227214
** against column iCol. This function creates and compiles an FTS5 MATCH
@@ -227244,11 +227243,12 @@
227244227243
227245227244
while( i<=nText ){
227246227245
if( i==nText
227247227246
|| zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2]
227248227247
){
227249
- if( i-iFirst>=3 ){
227248
+
227249
+ if( fts5ExprCountChar(&zText[iFirst], i-iFirst)>=3 ){
227250227250
int jj;
227251227251
zExpr[iOut++] = '"';
227252227252
for(jj=iFirst; jj<i; jj++){
227253227253
zExpr[iOut++] = zText[jj];
227254227254
if( zText[jj]=='"' ) zExpr[iOut++] = '"';
@@ -235321,14 +235321,14 @@
235321235321
pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
235322235322
235323235323
if( pNew ){
235324235324
Fts5StructureLevel *pLvl;
235325235325
nByte = nSeg * sizeof(Fts5StructureSegment);
235326
- pNew->nLevel = pStruct->nLevel+1;
235326
+ pNew->nLevel = MIN(pStruct->nLevel+1, FTS5_MAX_LEVEL);
235327235327
pNew->nRef = 1;
235328235328
pNew->nWriteCounter = pStruct->nWriteCounter;
235329
- pLvl = &pNew->aLevel[MIN(pStruct->nLevel, FTS5_MAX_LEVEL-1)];
235329
+ pLvl = &pNew->aLevel[pNew->nLevel-1];
235330235330
pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
235331235331
if( pLvl->aSeg ){
235332235332
int iLvl, iSeg;
235333235333
int iSegOut = 0;
235334235334
/* Iterate through all segments, from oldest to newest. Add them to
@@ -240169,11 +240169,11 @@
240169240169
int nArg, /* Number of args */
240170240170
sqlite3_value **apUnused /* Function arguments */
240171240171
){
240172240172
assert( nArg==0 );
240173240173
UNUSED_PARAM2(nArg, apUnused);
240174
- sqlite3_result_text(pCtx, "fts5: 2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355", -1, SQLITE_TRANSIENT);
240174
+ sqlite3_result_text(pCtx, "fts5: 2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712", -1, SQLITE_TRANSIENT);
240175240175
}
240176240176
240177240177
/*
240178240178
** Return true if zName is the extension on one of the shadow tables used
240179240179
** by this module.
240180240180
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.41.0"
456 #define SQLITE_VERSION_NUMBER 3041000
457 #define SQLITE_SOURCE_ID "2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -14400,19 +14400,13 @@
14400 */
14401 #define SQLITE_MAX_U32 ((((u64)1)<<32)-1)
14402
14403 /*
14404 ** The datatype used to store estimates of the number of rows in a
14405 ** table or index. This is an unsigned integer type. For 99.9% of
14406 ** the world, a 32-bit integer is sufficient. But a 64-bit integer
14407 ** can be used at compile-time if desired.
14408 */
14409 #ifdef SQLITE_64BIT_STATS
14410 typedef u64 tRowcnt; /* 64-bit only if requested at compile-time */
14411 #else
14412 typedef u32 tRowcnt; /* 32-bit is the default */
14413 #endif
14414
14415 /*
14416 ** Estimated quantities used for query planning are stored as 16-bit
14417 ** logarithms. For quantity X, the value stored is 10*log2(X). This
14418 ** gives a possible range of values of approximately 1.0e986 to 1e-986.
@@ -17116,11 +17110,10 @@
17116 u8 mTrace; /* zero or more SQLITE_TRACE flags */
17117 u8 noSharedCache; /* True if no shared-cache backends */
17118 u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
17119 u8 eOpenState; /* Current condition of the connection */
17120 int nextPagesize; /* Pagesize after VACUUM if >0 */
17121 i64 txnTime; /* Timestamp for current transaction */
17122 i64 nChange; /* Value returned by sqlite3_changes() */
17123 i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
17124 int aLimit[SQLITE_N_LIMIT]; /* Limits */
17125 int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
17126 struct sqlite3InitInfo { /* Information used during initialization */
@@ -20836,11 +20829,11 @@
20836 SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
20837 #if (defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)) \
20838 && !defined(SQLITE_OMIT_VIRTUALTABLE)
20839 SQLITE_PRIVATE void sqlite3VtabUsesAllSchemas(sqlite3_index_info*);
20840 #endif
20841 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*, int);
20842 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
20843 SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
20844 SQLITE_PRIVATE void sqlite3ParseObjectInit(Parse*,sqlite3*);
20845 SQLITE_PRIVATE void sqlite3ParseObjectReset(Parse*);
20846 SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
@@ -23824,20 +23817,16 @@
23824 }
23825 return 0;
23826 }
23827
23828 /*
23829 ** Set the time to the current time reported for the prepared statement
23830 ** that is currently executing. The same time is reported for all
23831 ** invocations of this routine from within the same call to sqlite3_step().
23832 **
23833 ** Or if bTxn is true, use the transaction time.
23834 **
23835 ** Return the number of errors.
23836 */
23837 static int setCurrentStmtTime(sqlite3_context *context, DateTime *p, int bTxn){
23838 p->iJD = sqlite3StmtCurrentTime(context, bTxn);
23839 if( p->iJD>0 ){
23840 p->validJD = 1;
23841 return 0;
23842 }else{
23843 return 1;
@@ -23884,13 +23873,11 @@
23884 if( parseYyyyMmDd(zDate,p)==0 ){
23885 return 0;
23886 }else if( parseHhMmSs(zDate, p)==0 ){
23887 return 0;
23888 }else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
23889 return setCurrentStmtTime(context, p, 0);
23890 }else if( sqlite3StrICmp(zDate,"txn")==0 && sqlite3NotPureFunc(context) ){
23891 return setCurrentStmtTime(context, p, 1);
23892 }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
23893 setRawDateNumber(p, r);
23894 return 0;
23895 }
23896 return 1;
@@ -24248,11 +24235,11 @@
24248 else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
24249 if( p->tzSet==0 ){
24250 i64 iOrigJD; /* Original localtime */
24251 i64 iGuess; /* Guess at the corresponding utc time */
24252 int cnt = 0; /* Safety to prevent infinite loop */
24253 int iErr; /* Guess is off by this much */
24254
24255 computeJD(p);
24256 iGuess = iOrigJD = p->iJD;
24257 iErr = 0;
24258 do{
@@ -24430,15 +24417,12 @@
24430 ** Process time function arguments. argv[0] is a date-time stamp.
24431 ** argv[1] and following are modifiers. Parse them all and write
24432 ** the resulting time into the DateTime structure p. Return 0
24433 ** on success and 1 if there are any errors.
24434 **
24435 ** If there are zero parameters (if argc<=0) then assume a default
24436 ** value of "now" for argv[0] if argc==0 and "txn" if argc<0. SQL
24437 ** functions will always have argc>=0, but the special implementations
24438 ** of CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP set argc to -1
24439 ** in order to force the use of 'txn' semantics.
24440 */
24441 static int isDate(
24442 sqlite3_context *context,
24443 int argc,
24444 sqlite3_value **argv,
@@ -24446,13 +24430,13 @@
24446 ){
24447 int i, n;
24448 const unsigned char *z;
24449 int eType;
24450 memset(p, 0, sizeof(*p));
24451 if( argc<=0 ){
24452 if( !sqlite3NotPureFunc(context) ) return 1;
24453 return setCurrentStmtTime(context, p, argc<0);
24454 }
24455 if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
24456 || eType==SQLITE_INTEGER ){
24457 setRawDateNumber(p, sqlite3_value_double(argv[0]));
24458 }else{
@@ -24755,11 +24739,11 @@
24755 sqlite3_context *context,
24756 int NotUsed,
24757 sqlite3_value **NotUsed2
24758 ){
24759 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24760 timeFunc(context, -1, 0);
24761 }
24762
24763 /*
24764 ** current_date()
24765 **
@@ -24769,11 +24753,11 @@
24769 sqlite3_context *context,
24770 int NotUsed,
24771 sqlite3_value **NotUsed2
24772 ){
24773 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24774 dateFunc(context, -1, 0);
24775 }
24776
24777 /*
24778 ** current_timestamp()
24779 **
@@ -24783,11 +24767,11 @@
24783 sqlite3_context *context,
24784 int NotUsed,
24785 sqlite3_value **NotUsed2
24786 ){
24787 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24788 datetimeFunc(context, -1, 0);
24789 }
24790 #endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
24791
24792 #ifdef SQLITE_OMIT_DATETIME_FUNCS
24793 /*
@@ -24814,11 +24798,11 @@
24814 char zBuf[20];
24815
24816 UNUSED_PARAMETER(argc);
24817 UNUSED_PARAMETER(argv);
24818
24819 iT = sqlite3StmtCurrentTime(context, 1);
24820 if( iT<=0 ) return;
24821 t = iT/1000 - 10000*(sqlite3_int64)21086676;
24822 #if HAVE_GMTIME_R
24823 pTm = gmtime_r(&t, &sNow);
24824 #else
@@ -59055,11 +59039,10 @@
59055 ** the xSync primitive is called and is relevant to all platforms.
59056 **
59057 ** Numeric values associated with these states are OFF==1, NORMAL=2,
59058 ** and FULL=3.
59059 */
59060 #ifndef SQLITE_OMIT_PAGER_PRAGMAS
59061 SQLITE_PRIVATE void sqlite3PagerSetFlags(
59062 Pager *pPager, /* The pager to set safety level for */
59063 unsigned pgFlags /* Various flags */
59064 ){
59065 unsigned level = pgFlags & PAGER_SYNCHRONOUS_MASK;
@@ -59090,11 +59073,10 @@
59090 pPager->doNotSpill &= ~SPILLFLAG_OFF;
59091 }else{
59092 pPager->doNotSpill |= SPILLFLAG_OFF;
59093 }
59094 }
59095 #endif
59096
59097 /*
59098 ** The following global variable is incremented whenever the library
59099 ** attempts to open a temporary file. This information is used for
59100 ** testing and analysis only.
@@ -60494,22 +60476,11 @@
60494 pPager->exclusiveMode = (u8)tempFile;
60495 pPager->changeCountDone = pPager->tempFile;
60496 pPager->memDb = (u8)memDb;
60497 pPager->readOnly = (u8)readOnly;
60498 assert( useJournal || pPager->tempFile );
60499 pPager->noSync = pPager->tempFile;
60500 if( pPager->noSync ){
60501 assert( pPager->fullSync==0 );
60502 assert( pPager->extraSync==0 );
60503 assert( pPager->syncFlags==0 );
60504 assert( pPager->walSyncFlags==0 );
60505 }else{
60506 pPager->fullSync = 1;
60507 pPager->extraSync = 0;
60508 pPager->syncFlags = SQLITE_SYNC_NORMAL;
60509 pPager->walSyncFlags = SQLITE_SYNC_NORMAL | (SQLITE_SYNC_NORMAL<<2);
60510 }
60511 /* pPager->pFirst = 0; */
60512 /* pPager->pFirstSynced = 0; */
60513 /* pPager->pLast = 0; */
60514 pPager->nExtra = (u16)nExtra;
60515 pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
@@ -81926,15 +81897,15 @@
81926 rc = SQLITE_TOOBIG;
81927 pCtx->pParse->nErr++;
81928 }
81929 #endif
81930 }
81931 pCtx->pParse->rc = rc;
81932
81933 value_from_function_out:
81934 if( rc!=SQLITE_OK ){
81935 pVal = 0;
 
81936 }
81937 if( apVal ){
81938 for(i=0; i<nVal; i++){
81939 sqlite3ValueFree(apVal[i]);
81940 }
@@ -85785,11 +85756,10 @@
85785 ** by connection db have now been released. Call sqlite3ConnectionUnlocked()
85786 ** to invoke any required unlock-notify callbacks.
85787 */
85788 if( db->autoCommit ){
85789 sqlite3ConnectionUnlocked(db);
85790 db->txnTime = 0;
85791 }
85792
85793 assert( db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0 );
85794 return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK);
85795 }
@@ -88744,31 +88714,22 @@
88744 ** Return the current time for a statement. If the current time
88745 ** is requested more than once within the same run of a single prepared
88746 ** statement, the exact same time is returned for each invocation regardless
88747 ** of the amount of time that elapses between invocations. In other words,
88748 ** the time returned is always the time of the first call.
88749 **
88750 ** Or, if bTxn, return the transaction time. The transaction time is the
88751 ** same for all calls within the same transaction.
88752 **
88753 ** bTxn is 0 for SQL like datetime('now') and is 1 for datetime('txn').
88754 */
88755 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p, int bTxn){
88756 int rc;
88757 #ifndef SQLITE_ENABLE_STAT4
88758 sqlite3_int64 *piTime;
88759 sqlite3 *db = p->pOut->db;
88760 assert( p->pVdbe!=0 );
88761 piTime = bTxn ? &db->txnTime : &p->pVdbe->iCurrentTime;
88762 #else
88763 sqlite3_int64 iTime = 0;
88764 sqlite3_int64 *piTime;
88765 sqlite3 *db = p->pOut->db;
88766 piTime = bTxn ? &db->txnTime : p->pVdbe!=0 ? &p->pVdbe->iCurrentTime : &iTime;
88767 #endif
88768 if( *piTime==0 ){
88769 rc = sqlite3OsCurrentTimeInt64(db->pVfs, piTime);
88770 if( rc ) *piTime = 0;
88771 }
88772 return *piTime;
88773 }
88774
@@ -109856,14 +109817,17 @@
109856 case INLINEFUNC_affinity: {
109857 /* The AFFINITY() function evaluates to a string that describes
109858 ** the type affinity of the argument. This is used for testing of
109859 ** the SQLite type logic.
109860 */
109861 const char *azAff[] = { "blob", "text", "numeric", "integer", "real" };
 
109862 char aff;
109863 assert( nFarg==1 );
109864 aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
 
 
109865 sqlite3VdbeLoadString(v, target,
109866 (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]);
109867 break;
109868 }
109869 #endif /* !defined(SQLITE_UNTESTABLE) */
@@ -152720,72 +152684,79 @@
152720 int iEq, /* Look at loop terms starting here */
152721 WhereLoop *pLoop, /* The current loop */
152722 Expr *pX /* The IN expression to be reduced */
152723 ){
152724 sqlite3 *db = pParse->db;
 
152725 Expr *pNew;
152726 pNew = sqlite3ExprDup(db, pX, 0);
152727 if( db->mallocFailed==0 ){
152728 ExprList *pOrigRhs; /* Original unmodified RHS */
152729 ExprList *pOrigLhs; /* Original unmodified LHS */
152730 ExprList *pRhs = 0; /* New RHS after modifications */
152731 ExprList *pLhs = 0; /* New LHS after mods */
152732 int i; /* Loop counter */
152733 Select *pSelect; /* Pointer to the SELECT on the RHS */
152734
152735 assert( ExprUseXSelect(pNew) );
152736 pOrigRhs = pNew->x.pSelect->pEList;
152737 assert( pNew->pLeft!=0 );
152738 assert( ExprUseXList(pNew->pLeft) );
152739 pOrigLhs = pNew->pLeft->x.pList;
152740 for(i=iEq; i<pLoop->nLTerm; i++){
152741 if( pLoop->aLTerm[i]->pExpr==pX ){
152742 int iField;
152743 assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 );
152744 iField = pLoop->aLTerm[i]->u.x.iField - 1;
152745 if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */
152746 pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr);
152747 pOrigRhs->a[iField].pExpr = 0;
152748 assert( pOrigLhs->a[iField].pExpr!=0 );
152749 pLhs = sqlite3ExprListAppend(pParse, pLhs, pOrigLhs->a[iField].pExpr);
152750 pOrigLhs->a[iField].pExpr = 0;
152751 }
152752 }
152753 sqlite3ExprListDelete(db, pOrigRhs);
152754 sqlite3ExprListDelete(db, pOrigLhs);
152755 pNew->pLeft->x.pList = pLhs;
152756 pNew->x.pSelect->pEList = pRhs;
152757 if( pLhs && pLhs->nExpr==1 ){
152758 /* Take care here not to generate a TK_VECTOR containing only a
152759 ** single value. Since the parser never creates such a vector, some
152760 ** of the subroutines do not handle this case. */
152761 Expr *p = pLhs->a[0].pExpr;
152762 pLhs->a[0].pExpr = 0;
152763 sqlite3ExprDelete(db, pNew->pLeft);
152764 pNew->pLeft = p;
152765 }
152766 pSelect = pNew->x.pSelect;
152767 if( pSelect->pOrderBy ){
152768 /* If the SELECT statement has an ORDER BY clause, zero the
152769 ** iOrderByCol variables. These are set to non-zero when an
152770 ** ORDER BY term exactly matches one of the terms of the
152771 ** result-set. Since the result-set of the SELECT statement may
152772 ** have been modified or reordered, these variables are no longer
152773 ** set correctly. Since setting them is just an optimization,
152774 ** it's easiest just to zero them here. */
152775 ExprList *pOrderBy = pSelect->pOrderBy;
152776 for(i=0; i<pOrderBy->nExpr; i++){
152777 pOrderBy->a[i].u.x.iOrderByCol = 0;
152778 }
152779 }
 
 
 
 
 
152780
152781 #if 0
152782 printf("For indexing, change the IN expr:\n");
152783 sqlite3TreeViewExpr(0, pX, 0);
152784 printf("Into:\n");
152785 sqlite3TreeViewExpr(0, pNew, 0);
152786 #endif
 
152787 }
152788 return pNew;
152789 }
152790
152791
@@ -155993,60 +155964,70 @@
155993 ** true even if that particular column is not indexed, because the column
155994 ** might be added to an automatic index later.
155995 */
155996 static SQLITE_NOINLINE int exprMightBeIndexed2(
155997 SrcList *pFrom, /* The FROM clause */
155998 Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
155999 int *aiCurCol, /* Write the referenced table cursor and column here */
156000 Expr *pExpr /* An operand of a comparison operator */
 
156001 ){
156002 Index *pIdx;
156003 int i;
156004 int iCur;
156005 for(i=0; mPrereq>1; i++, mPrereq>>=1){}
156006 iCur = pFrom->a[i].iCursor;
156007 for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
156008 if( pIdx->aColExpr==0 ) continue;
156009 for(i=0; i<pIdx->nKeyCol; i++){
156010 if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
156011 assert( pIdx->bHasExpr );
156012 if( sqlite3ExprCompareSkip(pExpr, pIdx->aColExpr->a[i].pExpr, iCur)==0 ){
156013 aiCurCol[0] = iCur;
156014 aiCurCol[1] = XN_EXPR;
156015 return 1;
 
 
 
156016 }
156017 }
156018 }
156019 return 0;
156020 }
156021 static int exprMightBeIndexed(
156022 SrcList *pFrom, /* The FROM clause */
156023 Bitmask mPrereq, /* Bitmask of FROM clause terms referenced by pExpr */
156024 int *aiCurCol, /* Write the referenced table cursor & column here */
156025 Expr *pExpr, /* An operand of a comparison operator */
156026 int op /* The specific comparison operator */
156027 ){
 
 
156028 /* If this expression is a vector to the left or right of a
156029 ** inequality constraint (>, <, >= or <=), perform the processing
156030 ** on the first element of the vector. */
156031 assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE );
156032 assert( TK_IS<TK_GE && TK_ISNULL<TK_GE && TK_IN<TK_GE );
156033 assert( op<=TK_GE );
156034 if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){
156035 assert( ExprUseXList(pExpr) );
156036 pExpr = pExpr->x.pList->a[0].pExpr;
156037
156038 }
156039
156040 if( pExpr->op==TK_COLUMN ){
156041 aiCurCol[0] = pExpr->iTable;
156042 aiCurCol[1] = pExpr->iColumn;
156043 return 1;
156044 }
156045 if( mPrereq==0 ) return 0; /* No table references */
156046 if( (mPrereq&(mPrereq-1))!=0 ) return 0; /* Refs more than one table */
156047 return exprMightBeIndexed2(pFrom,mPrereq,aiCurCol,pExpr);
 
 
 
 
 
 
 
156048 }
156049
156050
156051 /*
156052 ** The input to this routine is an WhereTerm structure with only the
@@ -156168,19 +156149,19 @@
156168 assert( pLeft->op==TK_VECTOR );
156169 assert( ExprUseXList(pLeft) );
156170 pLeft = pLeft->x.pList->a[pTerm->u.x.iField-1].pExpr;
156171 }
156172
156173 if( exprMightBeIndexed(pSrc, prereqLeft, aiCurCol, pLeft, op) ){
156174 pTerm->leftCursor = aiCurCol[0];
156175 assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 );
156176 pTerm->u.x.leftColumn = aiCurCol[1];
156177 pTerm->eOperator = operatorMask(op) & opMask;
156178 }
156179 if( op==TK_IS ) pTerm->wtFlags |= TERM_IS;
156180 if( pRight
156181 && exprMightBeIndexed(pSrc, pTerm->prereqRight, aiCurCol, pRight, op)
156182 && !ExprHasProperty(pRight, EP_FixedCol)
156183 ){
156184 WhereTerm *pNew;
156185 Expr *pDup;
156186 u16 eExtraOp = 0; /* Extra bits for pNew->eOperator */
@@ -156387,18 +156368,18 @@
156387 sqlite3ExprAddCollateString(pParse,pNewExpr1,zCollSeqName),
156388 pStr1);
156389 transferJoinMarkings(pNewExpr1, pExpr);
156390 idxNew1 = whereClauseInsert(pWC, pNewExpr1, wtFlags);
156391 testcase( idxNew1==0 );
156392 exprAnalyze(pSrc, pWC, idxNew1);
156393 pNewExpr2 = sqlite3ExprDup(db, pLeft, 0);
156394 pNewExpr2 = sqlite3PExpr(pParse, TK_LT,
156395 sqlite3ExprAddCollateString(pParse,pNewExpr2,zCollSeqName),
156396 pStr2);
156397 transferJoinMarkings(pNewExpr2, pExpr);
156398 idxNew2 = whereClauseInsert(pWC, pNewExpr2, wtFlags);
156399 testcase( idxNew2==0 );
 
156400 exprAnalyze(pSrc, pWC, idxNew2);
156401 pTerm = &pWC->a[idxTerm];
156402 if( isComplete ){
156403 markTermAsChild(pWC, idxNew1, idxTerm);
156404 markTermAsChild(pWC, idxNew2, idxTerm);
@@ -156451,11 +156432,11 @@
156451 */
156452 else if( pExpr->op==TK_IN
156453 && pTerm->u.x.iField==0
156454 && pExpr->pLeft->op==TK_VECTOR
156455 && ALWAYS( ExprUseXSelect(pExpr) )
156456 && pExpr->x.pSelect->pPrior==0
156457 #ifndef SQLITE_OMIT_WINDOWFUNC
156458 && pExpr->x.pSelect->pWin==0
156459 #endif
156460 && pWC->op==TK_AND
156461 ){
@@ -171278,10 +171259,15 @@
171278 if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){
171279 yymsp[-1].minor.yy322->a[0].pExpr = 0;
171280 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171281 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
171282 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy528, pRHS);
 
 
 
 
 
171283 }else{
171284 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
171285 if( yymsp[-4].minor.yy528==0 ){
171286 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171287 }else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
@@ -227206,10 +227192,23 @@
227206
227207 sqlite3_free(sParse.apPhrase);
227208 *pzErr = sParse.zErr;
227209 return sParse.rc;
227210 }
 
 
 
 
 
 
 
 
 
 
 
 
 
227211
227212 /*
227213 ** This function is only called when using the special 'trigram' tokenizer.
227214 ** Argument zText contains the text of a LIKE or GLOB pattern matched
227215 ** against column iCol. This function creates and compiles an FTS5 MATCH
@@ -227244,11 +227243,12 @@
227244
227245 while( i<=nText ){
227246 if( i==nText
227247 || zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2]
227248 ){
227249 if( i-iFirst>=3 ){
 
227250 int jj;
227251 zExpr[iOut++] = '"';
227252 for(jj=iFirst; jj<i; jj++){
227253 zExpr[iOut++] = zText[jj];
227254 if( zText[jj]=='"' ) zExpr[iOut++] = '"';
@@ -235321,14 +235321,14 @@
235321 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
235322
235323 if( pNew ){
235324 Fts5StructureLevel *pLvl;
235325 nByte = nSeg * sizeof(Fts5StructureSegment);
235326 pNew->nLevel = pStruct->nLevel+1;
235327 pNew->nRef = 1;
235328 pNew->nWriteCounter = pStruct->nWriteCounter;
235329 pLvl = &pNew->aLevel[MIN(pStruct->nLevel, FTS5_MAX_LEVEL-1)];
235330 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
235331 if( pLvl->aSeg ){
235332 int iLvl, iSeg;
235333 int iSegOut = 0;
235334 /* Iterate through all segments, from oldest to newest. Add them to
@@ -240169,11 +240169,11 @@
240169 int nArg, /* Number of args */
240170 sqlite3_value **apUnused /* Function arguments */
240171 ){
240172 assert( nArg==0 );
240173 UNUSED_PARAM2(nArg, apUnused);
240174 sqlite3_result_text(pCtx, "fts5: 2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355", -1, SQLITE_TRANSIENT);
240175 }
240176
240177 /*
240178 ** Return true if zName is the extension on one of the shadow tables used
240179 ** by this module.
240180
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.41.0"
456 #define SQLITE_VERSION_NUMBER 3041000
457 #define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -14400,19 +14400,13 @@
14400 */
14401 #define SQLITE_MAX_U32 ((((u64)1)<<32)-1)
14402
14403 /*
14404 ** The datatype used to store estimates of the number of rows in a
14405 ** table or index.
 
 
14406 */
14407 typedef u64 tRowcnt;
 
 
 
 
14408
14409 /*
14410 ** Estimated quantities used for query planning are stored as 16-bit
14411 ** logarithms. For quantity X, the value stored is 10*log2(X). This
14412 ** gives a possible range of values of approximately 1.0e986 to 1e-986.
@@ -17116,11 +17110,10 @@
17110 u8 mTrace; /* zero or more SQLITE_TRACE flags */
17111 u8 noSharedCache; /* True if no shared-cache backends */
17112 u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
17113 u8 eOpenState; /* Current condition of the connection */
17114 int nextPagesize; /* Pagesize after VACUUM if >0 */
 
17115 i64 nChange; /* Value returned by sqlite3_changes() */
17116 i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
17117 int aLimit[SQLITE_N_LIMIT]; /* Limits */
17118 int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
17119 struct sqlite3InitInfo { /* Information used during initialization */
@@ -20836,11 +20829,11 @@
20829 SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
20830 #if (defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)) \
20831 && !defined(SQLITE_OMIT_VIRTUALTABLE)
20832 SQLITE_PRIVATE void sqlite3VtabUsesAllSchemas(sqlite3_index_info*);
20833 #endif
20834 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
20835 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
20836 SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
20837 SQLITE_PRIVATE void sqlite3ParseObjectInit(Parse*,sqlite3*);
20838 SQLITE_PRIVATE void sqlite3ParseObjectReset(Parse*);
20839 SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
@@ -23824,20 +23817,16 @@
23817 }
23818 return 0;
23819 }
23820
23821 /*
23822 ** Set the time to the current time reported by the VFS.
 
 
 
 
23823 **
23824 ** Return the number of errors.
23825 */
23826 static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
23827 p->iJD = sqlite3StmtCurrentTime(context);
23828 if( p->iJD>0 ){
23829 p->validJD = 1;
23830 return 0;
23831 }else{
23832 return 1;
@@ -23884,13 +23873,11 @@
23873 if( parseYyyyMmDd(zDate,p)==0 ){
23874 return 0;
23875 }else if( parseHhMmSs(zDate, p)==0 ){
23876 return 0;
23877 }else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
23878 return setDateTimeToCurrent(context, p);
 
 
23879 }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
23880 setRawDateNumber(p, r);
23881 return 0;
23882 }
23883 return 1;
@@ -24248,11 +24235,11 @@
24235 else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
24236 if( p->tzSet==0 ){
24237 i64 iOrigJD; /* Original localtime */
24238 i64 iGuess; /* Guess at the corresponding utc time */
24239 int cnt = 0; /* Safety to prevent infinite loop */
24240 i64 iErr; /* Guess is off by this much */
24241
24242 computeJD(p);
24243 iGuess = iOrigJD = p->iJD;
24244 iErr = 0;
24245 do{
@@ -24430,15 +24417,12 @@
24417 ** Process time function arguments. argv[0] is a date-time stamp.
24418 ** argv[1] and following are modifiers. Parse them all and write
24419 ** the resulting time into the DateTime structure p. Return 0
24420 ** on success and 1 if there are any errors.
24421 **
24422 ** If there are zero parameters (if even argv[0] is undefined)
24423 ** then assume a default value of "now" for argv[0].
 
 
 
24424 */
24425 static int isDate(
24426 sqlite3_context *context,
24427 int argc,
24428 sqlite3_value **argv,
@@ -24446,13 +24430,13 @@
24430 ){
24431 int i, n;
24432 const unsigned char *z;
24433 int eType;
24434 memset(p, 0, sizeof(*p));
24435 if( argc==0 ){
24436 if( !sqlite3NotPureFunc(context) ) return 1;
24437 return setDateTimeToCurrent(context, p);
24438 }
24439 if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
24440 || eType==SQLITE_INTEGER ){
24441 setRawDateNumber(p, sqlite3_value_double(argv[0]));
24442 }else{
@@ -24755,11 +24739,11 @@
24739 sqlite3_context *context,
24740 int NotUsed,
24741 sqlite3_value **NotUsed2
24742 ){
24743 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24744 timeFunc(context, 0, 0);
24745 }
24746
24747 /*
24748 ** current_date()
24749 **
@@ -24769,11 +24753,11 @@
24753 sqlite3_context *context,
24754 int NotUsed,
24755 sqlite3_value **NotUsed2
24756 ){
24757 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24758 dateFunc(context, 0, 0);
24759 }
24760
24761 /*
24762 ** current_timestamp()
24763 **
@@ -24783,11 +24767,11 @@
24767 sqlite3_context *context,
24768 int NotUsed,
24769 sqlite3_value **NotUsed2
24770 ){
24771 UNUSED_PARAMETER2(NotUsed, NotUsed2);
24772 datetimeFunc(context, 0, 0);
24773 }
24774 #endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
24775
24776 #ifdef SQLITE_OMIT_DATETIME_FUNCS
24777 /*
@@ -24814,11 +24798,11 @@
24798 char zBuf[20];
24799
24800 UNUSED_PARAMETER(argc);
24801 UNUSED_PARAMETER(argv);
24802
24803 iT = sqlite3StmtCurrentTime(context);
24804 if( iT<=0 ) return;
24805 t = iT/1000 - 10000*(sqlite3_int64)21086676;
24806 #if HAVE_GMTIME_R
24807 pTm = gmtime_r(&t, &sNow);
24808 #else
@@ -59055,11 +59039,10 @@
59039 ** the xSync primitive is called and is relevant to all platforms.
59040 **
59041 ** Numeric values associated with these states are OFF==1, NORMAL=2,
59042 ** and FULL=3.
59043 */
 
59044 SQLITE_PRIVATE void sqlite3PagerSetFlags(
59045 Pager *pPager, /* The pager to set safety level for */
59046 unsigned pgFlags /* Various flags */
59047 ){
59048 unsigned level = pgFlags & PAGER_SYNCHRONOUS_MASK;
@@ -59090,11 +59073,10 @@
59073 pPager->doNotSpill &= ~SPILLFLAG_OFF;
59074 }else{
59075 pPager->doNotSpill |= SPILLFLAG_OFF;
59076 }
59077 }
 
59078
59079 /*
59080 ** The following global variable is incremented whenever the library
59081 ** attempts to open a temporary file. This information is used for
59082 ** testing and analysis only.
@@ -60494,22 +60476,11 @@
60476 pPager->exclusiveMode = (u8)tempFile;
60477 pPager->changeCountDone = pPager->tempFile;
60478 pPager->memDb = (u8)memDb;
60479 pPager->readOnly = (u8)readOnly;
60480 assert( useJournal || pPager->tempFile );
60481 sqlite3PagerSetFlags(pPager, (SQLITE_DEFAULT_SYNCHRONOUS+1)|PAGER_CACHESPILL);
 
 
 
 
 
 
 
 
 
 
 
60482 /* pPager->pFirst = 0; */
60483 /* pPager->pFirstSynced = 0; */
60484 /* pPager->pLast = 0; */
60485 pPager->nExtra = (u16)nExtra;
60486 pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
@@ -81926,15 +81897,15 @@
81897 rc = SQLITE_TOOBIG;
81898 pCtx->pParse->nErr++;
81899 }
81900 #endif
81901 }
 
81902
81903 value_from_function_out:
81904 if( rc!=SQLITE_OK ){
81905 pVal = 0;
81906 pCtx->pParse->rc = rc;
81907 }
81908 if( apVal ){
81909 for(i=0; i<nVal; i++){
81910 sqlite3ValueFree(apVal[i]);
81911 }
@@ -85785,11 +85756,10 @@
85756 ** by connection db have now been released. Call sqlite3ConnectionUnlocked()
85757 ** to invoke any required unlock-notify callbacks.
85758 */
85759 if( db->autoCommit ){
85760 sqlite3ConnectionUnlocked(db);
 
85761 }
85762
85763 assert( db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0 );
85764 return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK);
85765 }
@@ -88744,31 +88714,22 @@
88714 ** Return the current time for a statement. If the current time
88715 ** is requested more than once within the same run of a single prepared
88716 ** statement, the exact same time is returned for each invocation regardless
88717 ** of the amount of time that elapses between invocations. In other words,
88718 ** the time returned is always the time of the first call.
 
 
 
 
 
88719 */
88720 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
88721 int rc;
88722 #ifndef SQLITE_ENABLE_STAT4
88723 sqlite3_int64 *piTime = &p->pVdbe->iCurrentTime;
 
88724 assert( p->pVdbe!=0 );
 
88725 #else
88726 sqlite3_int64 iTime = 0;
88727 sqlite3_int64 *piTime = p->pVdbe!=0 ? &p->pVdbe->iCurrentTime : &iTime;
 
 
88728 #endif
88729 if( *piTime==0 ){
88730 rc = sqlite3OsCurrentTimeInt64(p->pOut->db->pVfs, piTime);
88731 if( rc ) *piTime = 0;
88732 }
88733 return *piTime;
88734 }
88735
@@ -109856,14 +109817,17 @@
109817 case INLINEFUNC_affinity: {
109818 /* The AFFINITY() function evaluates to a string that describes
109819 ** the type affinity of the argument. This is used for testing of
109820 ** the SQLite type logic.
109821 */
109822 const char *azAff[] = { "blob", "text", "numeric", "integer",
109823 "real", "flexnum" };
109824 char aff;
109825 assert( nFarg==1 );
109826 aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
109827 assert( aff<=SQLITE_AFF_NONE
109828 || (aff>=SQLITE_AFF_BLOB && aff<=SQLITE_AFF_FLEXNUM) );
109829 sqlite3VdbeLoadString(v, target,
109830 (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]);
109831 break;
109832 }
109833 #endif /* !defined(SQLITE_UNTESTABLE) */
@@ -152720,72 +152684,79 @@
152684 int iEq, /* Look at loop terms starting here */
152685 WhereLoop *pLoop, /* The current loop */
152686 Expr *pX /* The IN expression to be reduced */
152687 ){
152688 sqlite3 *db = pParse->db;
152689 Select *pSelect; /* Pointer to the SELECT on the RHS */
152690 Expr *pNew;
152691 pNew = sqlite3ExprDup(db, pX, 0);
152692 if( db->mallocFailed==0 ){
152693 for(pSelect=pNew->x.pSelect; pSelect; pSelect=pSelect->pPrior){
152694 ExprList *pOrigRhs; /* Original unmodified RHS */
152695 ExprList *pOrigLhs = 0; /* Original unmodified LHS */
152696 ExprList *pRhs = 0; /* New RHS after modifications */
152697 ExprList *pLhs = 0; /* New LHS after mods */
152698 int i; /* Loop counter */
152699
152700 assert( ExprUseXSelect(pNew) );
152701 pOrigRhs = pSelect->pEList;
152702 assert( pNew->pLeft!=0 );
152703 assert( ExprUseXList(pNew->pLeft) );
152704 if( pSelect==pNew->x.pSelect ){
152705 pOrigLhs = pNew->pLeft->x.pList;
152706 }
152707 for(i=iEq; i<pLoop->nLTerm; i++){
152708 if( pLoop->aLTerm[i]->pExpr==pX ){
152709 int iField;
152710 assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 );
152711 iField = pLoop->aLTerm[i]->u.x.iField - 1;
152712 if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */
152713 pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr);
152714 pOrigRhs->a[iField].pExpr = 0;
152715 if( pOrigLhs ){
152716 assert( pOrigLhs->a[iField].pExpr!=0 );
152717 pLhs = sqlite3ExprListAppend(pParse,pLhs,pOrigLhs->a[iField].pExpr);
152718 pOrigLhs->a[iField].pExpr = 0;
152719 }
152720 }
152721 }
152722 sqlite3ExprListDelete(db, pOrigRhs);
152723 if( pOrigLhs ){
152724 sqlite3ExprListDelete(db, pOrigLhs);
152725 pNew->pLeft->x.pList = pLhs;
152726 }
152727 pSelect->pEList = pRhs;
152728 if( pLhs && pLhs->nExpr==1 ){
152729 /* Take care here not to generate a TK_VECTOR containing only a
152730 ** single value. Since the parser never creates such a vector, some
152731 ** of the subroutines do not handle this case. */
152732 Expr *p = pLhs->a[0].pExpr;
152733 pLhs->a[0].pExpr = 0;
152734 sqlite3ExprDelete(db, pNew->pLeft);
152735 pNew->pLeft = p;
152736 }
152737 if( pSelect->pOrderBy ){
152738 /* If the SELECT statement has an ORDER BY clause, zero the
152739 ** iOrderByCol variables. These are set to non-zero when an
152740 ** ORDER BY term exactly matches one of the terms of the
152741 ** result-set. Since the result-set of the SELECT statement may
152742 ** have been modified or reordered, these variables are no longer
152743 ** set correctly. Since setting them is just an optimization,
152744 ** it's easiest just to zero them here. */
152745 ExprList *pOrderBy = pSelect->pOrderBy;
152746 for(i=0; i<pOrderBy->nExpr; i++){
152747 pOrderBy->a[i].u.x.iOrderByCol = 0;
152748 }
152749 }
152750
152751 #if 0
152752 printf("For indexing, change the IN expr:\n");
152753 sqlite3TreeViewExpr(0, pX, 0);
152754 printf("Into:\n");
152755 sqlite3TreeViewExpr(0, pNew, 0);
152756 #endif
152757 }
152758 }
152759 return pNew;
152760 }
152761
152762
@@ -155993,60 +155964,70 @@
155964 ** true even if that particular column is not indexed, because the column
155965 ** might be added to an automatic index later.
155966 */
155967 static SQLITE_NOINLINE int exprMightBeIndexed2(
155968 SrcList *pFrom, /* The FROM clause */
 
155969 int *aiCurCol, /* Write the referenced table cursor and column here */
155970 Expr *pExpr, /* An operand of a comparison operator */
155971 int j /* Start looking with the j-th pFrom entry */
155972 ){
155973 Index *pIdx;
155974 int i;
155975 int iCur;
155976 do{
155977 iCur = pFrom->a[j].iCursor;
155978 for(pIdx=pFrom->a[j].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
155979 if( pIdx->aColExpr==0 ) continue;
155980 for(i=0; i<pIdx->nKeyCol; i++){
155981 if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
155982 assert( pIdx->bHasExpr );
155983 if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
155984 && pExpr->op!=TK_STRING
155985 ){
155986 aiCurCol[0] = iCur;
155987 aiCurCol[1] = XN_EXPR;
155988 return 1;
155989 }
155990 }
155991 }
155992 }while( ++j < pFrom->nSrc );
155993 return 0;
155994 }
155995 static int exprMightBeIndexed(
155996 SrcList *pFrom, /* The FROM clause */
 
155997 int *aiCurCol, /* Write the referenced table cursor & column here */
155998 Expr *pExpr, /* An operand of a comparison operator */
155999 int op /* The specific comparison operator */
156000 ){
156001 int i;
156002
156003 /* If this expression is a vector to the left or right of a
156004 ** inequality constraint (>, <, >= or <=), perform the processing
156005 ** on the first element of the vector. */
156006 assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE );
156007 assert( TK_IS<TK_GE && TK_ISNULL<TK_GE && TK_IN<TK_GE );
156008 assert( op<=TK_GE );
156009 if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){
156010 assert( ExprUseXList(pExpr) );
156011 pExpr = pExpr->x.pList->a[0].pExpr;
 
156012 }
156013
156014 if( pExpr->op==TK_COLUMN ){
156015 aiCurCol[0] = pExpr->iTable;
156016 aiCurCol[1] = pExpr->iColumn;
156017 return 1;
156018 }
156019
156020 for(i=0; i<pFrom->nSrc; i++){
156021 Index *pIdx;
156022 for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
156023 if( pIdx->aColExpr ){
156024 return exprMightBeIndexed2(pFrom,aiCurCol,pExpr,i);
156025 }
156026 }
156027 }
156028 return 0;
156029 }
156030
156031
156032 /*
156033 ** The input to this routine is an WhereTerm structure with only the
@@ -156168,19 +156149,19 @@
156149 assert( pLeft->op==TK_VECTOR );
156150 assert( ExprUseXList(pLeft) );
156151 pLeft = pLeft->x.pList->a[pTerm->u.x.iField-1].pExpr;
156152 }
156153
156154 if( exprMightBeIndexed(pSrc, aiCurCol, pLeft, op) ){
156155 pTerm->leftCursor = aiCurCol[0];
156156 assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 );
156157 pTerm->u.x.leftColumn = aiCurCol[1];
156158 pTerm->eOperator = operatorMask(op) & opMask;
156159 }
156160 if( op==TK_IS ) pTerm->wtFlags |= TERM_IS;
156161 if( pRight
156162 && exprMightBeIndexed(pSrc, aiCurCol, pRight, op)
156163 && !ExprHasProperty(pRight, EP_FixedCol)
156164 ){
156165 WhereTerm *pNew;
156166 Expr *pDup;
156167 u16 eExtraOp = 0; /* Extra bits for pNew->eOperator */
@@ -156387,18 +156368,18 @@
156368 sqlite3ExprAddCollateString(pParse,pNewExpr1,zCollSeqName),
156369 pStr1);
156370 transferJoinMarkings(pNewExpr1, pExpr);
156371 idxNew1 = whereClauseInsert(pWC, pNewExpr1, wtFlags);
156372 testcase( idxNew1==0 );
 
156373 pNewExpr2 = sqlite3ExprDup(db, pLeft, 0);
156374 pNewExpr2 = sqlite3PExpr(pParse, TK_LT,
156375 sqlite3ExprAddCollateString(pParse,pNewExpr2,zCollSeqName),
156376 pStr2);
156377 transferJoinMarkings(pNewExpr2, pExpr);
156378 idxNew2 = whereClauseInsert(pWC, pNewExpr2, wtFlags);
156379 testcase( idxNew2==0 );
156380 exprAnalyze(pSrc, pWC, idxNew1);
156381 exprAnalyze(pSrc, pWC, idxNew2);
156382 pTerm = &pWC->a[idxTerm];
156383 if( isComplete ){
156384 markTermAsChild(pWC, idxNew1, idxTerm);
156385 markTermAsChild(pWC, idxNew2, idxTerm);
@@ -156451,11 +156432,11 @@
156432 */
156433 else if( pExpr->op==TK_IN
156434 && pTerm->u.x.iField==0
156435 && pExpr->pLeft->op==TK_VECTOR
156436 && ALWAYS( ExprUseXSelect(pExpr) )
156437 && (pExpr->x.pSelect->pPrior==0 || (pExpr->x.pSelect->selFlags & SF_Values))
156438 #ifndef SQLITE_OMIT_WINDOWFUNC
156439 && pExpr->x.pSelect->pWin==0
156440 #endif
156441 && pWC->op==TK_AND
156442 ){
@@ -171278,10 +171259,15 @@
171259 if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){
171260 yymsp[-1].minor.yy322->a[0].pExpr = 0;
171261 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171262 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
171263 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy528, pRHS);
171264 }else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
171265 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
171266 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pRHS->x.pSelect);
171267 pRHS->x.pSelect = 0;
171268 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171269 }else{
171270 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
171271 if( yymsp[-4].minor.yy528==0 ){
171272 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
171273 }else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
@@ -227206,10 +227192,23 @@
227192
227193 sqlite3_free(sParse.apPhrase);
227194 *pzErr = sParse.zErr;
227195 return sParse.rc;
227196 }
227197
227198 /*
227199 ** Assuming that buffer z is at least nByte bytes in size and contains a
227200 ** valid utf-8 string, return the number of characters in the string.
227201 */
227202 static int fts5ExprCountChar(const char *z, int nByte){
227203 int nRet = 0;
227204 int ii;
227205 for(ii=0; ii<nByte; ii++){
227206 if( (z[ii] & 0xC0)!=0x80 ) nRet++;
227207 }
227208 return nRet;
227209 }
227210
227211 /*
227212 ** This function is only called when using the special 'trigram' tokenizer.
227213 ** Argument zText contains the text of a LIKE or GLOB pattern matched
227214 ** against column iCol. This function creates and compiles an FTS5 MATCH
@@ -227244,11 +227243,12 @@
227243
227244 while( i<=nText ){
227245 if( i==nText
227246 || zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2]
227247 ){
227248
227249 if( fts5ExprCountChar(&zText[iFirst], i-iFirst)>=3 ){
227250 int jj;
227251 zExpr[iOut++] = '"';
227252 for(jj=iFirst; jj<i; jj++){
227253 zExpr[iOut++] = zText[jj];
227254 if( zText[jj]=='"' ) zExpr[iOut++] = '"';
@@ -235321,14 +235321,14 @@
235321 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
235322
235323 if( pNew ){
235324 Fts5StructureLevel *pLvl;
235325 nByte = nSeg * sizeof(Fts5StructureSegment);
235326 pNew->nLevel = MIN(pStruct->nLevel+1, FTS5_MAX_LEVEL);
235327 pNew->nRef = 1;
235328 pNew->nWriteCounter = pStruct->nWriteCounter;
235329 pLvl = &pNew->aLevel[pNew->nLevel-1];
235330 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
235331 if( pLvl->aSeg ){
235332 int iLvl, iSeg;
235333 int iSegOut = 0;
235334 /* Iterate through all segments, from oldest to newest. Add them to
@@ -240169,11 +240169,11 @@
240169 int nArg, /* Number of args */
240170 sqlite3_value **apUnused /* Function arguments */
240171 ){
240172 assert( nArg==0 );
240173 UNUSED_PARAM2(nArg, apUnused);
240174 sqlite3_result_text(pCtx, "fts5: 2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712", -1, SQLITE_TRANSIENT);
240175 }
240176
240177 /*
240178 ** Return true if zName is the extension on one of the shadow tables used
240179 ** by this module.
240180
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.41.0"
150150
#define SQLITE_VERSION_NUMBER 3041000
151
-#define SQLITE_SOURCE_ID "2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355"
151
+#define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.41.0"
150 #define SQLITE_VERSION_NUMBER 3041000
151 #define SQLITE_SOURCE_ID "2023-02-08 14:49:52 6b41ba2e996ab7b9c3943ab93a19748db5cf37792f5d59d20eec301085282355"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.41.0"
150 #define SQLITE_VERSION_NUMBER 3041000
151 #define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

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