Fossil SCM

Update the built-in SQLite to the second 3.33.0 beta, as part of beta testing.

drh 2020-08-10 20:04 trunk
Commit 9120ff5faa21fadc015d2fb4b4183f7ac9144e9fa5efbaf25ec00d7e263ef7bb
3 files changed +5 -5 +87 -52 +1 -1
+5 -5
--- src/shell.c
+++ src/shell.c
@@ -12465,30 +12465,30 @@
1246512465
1246612466
/*
1246712467
** Disable and restore .wheretrace and .selecttrace settings.
1246812468
*/
1246912469
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12470
-extern int sqlite3SelectTrace;
12470
+extern unsigned int sqlite3_unsupported_selecttrace;
1247112471
static int savedSelectTrace;
1247212472
#endif
1247312473
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
1247412474
extern int sqlite3WhereTrace;
1247512475
static int savedWhereTrace;
1247612476
#endif
1247712477
static void disable_debug_trace_modes(void){
1247812478
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12479
- savedSelectTrace = sqlite3SelectTrace;
12480
- sqlite3SelectTrace = 0;
12479
+ savedSelectTrace = sqlite3_unsupported_selecttrace;
12480
+ sqlite3_unsupported_selecttrace = 0;
1248112481
#endif
1248212482
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
1248312483
savedWhereTrace = sqlite3WhereTrace;
1248412484
sqlite3WhereTrace = 0;
1248512485
#endif
1248612486
}
1248712487
static void restore_debug_trace_modes(void){
1248812488
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12489
- sqlite3SelectTrace = savedSelectTrace;
12489
+ sqlite3_unsupported_selecttrace = savedSelectTrace;
1249012490
#endif
1249112491
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
1249212492
sqlite3WhereTrace = savedWhereTrace;
1249312493
#endif
1249412494
}
@@ -18754,11 +18754,11 @@
1875418754
}
1875518755
}else
1875618756
1875718757
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
1875818758
if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
18759
- sqlite3SelectTrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
18759
+ sqlite3_unsupported_selecttrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
1876018760
}else
1876118761
#endif
1876218762
1876318763
#if defined(SQLITE_ENABLE_SESSION)
1876418764
if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
1876518765
--- src/shell.c
+++ src/shell.c
@@ -12465,30 +12465,30 @@
12465
12466 /*
12467 ** Disable and restore .wheretrace and .selecttrace settings.
12468 */
12469 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12470 extern int sqlite3SelectTrace;
12471 static int savedSelectTrace;
12472 #endif
12473 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12474 extern int sqlite3WhereTrace;
12475 static int savedWhereTrace;
12476 #endif
12477 static void disable_debug_trace_modes(void){
12478 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12479 savedSelectTrace = sqlite3SelectTrace;
12480 sqlite3SelectTrace = 0;
12481 #endif
12482 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12483 savedWhereTrace = sqlite3WhereTrace;
12484 sqlite3WhereTrace = 0;
12485 #endif
12486 }
12487 static void restore_debug_trace_modes(void){
12488 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12489 sqlite3SelectTrace = savedSelectTrace;
12490 #endif
12491 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12492 sqlite3WhereTrace = savedWhereTrace;
12493 #endif
12494 }
@@ -18754,11 +18754,11 @@
18754 }
18755 }else
18756
18757 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
18758 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
18759 sqlite3SelectTrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
18760 }else
18761 #endif
18762
18763 #if defined(SQLITE_ENABLE_SESSION)
18764 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
18765
--- src/shell.c
+++ src/shell.c
@@ -12465,30 +12465,30 @@
12465
12466 /*
12467 ** Disable and restore .wheretrace and .selecttrace settings.
12468 */
12469 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12470 extern unsigned int sqlite3_unsupported_selecttrace;
12471 static int savedSelectTrace;
12472 #endif
12473 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12474 extern int sqlite3WhereTrace;
12475 static int savedWhereTrace;
12476 #endif
12477 static void disable_debug_trace_modes(void){
12478 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12479 savedSelectTrace = sqlite3_unsupported_selecttrace;
12480 sqlite3_unsupported_selecttrace = 0;
12481 #endif
12482 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12483 savedWhereTrace = sqlite3WhereTrace;
12484 sqlite3WhereTrace = 0;
12485 #endif
12486 }
12487 static void restore_debug_trace_modes(void){
12488 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12489 sqlite3_unsupported_selecttrace = savedSelectTrace;
12490 #endif
12491 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12492 sqlite3WhereTrace = savedWhereTrace;
12493 #endif
12494 }
@@ -18754,11 +18754,11 @@
18754 }
18755 }else
18756
18757 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
18758 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
18759 sqlite3_unsupported_selecttrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
18760 }else
18761 #endif
18762
18763 #if defined(SQLITE_ENABLE_SESSION)
18764 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
18765
+87 -52
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -997,10 +997,19 @@
997997
998998
#if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
999999
# define _BSD_SOURCE
10001000
#endif
10011001
1002
+/*
1003
+** Macro to disable warnings about missing "break" at the end of a "case".
1004
+*/
1005
+#if GCC_VERSION>=7000000
1006
+# define deliberate_fall_through __attribute__((fallthrough));
1007
+#else
1008
+# define deliberate_fall_through
1009
+#endif
1010
+
10021011
/*
10031012
** For MinGW, check to see if we can include the header file containing its
10041013
** version information, among other things. Normally, this internal MinGW
10051014
** header file would [only] be included automatically by other MinGW header
10061015
** files; however, the contained version information is now required by this
@@ -1162,11 +1171,11 @@
11621171
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631172
** [sqlite_version()] and [sqlite_source_id()].
11641173
*/
11651174
#define SQLITE_VERSION "3.33.0"
11661175
#define SQLITE_VERSION_NUMBER 3033000
1167
-#define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635241d"
1176
+#define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f"
11681177
11691178
/*
11701179
** CAPI3REF: Run-Time Library Version Numbers
11711180
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721181
**
@@ -14532,11 +14541,11 @@
1453214541
# define SELECTTRACE_ENABLED 0
1453314542
#endif
1453414543
#if defined(SQLITE_ENABLE_SELECTTRACE)
1453514544
# define SELECTTRACE_ENABLED 1
1453614545
# define SELECTTRACE(K,P,S,X) \
14537
- if(sqlite3SelectTrace&(K)) \
14546
+ if(sqlite3_unsupported_selecttrace&(K)) \
1453814547
sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
1453914548
sqlite3DebugPrintf X
1454014549
#else
1454114550
# define SELECTTRACE(K,P,S,X)
1454214551
# define SELECTTRACE_ENABLED 0
@@ -14595,11 +14604,11 @@
1459514604
** one parameter that destructors normally want. So we have to introduce
1459614605
** this magic value that the code knows to handle differently. Any
1459714606
** pointer will work here as long as it is distinct from SQLITE_STATIC
1459814607
** and SQLITE_TRANSIENT.
1459914608
*/
14600
-#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
14609
+#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3OomFault)
1460114610
1460214611
/*
1460314612
** When SQLITE_OMIT_WSD is defined, it means that the target platform does
1460414613
** not support Writable Static Data (WSD) such as global and static variables.
1460514614
** All variables must either be on the stack or dynamically allocated from
@@ -16858,11 +16867,14 @@
1685816867
int nVdbeWrite; /* Number of active VDBEs that read and write */
1685916868
int nVdbeExec; /* Number of nested calls to VdbeExec() */
1686016869
int nVDestroy; /* Number of active OP_VDestroy operations */
1686116870
int nExtension; /* Number of loaded extensions */
1686216871
void **aExtension; /* Array of shared library handles */
16863
- int (*xTrace)(u32,void*,void*,void*); /* Trace function */
16872
+ union {
16873
+ void (*xLegacy)(void*,const char*); /* Legacy trace function */
16874
+ int (*xV2)(u32,void*,void*,void*); /* V2 Trace function */
16875
+ } trace;
1686416876
void *pTraceArg; /* Argument to the trace function */
1686516877
#ifndef SQLITE_OMIT_DEPRECATED
1686616878
void (*xProfile)(void*,const char*,u64); /* Profiling function */
1686716879
void *pProfileArg; /* Argument to profile function */
1686816880
#endif
@@ -19947,11 +19959,11 @@
1994719959
SQLITE_PRIVATE const char sqlite3StrBINARY[];
1994819960
SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
1994919961
SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
1995019962
SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
1995119963
SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
19952
-SQLITE_PRIVATE u32 sqlite3SelectTrace;
19964
+SQLITE_API extern u32 sqlite3_unsupported_selecttrace;
1995319965
#ifndef SQLITE_OMIT_WSD
1995419966
SQLITE_PRIVATE int sqlite3PendingByte;
1995519967
#endif
1995619968
#endif /* SQLITE_AMALGAMATION */
1995719969
#ifdef VDBE_PROFILE
@@ -20664,11 +20676,11 @@
2066420676
#endif
2066520677
2066620678
/*
2066720679
** Flags for select tracing and the ".selecttrace" macro of the CLI
2066820680
*/
20669
-/**/ u32 sqlite3SelectTrace = 0;
20681
+SQLITE_API u32 sqlite3_unsupported_selecttrace = 0;
2067020682
2067120683
/* #include "opcodes.h" */
2067220684
/*
2067320685
** Properties of opcodes. The OPFLG_INITIALIZER macro is
2067420686
** created by mkopcodeh.awk during compilation. Data is obtained
@@ -21663,11 +21675,11 @@
2166321675
** pagers the database handle is connected to. *pHighwater is always set
2166421676
** to zero.
2166521677
*/
2166621678
case SQLITE_DBSTATUS_CACHE_SPILL:
2166721679
op = SQLITE_DBSTATUS_CACHE_WRITE+1;
21668
- /* Fall through into the next case */
21680
+ /* no break */ deliberate_fall_through
2166921681
case SQLITE_DBSTATUS_CACHE_HIT:
2167021682
case SQLITE_DBSTATUS_CACHE_MISS:
2167121683
case SQLITE_DBSTATUS_CACHE_WRITE:{
2167221684
int i;
2167321685
int nRet = 0;
@@ -28540,15 +28552,15 @@
2854028552
assert( precision>=(-1) );
2854128553
switch( xtype ){
2854228554
case etPOINTER:
2854328555
flag_long = sizeof(char*)==sizeof(i64) ? 2 :
2854428556
sizeof(char*)==sizeof(long int) ? 1 : 0;
28545
- /* Fall through into the next case */
28557
+ /* no break */ deliberate_fall_through
2854628558
case etORDINAL:
2854728559
case etRADIX:
2854828560
cThousand = 0;
28549
- /* Fall through into the next case */
28561
+ /* no break */ deliberate_fall_through
2855028562
case etDECIMAL:
2855128563
if( infop->flags & FLAG_SIGNED ){
2855228564
i64 v;
2855328565
if( bArgList ){
2855428566
v = getIntArg(pArgList);
@@ -54193,16 +54205,17 @@
5419354205
5419454206
/* Allocate space for both the pJournal and pSuper file descriptors.
5419554207
** If successful, open the super-journal file for reading.
5419654208
*/
5419754209
pSuper = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
54198
- pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
5419954210
if( !pSuper ){
5420054211
rc = SQLITE_NOMEM_BKPT;
54212
+ pJournal = 0;
5420154213
}else{
5420254214
const int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_SUPER_JOURNAL);
5420354215
rc = sqlite3OsOpen(pVfs, zSuper, pSuper, flags, 0);
54216
+ pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
5420454217
}
5420554218
if( rc!=SQLITE_OK ) goto delsuper_out;
5420654219
5420754220
/* Load the entire super-journal file into space obtained from
5420854221
** sqlite3_malloc() and pointed to by zSuperJournal. Also obtain
@@ -78537,11 +78550,11 @@
7853778550
/* NOTE: Be sure to update mkopcodeh.tcl when adding or removing
7853878551
** cases from this switch! */
7853978552
switch( pOp->opcode ){
7854078553
case OP_Transaction: {
7854178554
if( pOp->p2!=0 ) p->readOnly = 0;
78542
- /* fall thru */
78555
+ /* no break */ deliberate_fall_through
7854378556
}
7854478557
case OP_AutoCommit:
7854578558
case OP_Savepoint: {
7854678559
p->bIsReader = 1;
7854778560
break;
@@ -78584,10 +78597,11 @@
7858478597
assert( (pOp - p->aOp) >= 3 );
7858578598
assert( pOp[-1].opcode==OP_Integer );
7858678599
n = pOp[-1].p1;
7858778600
if( n>nMaxArgs ) nMaxArgs = n;
7858878601
/* Fall through into the default case */
78602
+ /* no break */ deliberate_fall_through
7858978603
}
7859078604
#endif
7859178605
default: {
7859278606
if( pOp->p2<0 ){
7859378607
/* The mkopcodeh.tcl script has so arranged things that the only
@@ -83050,11 +83064,11 @@
8305083064
if( db->xProfile ){
8305183065
db->xProfile(db->pProfileArg, p->zSql, iElapse);
8305283066
}
8305383067
#endif
8305483068
if( db->mTrace & SQLITE_TRACE_PROFILE ){
83055
- db->xTrace(SQLITE_TRACE_PROFILE, db->pTraceArg, p, (void*)&iElapse);
83069
+ db->trace.xV2(SQLITE_TRACE_PROFILE, db->pTraceArg, p, (void*)&iElapse);
8305683070
}
8305783071
p->startTime = 0;
8305883072
}
8305983073
/*
8306083074
** The checkProfileCallback(DB,P) macro checks to see if a profile callback
@@ -86350,10 +86364,11 @@
8635086364
#ifdef SQLITE_DEBUG
8635186365
if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
8635286366
#endif
8635386367
if( (pIn3->flags & MEM_Null)==0 ) break;
8635486368
/* Fall through into OP_Halt */
86369
+ /* no break */ deliberate_fall_through
8635586370
}
8635686371
8635786372
/* Opcode: Halt P1 P2 * P4 P5
8635886373
**
8635986374
** Exit immediately. All open cursors, etc are closed
@@ -86520,10 +86535,11 @@
8652086535
goto too_big;
8652186536
}
8652286537
pOp->opcode = OP_String;
8652386538
assert( rc==SQLITE_OK );
8652486539
/* Fall through to the next case, OP_String */
86540
+ /* no break */ deliberate_fall_through
8652586541
}
8652686542
8652786543
/* Opcode: String P1 P2 P3 P4 P5
8652886544
** Synopsis: r[P2]='P4' (len=P1)
8652986545
**
@@ -86831,11 +86847,11 @@
8683186847
#endif
8683286848
}
8683386849
if( db->mallocFailed ) goto no_mem;
8683486850
8683586851
if( db->mTrace & SQLITE_TRACE_ROW ){
86836
- db->xTrace(SQLITE_TRACE_ROW, db->pTraceArg, p, 0);
86852
+ db->trace.xV2(SQLITE_TRACE_ROW, db->pTraceArg, p, 0);
8683786853
}
8683886854
8683986855
8684086856
/* Return SQLITE_ROW
8684186857
*/
@@ -89824,10 +89840,11 @@
8982489840
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
8982589841
pC = p->apCsr[pOp->p1];
8982689842
assert( pC!=0 );
8982789843
if( pC->seekHit ) break;
8982889844
/* Fall through into OP_NotFound */
89845
+ /* no break */ deliberate_fall_through
8982989846
}
8983089847
case OP_NoConflict: /* jump, in3 */
8983189848
case OP_NotFound: /* jump, in3 */
8983289849
case OP_Found: { /* jump, in3 */
8983389850
int alreadyExists;
@@ -89978,10 +89995,11 @@
8997889995
if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
8997989996
iKey = x.u.i;
8998089997
goto notExistsWithKey;
8998189998
}
8998289999
/* Fall through into OP_NotExists */
90000
+ /* no break */ deliberate_fall_through
8998390001
case OP_NotExists: /* jump, in3 */
8998490002
pIn3 = &aMem[pOp->p3];
8998590003
assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
8998690004
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
8998790005
iKey = pIn3->u.i;
@@ -90749,10 +90767,11 @@
9074990767
sqlite3_sort_count++;
9075090768
sqlite3_search_count--;
9075190769
#endif
9075290770
p->aCounter[SQLITE_STMTSTATUS_SORT]++;
9075390771
/* Fall through into OP_Rewind */
90772
+ /* no break */ deliberate_fall_through
9075490773
}
9075590774
/* Opcode: Rewind P1 P2 * * *
9075690775
**
9075790776
** The next use of the Rowid or Column or Next instruction for P1
9075890777
** will refer to the first entry in the database table or index.
@@ -92102,10 +92121,11 @@
9210292121
/* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */
9210392122
assert( pOp->p1==(pOp->opcode==OP_AggInverse) );
9210492123
9210592124
pOp->opcode = OP_AggStep1;
9210692125
/* Fall through into OP_AggStep */
92126
+ /* no break */ deliberate_fall_through
9210792127
}
9210892128
case OP_AggStep1: {
9210992129
int i;
9211092130
sqlite3_context *pCtx;
9211192131
Mem *pMem;
@@ -93091,22 +93111,21 @@
9309193111
&& !p->doingRerun
9309293112
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
9309393113
){
9309493114
#ifndef SQLITE_OMIT_DEPRECATED
9309593115
if( db->mTrace & SQLITE_TRACE_LEGACY ){
93096
- void (*x)(void*,const char*) = (void(*)(void*,const char*))db->xTrace;
9309793116
char *z = sqlite3VdbeExpandSql(p, zTrace);
93098
- x(db->pTraceArg, z);
93117
+ db->trace.xLegacy(db->pTraceArg, z);
9309993118
sqlite3_free(z);
9310093119
}else
9310193120
#endif
9310293121
if( db->nVdbeExec>1 ){
9310393122
char *z = sqlite3MPrintf(db, "-- %s", zTrace);
93104
- (void)db->xTrace(SQLITE_TRACE_STMT, db->pTraceArg, p, z);
93123
+ (void)db->trace.xV2(SQLITE_TRACE_STMT, db->pTraceArg, p, z);
9310593124
sqlite3DbFree(db, z);
9310693125
}else{
93107
- (void)db->xTrace(SQLITE_TRACE_STMT, db->pTraceArg, p, zTrace);
93126
+ (void)db->trace.xV2(SQLITE_TRACE_STMT, db->pTraceArg, p, zTrace);
9310893127
}
9310993128
}
9311093129
#ifdef SQLITE_USE_FCNTL_TRACE
9311193130
zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql);
9311293131
if( zTrace ){
@@ -98824,11 +98843,11 @@
9882498843
pExpr->op2 = pExpr->op;
9882598844
pExpr->op = TK_TRUTH;
9882698845
return WRC_Continue;
9882798846
}
9882898847
}
98829
- /* Fall thru */
98848
+ /* no break */ deliberate_fall_through
9883098849
}
9883198850
case TK_BETWEEN:
9883298851
case TK_EQ:
9883398852
case TK_NE:
9883498853
case TK_LT:
@@ -101728,11 +101747,11 @@
101728101747
/* Convert "true" or "false" in a DEFAULT clause into the
101729101748
** appropriate TK_TRUEFALSE operator */
101730101749
if( sqlite3ExprIdToTrueFalse(pExpr) ){
101731101750
return WRC_Prune;
101732101751
}
101733
- /* Fall thru */
101752
+ /* no break */ deliberate_fall_through
101734101753
case TK_COLUMN:
101735101754
case TK_AGG_FUNCTION:
101736101755
case TK_AGG_COLUMN:
101737101756
testcase( pExpr->op==TK_ID );
101738101757
testcase( pExpr->op==TK_COLUMN );
@@ -101742,11 +101761,11 @@
101742101761
return WRC_Continue;
101743101762
}
101744101763
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){
101745101764
return WRC_Continue;
101746101765
}
101747
- /* Fall through */
101766
+ /* no break */ deliberate_fall_through
101748101767
case TK_IF_NULL_ROW:
101749101768
case TK_REGISTER:
101750101769
case TK_DOT:
101751101770
testcase( pExpr->op==TK_REGISTER );
101752101771
testcase( pExpr->op==TK_IF_NULL_ROW );
@@ -101763,11 +101782,11 @@
101763101782
/* A bound parameter in a CREATE statement that originates from
101764101783
** sqlite3_prepare() causes an error */
101765101784
pWalker->eCode = 0;
101766101785
return WRC_Abort;
101767101786
}
101768
- /* Fall through */
101787
+ /* no break */ deliberate_fall_through
101769101788
default:
101770101789
testcase( pExpr->op==TK_SELECT ); /* sqlite3SelectWalkFail() disallows */
101771101790
testcase( pExpr->op==TK_EXISTS ); /* sqlite3SelectWalkFail() disallows */
101772101791
return WRC_Continue;
101773101792
}
@@ -103535,10 +103554,11 @@
103535103554
}
103536103555
}
103537103556
return target;
103538103557
}
103539103558
/* Otherwise, fall thru into the TK_COLUMN case */
103559
+ /* no break */ deliberate_fall_through
103540103560
}
103541103561
case TK_COLUMN: {
103542103562
int iTab = pExpr->iTable;
103543103563
int iReg;
103544103564
if( ExprHasProperty(pExpr, EP_FixedCol) ){
@@ -104600,11 +104620,11 @@
104600104620
case TK_ISNOT:
104601104621
testcase( op==TK_IS );
104602104622
testcase( op==TK_ISNOT );
104603104623
op = (op==TK_IS) ? TK_EQ : TK_NE;
104604104624
jumpIfNull = SQLITE_NULLEQ;
104605
- /* Fall thru */
104625
+ /* no break */ deliberate_fall_through
104606104626
case TK_LT:
104607104627
case TK_LE:
104608104628
case TK_GT:
104609104629
case TK_GE:
104610104630
case TK_NE:
@@ -104776,11 +104796,11 @@
104776104796
case TK_ISNOT:
104777104797
testcase( pExpr->op==TK_IS );
104778104798
testcase( pExpr->op==TK_ISNOT );
104779104799
op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ;
104780104800
jumpIfNull = SQLITE_NULLEQ;
104781
- /* Fall thru */
104801
+ /* no break */ deliberate_fall_through
104782104802
case TK_LT:
104783104803
case TK_LE:
104784104804
case TK_GT:
104785104805
case TK_GE:
104786104806
case TK_NE:
@@ -105088,17 +105108,17 @@
105088105108
case TK_BITOR:
105089105109
case TK_LSHIFT:
105090105110
case TK_RSHIFT:
105091105111
case TK_CONCAT:
105092105112
seenNot = 1;
105093
- /* Fall thru */
105113
+ /* no break */ deliberate_fall_through
105094105114
case TK_STAR:
105095105115
case TK_REM:
105096105116
case TK_BITAND:
105097105117
case TK_SLASH: {
105098105118
if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
105099
- /* Fall thru into the next case */
105119
+ /* no break */ deliberate_fall_through
105100105120
}
105101105121
case TK_SPAN:
105102105122
case TK_COLLATE:
105103105123
case TK_UPLUS:
105104105124
case TK_UMINUS: {
@@ -105243,10 +105263,11 @@
105243105263
|| (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
105244105264
&& IsVirtual(pRight->y.pTab))
105245105265
){
105246105266
return WRC_Prune;
105247105267
}
105268
+ /* no break */ deliberate_fall_through
105248105269
}
105249105270
default:
105250105271
return WRC_Continue;
105251105272
}
105252105273
}
@@ -120447,10 +120468,11 @@
120447120468
case OE_Cascade:
120448120469
if( !pChanges ){
120449120470
pStep->op = TK_DELETE;
120450120471
break;
120451120472
}
120473
+ /* no break */ deliberate_fall_through
120452120474
default:
120453120475
pStep->op = TK_UPDATE;
120454120476
}
120455120477
pStep->pTrig = pTrigger;
120456120478
pTrigger->pSchema = pTab->pSchema;
@@ -122151,11 +122173,11 @@
122151122173
sqlite3VdbeJumpHere(v, addr1);
122152122174
break;
122153122175
}
122154122176
case OE_Abort:
122155122177
sqlite3MayAbort(pParse);
122156
- /* Fall through */
122178
+ /* no break */ deliberate_fall_through
122157122179
case OE_Rollback:
122158122180
case OE_Fail: {
122159122181
char *zMsg = sqlite3MPrintf(db, "%s.%s", pTab->zName,
122160122182
pCol->zName);
122161122183
sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT_NOTNULL,
@@ -122379,11 +122401,11 @@
122379122401
VdbeCoverage(v);
122380122402
122381122403
switch( onError ){
122382122404
default: {
122383122405
onError = OE_Abort;
122384
- /* Fall thru into the next case */
122406
+ /* no break */ deliberate_fall_through
122385122407
}
122386122408
case OE_Rollback:
122387122409
case OE_Abort:
122388122410
case OE_Fail: {
122389122411
testcase( onError==OE_Rollback );
@@ -122440,11 +122462,11 @@
122440122462
break;
122441122463
}
122442122464
#ifndef SQLITE_OMIT_UPSERT
122443122465
case OE_Update: {
122444122466
sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, 0, iDataCur);
122445
- /* Fall through */
122467
+ /* no break */ deliberate_fall_through
122446122468
}
122447122469
#endif
122448122470
case OE_Ignore: {
122449122471
testcase( onError==OE_Ignore );
122450122472
sqlite3VdbeGoto(v, ignoreDest);
@@ -122661,11 +122683,11 @@
122661122683
break;
122662122684
}
122663122685
#ifndef SQLITE_OMIT_UPSERT
122664122686
case OE_Update: {
122665122687
sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, pIdx, iIdxCur+ix);
122666
- /* Fall through */
122688
+ /* no break */ deliberate_fall_through
122667122689
}
122668122690
#endif
122669122691
case OE_Ignore: {
122670122692
testcase( onError==OE_Ignore );
122671122693
sqlite3VdbeGoto(v, ignoreDest);
@@ -133471,11 +133493,11 @@
133471133493
sqlite3AggInfoPersistWalkerInit(&w, pParse);
133472133494
sqlite3WalkSelect(&w,pSub1);
133473133495
sqlite3SelectDelete(db, pSub1);
133474133496
133475133497
#if SELECTTRACE_ENABLED
133476
- if( sqlite3SelectTrace & 0x100 ){
133498
+ if( sqlite3_unsupported_selecttrace & 0x100 ){
133477133499
SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
133478133500
sqlite3TreeViewSelect(0, p, 0);
133479133501
}
133480133502
#endif
133481133503
@@ -134909,11 +134931,11 @@
134909134931
sWalker.pParse = pParse;
134910134932
sWalker.xExprCallback = havingToWhereExprCb;
134911134933
sWalker.u.pSelect = p;
134912134934
sqlite3WalkExpr(&sWalker, p->pHaving);
134913134935
#if SELECTTRACE_ENABLED
134914
- if( sWalker.eCode && (sqlite3SelectTrace & 0x100)!=0 ){
134936
+ if( sWalker.eCode && (sqlite3_unsupported_selecttrace & 0x100)!=0 ){
134915134937
SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
134916134938
sqlite3TreeViewSelect(0, p, 0);
134917134939
}
134918134940
#endif
134919134941
}
@@ -135031,11 +135053,11 @@
135031135053
}
135032135054
p->pEList->a[0].pExpr = pExpr;
135033135055
p->selFlags &= ~SF_Aggregate;
135034135056
135035135057
#if SELECTTRACE_ENABLED
135036
- if( sqlite3SelectTrace & 0x400 ){
135058
+ if( sqlite3_unsupported_selecttrace & 0x400 ){
135037135059
SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
135038135060
sqlite3TreeViewSelect(0, p, 0);
135039135061
}
135040135062
#endif
135041135063
return 1;
@@ -135084,11 +135106,11 @@
135084135106
return 1;
135085135107
}
135086135108
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
135087135109
#if SELECTTRACE_ENABLED
135088135110
SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
135089
- if( sqlite3SelectTrace & 0x100 ){
135111
+ if( sqlite3_unsupported_selecttrace & 0x100 ){
135090135112
sqlite3TreeViewSelect(0, p, 0);
135091135113
}
135092135114
#endif
135093135115
135094135116
assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135111,11 +135133,11 @@
135111135133
if( pParse->nErr || db->mallocFailed ){
135112135134
goto select_end;
135113135135
}
135114135136
assert( p->pEList!=0 );
135115135137
#if SELECTTRACE_ENABLED
135116
- if( sqlite3SelectTrace & 0x104 ){
135138
+ if( sqlite3_unsupported_selecttrace & 0x104 ){
135117135139
SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
135118135140
sqlite3TreeViewSelect(0, p, 0);
135119135141
}
135120135142
#endif
135121135143
@@ -135146,11 +135168,11 @@
135146135168
if( rc ){
135147135169
assert( db->mallocFailed || pParse->nErr>0 );
135148135170
goto select_end;
135149135171
}
135150135172
#if SELECTTRACE_ENABLED
135151
- if( p->pWin && (sqlite3SelectTrace & 0x108)!=0 ){
135173
+ if( p->pWin && (sqlite3_unsupported_selecttrace & 0x108)!=0 ){
135152135174
SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
135153135175
sqlite3TreeViewSelect(0, p, 0);
135154135176
}
135155135177
#endif
135156135178
#endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135253,11 +135275,11 @@
135253135275
*/
135254135276
if( p->pPrior ){
135255135277
rc = multiSelect(pParse, p, pDest);
135256135278
#if SELECTTRACE_ENABLED
135257135279
SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
135258
- if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135280
+ if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135259135281
sqlite3TreeViewSelect(0, p, 0);
135260135282
}
135261135283
#endif
135262135284
if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
135263135285
return rc;
@@ -135272,11 +135294,11 @@
135272135294
if( pTabList->nSrc>1
135273135295
&& OptimizationEnabled(db, SQLITE_PropagateConst)
135274135296
&& propagateConstants(pParse, p)
135275135297
){
135276135298
#if SELECTTRACE_ENABLED
135277
- if( sqlite3SelectTrace & 0x100 ){
135299
+ if( sqlite3_unsupported_selecttrace & 0x100 ){
135278135300
SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
135279135301
sqlite3TreeViewSelect(0, p, 0);
135280135302
}
135281135303
#endif
135282135304
}else{
@@ -135360,11 +135382,11 @@
135360135382
if( OptimizationEnabled(db, SQLITE_PushDown)
135361135383
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
135362135384
(pItem->fg.jointype & JT_OUTER)!=0)
135363135385
){
135364135386
#if SELECTTRACE_ENABLED
135365
- if( sqlite3SelectTrace & 0x100 ){
135387
+ if( sqlite3_unsupported_selecttrace & 0x100 ){
135366135388
SELECTTRACE(0x100,pParse,p,
135367135389
("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
135368135390
sqlite3TreeViewSelect(0, p, 0);
135369135391
}
135370135392
#endif
@@ -135460,11 +135482,11 @@
135460135482
pGroupBy = p->pGroupBy;
135461135483
pHaving = p->pHaving;
135462135484
sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
135463135485
135464135486
#if SELECTTRACE_ENABLED
135465
- if( sqlite3SelectTrace & 0x400 ){
135487
+ if( sqlite3_unsupported_selecttrace & 0x400 ){
135466135488
SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
135467135489
sqlite3TreeViewSelect(0, p, 0);
135468135490
}
135469135491
#endif
135470135492
@@ -135496,11 +135518,11 @@
135496135518
** the sDistinct.isTnct is still set. Hence, isTnct represents the
135497135519
** original setting of the SF_Distinct flag, not the current setting */
135498135520
assert( sDistinct.isTnct );
135499135521
135500135522
#if SELECTTRACE_ENABLED
135501
- if( sqlite3SelectTrace & 0x400 ){
135523
+ if( sqlite3_unsupported_selecttrace & 0x400 ){
135502135524
SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
135503135525
sqlite3TreeViewSelect(0, p, 0);
135504135526
}
135505135527
#endif
135506135528
}
@@ -135744,11 +135766,11 @@
135744135766
sNC.ncFlags &= ~NC_InAggFunc;
135745135767
}
135746135768
pAggInfo->mxReg = pParse->nMem;
135747135769
if( db->mallocFailed ) goto select_end;
135748135770
#if SELECTTRACE_ENABLED
135749
- if( sqlite3SelectTrace & 0x400 ){
135771
+ if( sqlite3_unsupported_selecttrace & 0x400 ){
135750135772
int ii;
135751135773
SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
135752135774
sqlite3TreeViewSelect(0, p, 0);
135753135775
for(ii=0; ii<pAggInfo->nColumn; ii++){
135754135776
sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136163,11 +136185,11 @@
136163136185
}
136164136186
#endif
136165136187
136166136188
#if SELECTTRACE_ENABLED
136167136189
SELECTTRACE(0x1,pParse,p,("end processing\n"));
136168
- if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136190
+ if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136169136191
sqlite3TreeViewSelect(0, p, 0);
136170136192
}
136171136193
#endif
136172136194
ExplainQueryPlanPop(pParse);
136173136195
return rc;
@@ -151934,11 +151956,11 @@
151934151956
assert( pWin->pOwner==pExpr );
151935151957
return WRC_Prune;
151936151958
}
151937151959
}
151938151960
}
151939
- /* Fall through. */
151961
+ /* no break */ deliberate_fall_through
151940151962
151941151963
case TK_AGG_FUNCTION:
151942151964
case TK_COLUMN: {
151943151965
int iCol = -1;
151944151966
if( p->pSub ){
@@ -160151,10 +160173,11 @@
160151160173
*tokenType = TK_DOT;
160152160174
return 1;
160153160175
}
160154160176
/* If the next character is a digit, this is a floating point
160155160177
** number that begins with ".". Fall thru into the next case */
160178
+ /* no break */ deliberate_fall_through
160156160179
}
160157160180
case CC_DIGIT: {
160158160181
testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' );
160159160182
testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' );
160160160183
testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
@@ -160255,10 +160278,11 @@
160255160278
return i;
160256160279
}
160257160280
#endif
160258160281
/* If it is not a BLOB literal, then it must be an ID, since no
160259160282
** SQL keywords start with the letter 'x'. Fall through */
160283
+ /* no break */ deliberate_fall_through
160260160284
}
160261160285
case CC_ID: {
160262160286
i = 1;
160263160287
break;
160264160288
}
@@ -162185,11 +162209,11 @@
162185162209
if( !sqlite3SafetyCheckSickOrOk(db) ){
162186162210
return SQLITE_MISUSE_BKPT;
162187162211
}
162188162212
sqlite3_mutex_enter(db->mutex);
162189162213
if( db->mTrace & SQLITE_TRACE_CLOSE ){
162190
- db->xTrace(SQLITE_TRACE_CLOSE, db->pTraceArg, db, 0);
162214
+ db->trace.xV2(SQLITE_TRACE_CLOSE, db->pTraceArg, db, 0);
162191162215
}
162192162216
162193162217
/* Force xDisconnect calls on all virtual tables */
162194162218
disconnectAllVtab(db);
162195162219
@@ -163074,11 +163098,11 @@
163074163098
}
163075163099
#endif
163076163100
sqlite3_mutex_enter(db->mutex);
163077163101
pOld = db->pTraceArg;
163078163102
db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0;
163079
- db->xTrace = (int(*)(u32,void*,void*,void*))xTrace;
163103
+ db->trace.xLegacy = xTrace;
163080163104
db->pTraceArg = pArg;
163081163105
sqlite3_mutex_leave(db->mutex);
163082163106
return pOld;
163083163107
}
163084163108
#endif /* SQLITE_OMIT_DEPRECATED */
@@ -163098,11 +163122,11 @@
163098163122
#endif
163099163123
sqlite3_mutex_enter(db->mutex);
163100163124
if( mTrace==0 ) xTrace = 0;
163101163125
if( xTrace==0 ) mTrace = 0;
163102163126
db->mTrace = mTrace;
163103
- db->xTrace = xTrace;
163127
+ db->trace.xV2 = xTrace;
163104163128
db->pTraceArg = pArg;
163105163129
sqlite3_mutex_leave(db->mutex);
163106163130
return SQLITE_OK;
163107163131
}
163108163132
@@ -166694,10 +166718,12 @@
166694166718
# define TESTONLY(X)
166695166719
#endif
166696166720
166697166721
#define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
166698166722
#define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
166723
+
166724
+#define deliberate_fall_through
166699166725
166700166726
#endif /* SQLITE_AMALGAMATION */
166701166727
166702166728
#ifdef SQLITE_DEBUG
166703166729
SQLITE_PRIVATE int sqlite3Fts3Corrupt(void);
@@ -170337,11 +170363,11 @@
170337170363
}else if( p->zLanguageid==0 ){
170338170364
sqlite3_result_int(pCtx, 0);
170339170365
break;
170340170366
}else{
170341170367
iCol = p->nColumn;
170342
- /* fall-through */
170368
+ /* no break */ deliberate_fall_through
170343170369
}
170344170370
170345170371
default:
170346170372
/* A user column. Or, if this is a full-table scan, possibly the
170347170373
** language-id column. Seek the cursor. */
@@ -170580,13 +170606,17 @@
170580170606
}
170581170607
if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return;
170582170608
170583170609
switch( nVal ){
170584170610
case 6: nToken = sqlite3_value_int(apVal[5]);
170611
+ /* no break */ deliberate_fall_through
170585170612
case 5: iCol = sqlite3_value_int(apVal[4]);
170613
+ /* no break */ deliberate_fall_through
170586170614
case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
170615
+ /* no break */ deliberate_fall_through
170587170616
case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
170617
+ /* no break */ deliberate_fall_through
170588170618
case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
170589170619
}
170590170620
if( !zEllipsis || !zEnd || !zStart ){
170591170621
sqlite3_result_error_nomem(pContext);
170592170622
}else if( nToken==0 ){
@@ -185444,10 +185474,14 @@
185444185474
#ifndef LARGEST_INT64
185445185475
# define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
185446185476
# define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64)
185447185477
#endif
185448185478
185479
+#ifndef deliberate_fall_through
185480
+# define deliberate_fall_through
185481
+#endif
185482
+
185449185483
/*
185450185484
** Versions of isspace(), isalnum() and isdigit() to which it is safe
185451185485
** to pass signed char values.
185452185486
*/
185453185487
#ifdef sqlite3Isdigit
@@ -185862,11 +185896,11 @@
185862185896
case JSON_STRING: {
185863185897
if( pNode->jnFlags & JNODE_RAW ){
185864185898
jsonAppendString(pOut, pNode->u.zJContent, pNode->n);
185865185899
break;
185866185900
}
185867
- /* Fall through into the next case */
185901
+ /* no break */ deliberate_fall_through
185868185902
}
185869185903
case JSON_REAL:
185870185904
case JSON_INT: {
185871185905
jsonAppendRaw(pOut, pNode->u.zJContent, pNode->n);
185872185906
break;
@@ -186003,11 +186037,11 @@
186003186037
}
186004186038
if( pNode->u.zJContent[0]=='-' ){ i = -i; }
186005186039
sqlite3_result_int64(pCtx, i);
186006186040
int_done:
186007186041
break;
186008
- int_as_real: /* fall through to real */;
186042
+ int_as_real: i=0; /* no break */ deliberate_fall_through
186009186043
}
186010186044
case JSON_REAL: {
186011186045
double r;
186012186046
#ifdef SQLITE_AMALGAMATION
186013186047
const char *z = pNode->u.zJContent;
@@ -187706,10 +187740,11 @@
187706187740
jsonResult(&x);
187707187741
break;
187708187742
}
187709187743
/* For json_each() path and root are the same so fall through
187710187744
** into the root case */
187745
+ /* no break */ deliberate_fall_through
187711187746
}
187712187747
default: {
187713187748
const char *zRoot = p->zRoot;
187714187749
if( zRoot==0 ) zRoot = "$";
187715187750
sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);
@@ -225692,11 +225727,11 @@
225692225727
int nArg, /* Number of args */
225693225728
sqlite3_value **apUnused /* Function arguments */
225694225729
){
225695225730
assert( nArg==0 );
225696225731
UNUSED_PARAM2(nArg, apUnused);
225697
- sqlite3_result_text(pCtx, "fts5: 2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214", -1, SQLITE_TRANSIENT);
225732
+ sqlite3_result_text(pCtx, "fts5: 2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f", -1, SQLITE_TRANSIENT);
225698225733
}
225699225734
225700225735
/*
225701225736
** Return true if zName is the extension on one of the shadow tables used
225702225737
** by this module.
@@ -230475,12 +230510,12 @@
230475230510
}
230476230511
#endif /* SQLITE_CORE */
230477230512
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230478230513
230479230514
/************** End of stmt.c ************************************************/
230480
-#if __LINE__!=230480
230515
+#if __LINE__!=230515
230481230516
#undef SQLITE_SOURCE_ID
230482
-#define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635alt2"
230517
+#define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff7alt2"
230483230518
#endif
230484230519
/* Return the source-id for this library */
230485230520
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230486230521
/************************** End of sqlite3.c ******************************/
230487230522
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -997,10 +997,19 @@
997
998 #if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
999 # define _BSD_SOURCE
1000 #endif
1001
 
 
 
 
 
 
 
 
 
1002 /*
1003 ** For MinGW, check to see if we can include the header file containing its
1004 ** version information, among other things. Normally, this internal MinGW
1005 ** header file would [only] be included automatically by other MinGW header
1006 ** files; however, the contained version information is now required by this
@@ -1162,11 +1171,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635241d"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -14532,11 +14541,11 @@
14532 # define SELECTTRACE_ENABLED 0
14533 #endif
14534 #if defined(SQLITE_ENABLE_SELECTTRACE)
14535 # define SELECTTRACE_ENABLED 1
14536 # define SELECTTRACE(K,P,S,X) \
14537 if(sqlite3SelectTrace&(K)) \
14538 sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
14539 sqlite3DebugPrintf X
14540 #else
14541 # define SELECTTRACE(K,P,S,X)
14542 # define SELECTTRACE_ENABLED 0
@@ -14595,11 +14604,11 @@
14595 ** one parameter that destructors normally want. So we have to introduce
14596 ** this magic value that the code knows to handle differently. Any
14597 ** pointer will work here as long as it is distinct from SQLITE_STATIC
14598 ** and SQLITE_TRANSIENT.
14599 */
14600 #define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
14601
14602 /*
14603 ** When SQLITE_OMIT_WSD is defined, it means that the target platform does
14604 ** not support Writable Static Data (WSD) such as global and static variables.
14605 ** All variables must either be on the stack or dynamically allocated from
@@ -16858,11 +16867,14 @@
16858 int nVdbeWrite; /* Number of active VDBEs that read and write */
16859 int nVdbeExec; /* Number of nested calls to VdbeExec() */
16860 int nVDestroy; /* Number of active OP_VDestroy operations */
16861 int nExtension; /* Number of loaded extensions */
16862 void **aExtension; /* Array of shared library handles */
16863 int (*xTrace)(u32,void*,void*,void*); /* Trace function */
 
 
 
16864 void *pTraceArg; /* Argument to the trace function */
16865 #ifndef SQLITE_OMIT_DEPRECATED
16866 void (*xProfile)(void*,const char*,u64); /* Profiling function */
16867 void *pProfileArg; /* Argument to profile function */
16868 #endif
@@ -19947,11 +19959,11 @@
19947 SQLITE_PRIVATE const char sqlite3StrBINARY[];
19948 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
19949 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
19950 SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
19951 SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
19952 SQLITE_PRIVATE u32 sqlite3SelectTrace;
19953 #ifndef SQLITE_OMIT_WSD
19954 SQLITE_PRIVATE int sqlite3PendingByte;
19955 #endif
19956 #endif /* SQLITE_AMALGAMATION */
19957 #ifdef VDBE_PROFILE
@@ -20664,11 +20676,11 @@
20664 #endif
20665
20666 /*
20667 ** Flags for select tracing and the ".selecttrace" macro of the CLI
20668 */
20669 /**/ u32 sqlite3SelectTrace = 0;
20670
20671 /* #include "opcodes.h" */
20672 /*
20673 ** Properties of opcodes. The OPFLG_INITIALIZER macro is
20674 ** created by mkopcodeh.awk during compilation. Data is obtained
@@ -21663,11 +21675,11 @@
21663 ** pagers the database handle is connected to. *pHighwater is always set
21664 ** to zero.
21665 */
21666 case SQLITE_DBSTATUS_CACHE_SPILL:
21667 op = SQLITE_DBSTATUS_CACHE_WRITE+1;
21668 /* Fall through into the next case */
21669 case SQLITE_DBSTATUS_CACHE_HIT:
21670 case SQLITE_DBSTATUS_CACHE_MISS:
21671 case SQLITE_DBSTATUS_CACHE_WRITE:{
21672 int i;
21673 int nRet = 0;
@@ -28540,15 +28552,15 @@
28540 assert( precision>=(-1) );
28541 switch( xtype ){
28542 case etPOINTER:
28543 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
28544 sizeof(char*)==sizeof(long int) ? 1 : 0;
28545 /* Fall through into the next case */
28546 case etORDINAL:
28547 case etRADIX:
28548 cThousand = 0;
28549 /* Fall through into the next case */
28550 case etDECIMAL:
28551 if( infop->flags & FLAG_SIGNED ){
28552 i64 v;
28553 if( bArgList ){
28554 v = getIntArg(pArgList);
@@ -54193,16 +54205,17 @@
54193
54194 /* Allocate space for both the pJournal and pSuper file descriptors.
54195 ** If successful, open the super-journal file for reading.
54196 */
54197 pSuper = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
54198 pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
54199 if( !pSuper ){
54200 rc = SQLITE_NOMEM_BKPT;
 
54201 }else{
54202 const int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_SUPER_JOURNAL);
54203 rc = sqlite3OsOpen(pVfs, zSuper, pSuper, flags, 0);
 
54204 }
54205 if( rc!=SQLITE_OK ) goto delsuper_out;
54206
54207 /* Load the entire super-journal file into space obtained from
54208 ** sqlite3_malloc() and pointed to by zSuperJournal. Also obtain
@@ -78537,11 +78550,11 @@
78537 /* NOTE: Be sure to update mkopcodeh.tcl when adding or removing
78538 ** cases from this switch! */
78539 switch( pOp->opcode ){
78540 case OP_Transaction: {
78541 if( pOp->p2!=0 ) p->readOnly = 0;
78542 /* fall thru */
78543 }
78544 case OP_AutoCommit:
78545 case OP_Savepoint: {
78546 p->bIsReader = 1;
78547 break;
@@ -78584,10 +78597,11 @@
78584 assert( (pOp - p->aOp) >= 3 );
78585 assert( pOp[-1].opcode==OP_Integer );
78586 n = pOp[-1].p1;
78587 if( n>nMaxArgs ) nMaxArgs = n;
78588 /* Fall through into the default case */
 
78589 }
78590 #endif
78591 default: {
78592 if( pOp->p2<0 ){
78593 /* The mkopcodeh.tcl script has so arranged things that the only
@@ -83050,11 +83064,11 @@
83050 if( db->xProfile ){
83051 db->xProfile(db->pProfileArg, p->zSql, iElapse);
83052 }
83053 #endif
83054 if( db->mTrace & SQLITE_TRACE_PROFILE ){
83055 db->xTrace(SQLITE_TRACE_PROFILE, db->pTraceArg, p, (void*)&iElapse);
83056 }
83057 p->startTime = 0;
83058 }
83059 /*
83060 ** The checkProfileCallback(DB,P) macro checks to see if a profile callback
@@ -86350,10 +86364,11 @@
86350 #ifdef SQLITE_DEBUG
86351 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
86352 #endif
86353 if( (pIn3->flags & MEM_Null)==0 ) break;
86354 /* Fall through into OP_Halt */
 
86355 }
86356
86357 /* Opcode: Halt P1 P2 * P4 P5
86358 **
86359 ** Exit immediately. All open cursors, etc are closed
@@ -86520,10 +86535,11 @@
86520 goto too_big;
86521 }
86522 pOp->opcode = OP_String;
86523 assert( rc==SQLITE_OK );
86524 /* Fall through to the next case, OP_String */
 
86525 }
86526
86527 /* Opcode: String P1 P2 P3 P4 P5
86528 ** Synopsis: r[P2]='P4' (len=P1)
86529 **
@@ -86831,11 +86847,11 @@
86831 #endif
86832 }
86833 if( db->mallocFailed ) goto no_mem;
86834
86835 if( db->mTrace & SQLITE_TRACE_ROW ){
86836 db->xTrace(SQLITE_TRACE_ROW, db->pTraceArg, p, 0);
86837 }
86838
86839
86840 /* Return SQLITE_ROW
86841 */
@@ -89824,10 +89840,11 @@
89824 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
89825 pC = p->apCsr[pOp->p1];
89826 assert( pC!=0 );
89827 if( pC->seekHit ) break;
89828 /* Fall through into OP_NotFound */
 
89829 }
89830 case OP_NoConflict: /* jump, in3 */
89831 case OP_NotFound: /* jump, in3 */
89832 case OP_Found: { /* jump, in3 */
89833 int alreadyExists;
@@ -89978,10 +89995,11 @@
89978 if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
89979 iKey = x.u.i;
89980 goto notExistsWithKey;
89981 }
89982 /* Fall through into OP_NotExists */
 
89983 case OP_NotExists: /* jump, in3 */
89984 pIn3 = &aMem[pOp->p3];
89985 assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
89986 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
89987 iKey = pIn3->u.i;
@@ -90749,10 +90767,11 @@
90749 sqlite3_sort_count++;
90750 sqlite3_search_count--;
90751 #endif
90752 p->aCounter[SQLITE_STMTSTATUS_SORT]++;
90753 /* Fall through into OP_Rewind */
 
90754 }
90755 /* Opcode: Rewind P1 P2 * * *
90756 **
90757 ** The next use of the Rowid or Column or Next instruction for P1
90758 ** will refer to the first entry in the database table or index.
@@ -92102,10 +92121,11 @@
92102 /* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */
92103 assert( pOp->p1==(pOp->opcode==OP_AggInverse) );
92104
92105 pOp->opcode = OP_AggStep1;
92106 /* Fall through into OP_AggStep */
 
92107 }
92108 case OP_AggStep1: {
92109 int i;
92110 sqlite3_context *pCtx;
92111 Mem *pMem;
@@ -93091,22 +93111,21 @@
93091 && !p->doingRerun
93092 && (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
93093 ){
93094 #ifndef SQLITE_OMIT_DEPRECATED
93095 if( db->mTrace & SQLITE_TRACE_LEGACY ){
93096 void (*x)(void*,const char*) = (void(*)(void*,const char*))db->xTrace;
93097 char *z = sqlite3VdbeExpandSql(p, zTrace);
93098 x(db->pTraceArg, z);
93099 sqlite3_free(z);
93100 }else
93101 #endif
93102 if( db->nVdbeExec>1 ){
93103 char *z = sqlite3MPrintf(db, "-- %s", zTrace);
93104 (void)db->xTrace(SQLITE_TRACE_STMT, db->pTraceArg, p, z);
93105 sqlite3DbFree(db, z);
93106 }else{
93107 (void)db->xTrace(SQLITE_TRACE_STMT, db->pTraceArg, p, zTrace);
93108 }
93109 }
93110 #ifdef SQLITE_USE_FCNTL_TRACE
93111 zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql);
93112 if( zTrace ){
@@ -98824,11 +98843,11 @@
98824 pExpr->op2 = pExpr->op;
98825 pExpr->op = TK_TRUTH;
98826 return WRC_Continue;
98827 }
98828 }
98829 /* Fall thru */
98830 }
98831 case TK_BETWEEN:
98832 case TK_EQ:
98833 case TK_NE:
98834 case TK_LT:
@@ -101728,11 +101747,11 @@
101728 /* Convert "true" or "false" in a DEFAULT clause into the
101729 ** appropriate TK_TRUEFALSE operator */
101730 if( sqlite3ExprIdToTrueFalse(pExpr) ){
101731 return WRC_Prune;
101732 }
101733 /* Fall thru */
101734 case TK_COLUMN:
101735 case TK_AGG_FUNCTION:
101736 case TK_AGG_COLUMN:
101737 testcase( pExpr->op==TK_ID );
101738 testcase( pExpr->op==TK_COLUMN );
@@ -101742,11 +101761,11 @@
101742 return WRC_Continue;
101743 }
101744 if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){
101745 return WRC_Continue;
101746 }
101747 /* Fall through */
101748 case TK_IF_NULL_ROW:
101749 case TK_REGISTER:
101750 case TK_DOT:
101751 testcase( pExpr->op==TK_REGISTER );
101752 testcase( pExpr->op==TK_IF_NULL_ROW );
@@ -101763,11 +101782,11 @@
101763 /* A bound parameter in a CREATE statement that originates from
101764 ** sqlite3_prepare() causes an error */
101765 pWalker->eCode = 0;
101766 return WRC_Abort;
101767 }
101768 /* Fall through */
101769 default:
101770 testcase( pExpr->op==TK_SELECT ); /* sqlite3SelectWalkFail() disallows */
101771 testcase( pExpr->op==TK_EXISTS ); /* sqlite3SelectWalkFail() disallows */
101772 return WRC_Continue;
101773 }
@@ -103535,10 +103554,11 @@
103535 }
103536 }
103537 return target;
103538 }
103539 /* Otherwise, fall thru into the TK_COLUMN case */
 
103540 }
103541 case TK_COLUMN: {
103542 int iTab = pExpr->iTable;
103543 int iReg;
103544 if( ExprHasProperty(pExpr, EP_FixedCol) ){
@@ -104600,11 +104620,11 @@
104600 case TK_ISNOT:
104601 testcase( op==TK_IS );
104602 testcase( op==TK_ISNOT );
104603 op = (op==TK_IS) ? TK_EQ : TK_NE;
104604 jumpIfNull = SQLITE_NULLEQ;
104605 /* Fall thru */
104606 case TK_LT:
104607 case TK_LE:
104608 case TK_GT:
104609 case TK_GE:
104610 case TK_NE:
@@ -104776,11 +104796,11 @@
104776 case TK_ISNOT:
104777 testcase( pExpr->op==TK_IS );
104778 testcase( pExpr->op==TK_ISNOT );
104779 op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ;
104780 jumpIfNull = SQLITE_NULLEQ;
104781 /* Fall thru */
104782 case TK_LT:
104783 case TK_LE:
104784 case TK_GT:
104785 case TK_GE:
104786 case TK_NE:
@@ -105088,17 +105108,17 @@
105088 case TK_BITOR:
105089 case TK_LSHIFT:
105090 case TK_RSHIFT:
105091 case TK_CONCAT:
105092 seenNot = 1;
105093 /* Fall thru */
105094 case TK_STAR:
105095 case TK_REM:
105096 case TK_BITAND:
105097 case TK_SLASH: {
105098 if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
105099 /* Fall thru into the next case */
105100 }
105101 case TK_SPAN:
105102 case TK_COLLATE:
105103 case TK_UPLUS:
105104 case TK_UMINUS: {
@@ -105243,10 +105263,11 @@
105243 || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
105244 && IsVirtual(pRight->y.pTab))
105245 ){
105246 return WRC_Prune;
105247 }
 
105248 }
105249 default:
105250 return WRC_Continue;
105251 }
105252 }
@@ -120447,10 +120468,11 @@
120447 case OE_Cascade:
120448 if( !pChanges ){
120449 pStep->op = TK_DELETE;
120450 break;
120451 }
 
120452 default:
120453 pStep->op = TK_UPDATE;
120454 }
120455 pStep->pTrig = pTrigger;
120456 pTrigger->pSchema = pTab->pSchema;
@@ -122151,11 +122173,11 @@
122151 sqlite3VdbeJumpHere(v, addr1);
122152 break;
122153 }
122154 case OE_Abort:
122155 sqlite3MayAbort(pParse);
122156 /* Fall through */
122157 case OE_Rollback:
122158 case OE_Fail: {
122159 char *zMsg = sqlite3MPrintf(db, "%s.%s", pTab->zName,
122160 pCol->zName);
122161 sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT_NOTNULL,
@@ -122379,11 +122401,11 @@
122379 VdbeCoverage(v);
122380
122381 switch( onError ){
122382 default: {
122383 onError = OE_Abort;
122384 /* Fall thru into the next case */
122385 }
122386 case OE_Rollback:
122387 case OE_Abort:
122388 case OE_Fail: {
122389 testcase( onError==OE_Rollback );
@@ -122440,11 +122462,11 @@
122440 break;
122441 }
122442 #ifndef SQLITE_OMIT_UPSERT
122443 case OE_Update: {
122444 sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, 0, iDataCur);
122445 /* Fall through */
122446 }
122447 #endif
122448 case OE_Ignore: {
122449 testcase( onError==OE_Ignore );
122450 sqlite3VdbeGoto(v, ignoreDest);
@@ -122661,11 +122683,11 @@
122661 break;
122662 }
122663 #ifndef SQLITE_OMIT_UPSERT
122664 case OE_Update: {
122665 sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, pIdx, iIdxCur+ix);
122666 /* Fall through */
122667 }
122668 #endif
122669 case OE_Ignore: {
122670 testcase( onError==OE_Ignore );
122671 sqlite3VdbeGoto(v, ignoreDest);
@@ -133471,11 +133493,11 @@
133471 sqlite3AggInfoPersistWalkerInit(&w, pParse);
133472 sqlite3WalkSelect(&w,pSub1);
133473 sqlite3SelectDelete(db, pSub1);
133474
133475 #if SELECTTRACE_ENABLED
133476 if( sqlite3SelectTrace & 0x100 ){
133477 SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
133478 sqlite3TreeViewSelect(0, p, 0);
133479 }
133480 #endif
133481
@@ -134909,11 +134931,11 @@
134909 sWalker.pParse = pParse;
134910 sWalker.xExprCallback = havingToWhereExprCb;
134911 sWalker.u.pSelect = p;
134912 sqlite3WalkExpr(&sWalker, p->pHaving);
134913 #if SELECTTRACE_ENABLED
134914 if( sWalker.eCode && (sqlite3SelectTrace & 0x100)!=0 ){
134915 SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
134916 sqlite3TreeViewSelect(0, p, 0);
134917 }
134918 #endif
134919 }
@@ -135031,11 +135053,11 @@
135031 }
135032 p->pEList->a[0].pExpr = pExpr;
135033 p->selFlags &= ~SF_Aggregate;
135034
135035 #if SELECTTRACE_ENABLED
135036 if( sqlite3SelectTrace & 0x400 ){
135037 SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
135038 sqlite3TreeViewSelect(0, p, 0);
135039 }
135040 #endif
135041 return 1;
@@ -135084,11 +135106,11 @@
135084 return 1;
135085 }
135086 if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
135087 #if SELECTTRACE_ENABLED
135088 SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
135089 if( sqlite3SelectTrace & 0x100 ){
135090 sqlite3TreeViewSelect(0, p, 0);
135091 }
135092 #endif
135093
135094 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135111,11 +135133,11 @@
135111 if( pParse->nErr || db->mallocFailed ){
135112 goto select_end;
135113 }
135114 assert( p->pEList!=0 );
135115 #if SELECTTRACE_ENABLED
135116 if( sqlite3SelectTrace & 0x104 ){
135117 SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
135118 sqlite3TreeViewSelect(0, p, 0);
135119 }
135120 #endif
135121
@@ -135146,11 +135168,11 @@
135146 if( rc ){
135147 assert( db->mallocFailed || pParse->nErr>0 );
135148 goto select_end;
135149 }
135150 #if SELECTTRACE_ENABLED
135151 if( p->pWin && (sqlite3SelectTrace & 0x108)!=0 ){
135152 SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
135153 sqlite3TreeViewSelect(0, p, 0);
135154 }
135155 #endif
135156 #endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135253,11 +135275,11 @@
135253 */
135254 if( p->pPrior ){
135255 rc = multiSelect(pParse, p, pDest);
135256 #if SELECTTRACE_ENABLED
135257 SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
135258 if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135259 sqlite3TreeViewSelect(0, p, 0);
135260 }
135261 #endif
135262 if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
135263 return rc;
@@ -135272,11 +135294,11 @@
135272 if( pTabList->nSrc>1
135273 && OptimizationEnabled(db, SQLITE_PropagateConst)
135274 && propagateConstants(pParse, p)
135275 ){
135276 #if SELECTTRACE_ENABLED
135277 if( sqlite3SelectTrace & 0x100 ){
135278 SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
135279 sqlite3TreeViewSelect(0, p, 0);
135280 }
135281 #endif
135282 }else{
@@ -135360,11 +135382,11 @@
135360 if( OptimizationEnabled(db, SQLITE_PushDown)
135361 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
135362 (pItem->fg.jointype & JT_OUTER)!=0)
135363 ){
135364 #if SELECTTRACE_ENABLED
135365 if( sqlite3SelectTrace & 0x100 ){
135366 SELECTTRACE(0x100,pParse,p,
135367 ("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
135368 sqlite3TreeViewSelect(0, p, 0);
135369 }
135370 #endif
@@ -135460,11 +135482,11 @@
135460 pGroupBy = p->pGroupBy;
135461 pHaving = p->pHaving;
135462 sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
135463
135464 #if SELECTTRACE_ENABLED
135465 if( sqlite3SelectTrace & 0x400 ){
135466 SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
135467 sqlite3TreeViewSelect(0, p, 0);
135468 }
135469 #endif
135470
@@ -135496,11 +135518,11 @@
135496 ** the sDistinct.isTnct is still set. Hence, isTnct represents the
135497 ** original setting of the SF_Distinct flag, not the current setting */
135498 assert( sDistinct.isTnct );
135499
135500 #if SELECTTRACE_ENABLED
135501 if( sqlite3SelectTrace & 0x400 ){
135502 SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
135503 sqlite3TreeViewSelect(0, p, 0);
135504 }
135505 #endif
135506 }
@@ -135744,11 +135766,11 @@
135744 sNC.ncFlags &= ~NC_InAggFunc;
135745 }
135746 pAggInfo->mxReg = pParse->nMem;
135747 if( db->mallocFailed ) goto select_end;
135748 #if SELECTTRACE_ENABLED
135749 if( sqlite3SelectTrace & 0x400 ){
135750 int ii;
135751 SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
135752 sqlite3TreeViewSelect(0, p, 0);
135753 for(ii=0; ii<pAggInfo->nColumn; ii++){
135754 sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136163,11 +136185,11 @@
136163 }
136164 #endif
136165
136166 #if SELECTTRACE_ENABLED
136167 SELECTTRACE(0x1,pParse,p,("end processing\n"));
136168 if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136169 sqlite3TreeViewSelect(0, p, 0);
136170 }
136171 #endif
136172 ExplainQueryPlanPop(pParse);
136173 return rc;
@@ -151934,11 +151956,11 @@
151934 assert( pWin->pOwner==pExpr );
151935 return WRC_Prune;
151936 }
151937 }
151938 }
151939 /* Fall through. */
151940
151941 case TK_AGG_FUNCTION:
151942 case TK_COLUMN: {
151943 int iCol = -1;
151944 if( p->pSub ){
@@ -160151,10 +160173,11 @@
160151 *tokenType = TK_DOT;
160152 return 1;
160153 }
160154 /* If the next character is a digit, this is a floating point
160155 ** number that begins with ".". Fall thru into the next case */
 
160156 }
160157 case CC_DIGIT: {
160158 testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' );
160159 testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' );
160160 testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
@@ -160255,10 +160278,11 @@
160255 return i;
160256 }
160257 #endif
160258 /* If it is not a BLOB literal, then it must be an ID, since no
160259 ** SQL keywords start with the letter 'x'. Fall through */
 
160260 }
160261 case CC_ID: {
160262 i = 1;
160263 break;
160264 }
@@ -162185,11 +162209,11 @@
162185 if( !sqlite3SafetyCheckSickOrOk(db) ){
162186 return SQLITE_MISUSE_BKPT;
162187 }
162188 sqlite3_mutex_enter(db->mutex);
162189 if( db->mTrace & SQLITE_TRACE_CLOSE ){
162190 db->xTrace(SQLITE_TRACE_CLOSE, db->pTraceArg, db, 0);
162191 }
162192
162193 /* Force xDisconnect calls on all virtual tables */
162194 disconnectAllVtab(db);
162195
@@ -163074,11 +163098,11 @@
163074 }
163075 #endif
163076 sqlite3_mutex_enter(db->mutex);
163077 pOld = db->pTraceArg;
163078 db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0;
163079 db->xTrace = (int(*)(u32,void*,void*,void*))xTrace;
163080 db->pTraceArg = pArg;
163081 sqlite3_mutex_leave(db->mutex);
163082 return pOld;
163083 }
163084 #endif /* SQLITE_OMIT_DEPRECATED */
@@ -163098,11 +163122,11 @@
163098 #endif
163099 sqlite3_mutex_enter(db->mutex);
163100 if( mTrace==0 ) xTrace = 0;
163101 if( xTrace==0 ) mTrace = 0;
163102 db->mTrace = mTrace;
163103 db->xTrace = xTrace;
163104 db->pTraceArg = pArg;
163105 sqlite3_mutex_leave(db->mutex);
163106 return SQLITE_OK;
163107 }
163108
@@ -166694,10 +166718,12 @@
166694 # define TESTONLY(X)
166695 #endif
166696
166697 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
166698 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
 
 
166699
166700 #endif /* SQLITE_AMALGAMATION */
166701
166702 #ifdef SQLITE_DEBUG
166703 SQLITE_PRIVATE int sqlite3Fts3Corrupt(void);
@@ -170337,11 +170363,11 @@
170337 }else if( p->zLanguageid==0 ){
170338 sqlite3_result_int(pCtx, 0);
170339 break;
170340 }else{
170341 iCol = p->nColumn;
170342 /* fall-through */
170343 }
170344
170345 default:
170346 /* A user column. Or, if this is a full-table scan, possibly the
170347 ** language-id column. Seek the cursor. */
@@ -170580,13 +170606,17 @@
170580 }
170581 if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return;
170582
170583 switch( nVal ){
170584 case 6: nToken = sqlite3_value_int(apVal[5]);
 
170585 case 5: iCol = sqlite3_value_int(apVal[4]);
 
170586 case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
 
170587 case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
 
170588 case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
170589 }
170590 if( !zEllipsis || !zEnd || !zStart ){
170591 sqlite3_result_error_nomem(pContext);
170592 }else if( nToken==0 ){
@@ -185444,10 +185474,14 @@
185444 #ifndef LARGEST_INT64
185445 # define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
185446 # define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64)
185447 #endif
185448
 
 
 
 
185449 /*
185450 ** Versions of isspace(), isalnum() and isdigit() to which it is safe
185451 ** to pass signed char values.
185452 */
185453 #ifdef sqlite3Isdigit
@@ -185862,11 +185896,11 @@
185862 case JSON_STRING: {
185863 if( pNode->jnFlags & JNODE_RAW ){
185864 jsonAppendString(pOut, pNode->u.zJContent, pNode->n);
185865 break;
185866 }
185867 /* Fall through into the next case */
185868 }
185869 case JSON_REAL:
185870 case JSON_INT: {
185871 jsonAppendRaw(pOut, pNode->u.zJContent, pNode->n);
185872 break;
@@ -186003,11 +186037,11 @@
186003 }
186004 if( pNode->u.zJContent[0]=='-' ){ i = -i; }
186005 sqlite3_result_int64(pCtx, i);
186006 int_done:
186007 break;
186008 int_as_real: /* fall through to real */;
186009 }
186010 case JSON_REAL: {
186011 double r;
186012 #ifdef SQLITE_AMALGAMATION
186013 const char *z = pNode->u.zJContent;
@@ -187706,10 +187740,11 @@
187706 jsonResult(&x);
187707 break;
187708 }
187709 /* For json_each() path and root are the same so fall through
187710 ** into the root case */
 
187711 }
187712 default: {
187713 const char *zRoot = p->zRoot;
187714 if( zRoot==0 ) zRoot = "$";
187715 sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);
@@ -225692,11 +225727,11 @@
225692 int nArg, /* Number of args */
225693 sqlite3_value **apUnused /* Function arguments */
225694 ){
225695 assert( nArg==0 );
225696 UNUSED_PARAM2(nArg, apUnused);
225697 sqlite3_result_text(pCtx, "fts5: 2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214", -1, SQLITE_TRANSIENT);
225698 }
225699
225700 /*
225701 ** Return true if zName is the extension on one of the shadow tables used
225702 ** by this module.
@@ -230475,12 +230510,12 @@
230475 }
230476 #endif /* SQLITE_CORE */
230477 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230478
230479 /************** End of stmt.c ************************************************/
230480 #if __LINE__!=230480
230481 #undef SQLITE_SOURCE_ID
230482 #define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635alt2"
230483 #endif
230484 /* Return the source-id for this library */
230485 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230486 /************************** End of sqlite3.c ******************************/
230487
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -997,10 +997,19 @@
997
998 #if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
999 # define _BSD_SOURCE
1000 #endif
1001
1002 /*
1003 ** Macro to disable warnings about missing "break" at the end of a "case".
1004 */
1005 #if GCC_VERSION>=7000000
1006 # define deliberate_fall_through __attribute__((fallthrough));
1007 #else
1008 # define deliberate_fall_through
1009 #endif
1010
1011 /*
1012 ** For MinGW, check to see if we can include the header file containing its
1013 ** version information, among other things. Normally, this internal MinGW
1014 ** header file would [only] be included automatically by other MinGW header
1015 ** files; however, the contained version information is now required by this
@@ -1162,11 +1171,11 @@
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.33.0"
1175 #define SQLITE_VERSION_NUMBER 3033000
1176 #define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -14532,11 +14541,11 @@
14541 # define SELECTTRACE_ENABLED 0
14542 #endif
14543 #if defined(SQLITE_ENABLE_SELECTTRACE)
14544 # define SELECTTRACE_ENABLED 1
14545 # define SELECTTRACE(K,P,S,X) \
14546 if(sqlite3_unsupported_selecttrace&(K)) \
14547 sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
14548 sqlite3DebugPrintf X
14549 #else
14550 # define SELECTTRACE(K,P,S,X)
14551 # define SELECTTRACE_ENABLED 0
@@ -14595,11 +14604,11 @@
14604 ** one parameter that destructors normally want. So we have to introduce
14605 ** this magic value that the code knows to handle differently. Any
14606 ** pointer will work here as long as it is distinct from SQLITE_STATIC
14607 ** and SQLITE_TRANSIENT.
14608 */
14609 #define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3OomFault)
14610
14611 /*
14612 ** When SQLITE_OMIT_WSD is defined, it means that the target platform does
14613 ** not support Writable Static Data (WSD) such as global and static variables.
14614 ** All variables must either be on the stack or dynamically allocated from
@@ -16858,11 +16867,14 @@
16867 int nVdbeWrite; /* Number of active VDBEs that read and write */
16868 int nVdbeExec; /* Number of nested calls to VdbeExec() */
16869 int nVDestroy; /* Number of active OP_VDestroy operations */
16870 int nExtension; /* Number of loaded extensions */
16871 void **aExtension; /* Array of shared library handles */
16872 union {
16873 void (*xLegacy)(void*,const char*); /* Legacy trace function */
16874 int (*xV2)(u32,void*,void*,void*); /* V2 Trace function */
16875 } trace;
16876 void *pTraceArg; /* Argument to the trace function */
16877 #ifndef SQLITE_OMIT_DEPRECATED
16878 void (*xProfile)(void*,const char*,u64); /* Profiling function */
16879 void *pProfileArg; /* Argument to profile function */
16880 #endif
@@ -19947,11 +19959,11 @@
19959 SQLITE_PRIVATE const char sqlite3StrBINARY[];
19960 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
19961 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
19962 SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
19963 SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
19964 SQLITE_API extern u32 sqlite3_unsupported_selecttrace;
19965 #ifndef SQLITE_OMIT_WSD
19966 SQLITE_PRIVATE int sqlite3PendingByte;
19967 #endif
19968 #endif /* SQLITE_AMALGAMATION */
19969 #ifdef VDBE_PROFILE
@@ -20664,11 +20676,11 @@
20676 #endif
20677
20678 /*
20679 ** Flags for select tracing and the ".selecttrace" macro of the CLI
20680 */
20681 SQLITE_API u32 sqlite3_unsupported_selecttrace = 0;
20682
20683 /* #include "opcodes.h" */
20684 /*
20685 ** Properties of opcodes. The OPFLG_INITIALIZER macro is
20686 ** created by mkopcodeh.awk during compilation. Data is obtained
@@ -21663,11 +21675,11 @@
21675 ** pagers the database handle is connected to. *pHighwater is always set
21676 ** to zero.
21677 */
21678 case SQLITE_DBSTATUS_CACHE_SPILL:
21679 op = SQLITE_DBSTATUS_CACHE_WRITE+1;
21680 /* no break */ deliberate_fall_through
21681 case SQLITE_DBSTATUS_CACHE_HIT:
21682 case SQLITE_DBSTATUS_CACHE_MISS:
21683 case SQLITE_DBSTATUS_CACHE_WRITE:{
21684 int i;
21685 int nRet = 0;
@@ -28540,15 +28552,15 @@
28552 assert( precision>=(-1) );
28553 switch( xtype ){
28554 case etPOINTER:
28555 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
28556 sizeof(char*)==sizeof(long int) ? 1 : 0;
28557 /* no break */ deliberate_fall_through
28558 case etORDINAL:
28559 case etRADIX:
28560 cThousand = 0;
28561 /* no break */ deliberate_fall_through
28562 case etDECIMAL:
28563 if( infop->flags & FLAG_SIGNED ){
28564 i64 v;
28565 if( bArgList ){
28566 v = getIntArg(pArgList);
@@ -54193,16 +54205,17 @@
54205
54206 /* Allocate space for both the pJournal and pSuper file descriptors.
54207 ** If successful, open the super-journal file for reading.
54208 */
54209 pSuper = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
 
54210 if( !pSuper ){
54211 rc = SQLITE_NOMEM_BKPT;
54212 pJournal = 0;
54213 }else{
54214 const int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_SUPER_JOURNAL);
54215 rc = sqlite3OsOpen(pVfs, zSuper, pSuper, flags, 0);
54216 pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
54217 }
54218 if( rc!=SQLITE_OK ) goto delsuper_out;
54219
54220 /* Load the entire super-journal file into space obtained from
54221 ** sqlite3_malloc() and pointed to by zSuperJournal. Also obtain
@@ -78537,11 +78550,11 @@
78550 /* NOTE: Be sure to update mkopcodeh.tcl when adding or removing
78551 ** cases from this switch! */
78552 switch( pOp->opcode ){
78553 case OP_Transaction: {
78554 if( pOp->p2!=0 ) p->readOnly = 0;
78555 /* no break */ deliberate_fall_through
78556 }
78557 case OP_AutoCommit:
78558 case OP_Savepoint: {
78559 p->bIsReader = 1;
78560 break;
@@ -78584,10 +78597,11 @@
78597 assert( (pOp - p->aOp) >= 3 );
78598 assert( pOp[-1].opcode==OP_Integer );
78599 n = pOp[-1].p1;
78600 if( n>nMaxArgs ) nMaxArgs = n;
78601 /* Fall through into the default case */
78602 /* no break */ deliberate_fall_through
78603 }
78604 #endif
78605 default: {
78606 if( pOp->p2<0 ){
78607 /* The mkopcodeh.tcl script has so arranged things that the only
@@ -83050,11 +83064,11 @@
83064 if( db->xProfile ){
83065 db->xProfile(db->pProfileArg, p->zSql, iElapse);
83066 }
83067 #endif
83068 if( db->mTrace & SQLITE_TRACE_PROFILE ){
83069 db->trace.xV2(SQLITE_TRACE_PROFILE, db->pTraceArg, p, (void*)&iElapse);
83070 }
83071 p->startTime = 0;
83072 }
83073 /*
83074 ** The checkProfileCallback(DB,P) macro checks to see if a profile callback
@@ -86350,10 +86364,11 @@
86364 #ifdef SQLITE_DEBUG
86365 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
86366 #endif
86367 if( (pIn3->flags & MEM_Null)==0 ) break;
86368 /* Fall through into OP_Halt */
86369 /* no break */ deliberate_fall_through
86370 }
86371
86372 /* Opcode: Halt P1 P2 * P4 P5
86373 **
86374 ** Exit immediately. All open cursors, etc are closed
@@ -86520,10 +86535,11 @@
86535 goto too_big;
86536 }
86537 pOp->opcode = OP_String;
86538 assert( rc==SQLITE_OK );
86539 /* Fall through to the next case, OP_String */
86540 /* no break */ deliberate_fall_through
86541 }
86542
86543 /* Opcode: String P1 P2 P3 P4 P5
86544 ** Synopsis: r[P2]='P4' (len=P1)
86545 **
@@ -86831,11 +86847,11 @@
86847 #endif
86848 }
86849 if( db->mallocFailed ) goto no_mem;
86850
86851 if( db->mTrace & SQLITE_TRACE_ROW ){
86852 db->trace.xV2(SQLITE_TRACE_ROW, db->pTraceArg, p, 0);
86853 }
86854
86855
86856 /* Return SQLITE_ROW
86857 */
@@ -89824,10 +89840,11 @@
89840 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
89841 pC = p->apCsr[pOp->p1];
89842 assert( pC!=0 );
89843 if( pC->seekHit ) break;
89844 /* Fall through into OP_NotFound */
89845 /* no break */ deliberate_fall_through
89846 }
89847 case OP_NoConflict: /* jump, in3 */
89848 case OP_NotFound: /* jump, in3 */
89849 case OP_Found: { /* jump, in3 */
89850 int alreadyExists;
@@ -89978,10 +89995,11 @@
89995 if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
89996 iKey = x.u.i;
89997 goto notExistsWithKey;
89998 }
89999 /* Fall through into OP_NotExists */
90000 /* no break */ deliberate_fall_through
90001 case OP_NotExists: /* jump, in3 */
90002 pIn3 = &aMem[pOp->p3];
90003 assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
90004 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
90005 iKey = pIn3->u.i;
@@ -90749,10 +90767,11 @@
90767 sqlite3_sort_count++;
90768 sqlite3_search_count--;
90769 #endif
90770 p->aCounter[SQLITE_STMTSTATUS_SORT]++;
90771 /* Fall through into OP_Rewind */
90772 /* no break */ deliberate_fall_through
90773 }
90774 /* Opcode: Rewind P1 P2 * * *
90775 **
90776 ** The next use of the Rowid or Column or Next instruction for P1
90777 ** will refer to the first entry in the database table or index.
@@ -92102,10 +92121,11 @@
92121 /* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */
92122 assert( pOp->p1==(pOp->opcode==OP_AggInverse) );
92123
92124 pOp->opcode = OP_AggStep1;
92125 /* Fall through into OP_AggStep */
92126 /* no break */ deliberate_fall_through
92127 }
92128 case OP_AggStep1: {
92129 int i;
92130 sqlite3_context *pCtx;
92131 Mem *pMem;
@@ -93091,22 +93111,21 @@
93111 && !p->doingRerun
93112 && (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
93113 ){
93114 #ifndef SQLITE_OMIT_DEPRECATED
93115 if( db->mTrace & SQLITE_TRACE_LEGACY ){
 
93116 char *z = sqlite3VdbeExpandSql(p, zTrace);
93117 db->trace.xLegacy(db->pTraceArg, z);
93118 sqlite3_free(z);
93119 }else
93120 #endif
93121 if( db->nVdbeExec>1 ){
93122 char *z = sqlite3MPrintf(db, "-- %s", zTrace);
93123 (void)db->trace.xV2(SQLITE_TRACE_STMT, db->pTraceArg, p, z);
93124 sqlite3DbFree(db, z);
93125 }else{
93126 (void)db->trace.xV2(SQLITE_TRACE_STMT, db->pTraceArg, p, zTrace);
93127 }
93128 }
93129 #ifdef SQLITE_USE_FCNTL_TRACE
93130 zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql);
93131 if( zTrace ){
@@ -98824,11 +98843,11 @@
98843 pExpr->op2 = pExpr->op;
98844 pExpr->op = TK_TRUTH;
98845 return WRC_Continue;
98846 }
98847 }
98848 /* no break */ deliberate_fall_through
98849 }
98850 case TK_BETWEEN:
98851 case TK_EQ:
98852 case TK_NE:
98853 case TK_LT:
@@ -101728,11 +101747,11 @@
101747 /* Convert "true" or "false" in a DEFAULT clause into the
101748 ** appropriate TK_TRUEFALSE operator */
101749 if( sqlite3ExprIdToTrueFalse(pExpr) ){
101750 return WRC_Prune;
101751 }
101752 /* no break */ deliberate_fall_through
101753 case TK_COLUMN:
101754 case TK_AGG_FUNCTION:
101755 case TK_AGG_COLUMN:
101756 testcase( pExpr->op==TK_ID );
101757 testcase( pExpr->op==TK_COLUMN );
@@ -101742,11 +101761,11 @@
101761 return WRC_Continue;
101762 }
101763 if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){
101764 return WRC_Continue;
101765 }
101766 /* no break */ deliberate_fall_through
101767 case TK_IF_NULL_ROW:
101768 case TK_REGISTER:
101769 case TK_DOT:
101770 testcase( pExpr->op==TK_REGISTER );
101771 testcase( pExpr->op==TK_IF_NULL_ROW );
@@ -101763,11 +101782,11 @@
101782 /* A bound parameter in a CREATE statement that originates from
101783 ** sqlite3_prepare() causes an error */
101784 pWalker->eCode = 0;
101785 return WRC_Abort;
101786 }
101787 /* no break */ deliberate_fall_through
101788 default:
101789 testcase( pExpr->op==TK_SELECT ); /* sqlite3SelectWalkFail() disallows */
101790 testcase( pExpr->op==TK_EXISTS ); /* sqlite3SelectWalkFail() disallows */
101791 return WRC_Continue;
101792 }
@@ -103535,10 +103554,11 @@
103554 }
103555 }
103556 return target;
103557 }
103558 /* Otherwise, fall thru into the TK_COLUMN case */
103559 /* no break */ deliberate_fall_through
103560 }
103561 case TK_COLUMN: {
103562 int iTab = pExpr->iTable;
103563 int iReg;
103564 if( ExprHasProperty(pExpr, EP_FixedCol) ){
@@ -104600,11 +104620,11 @@
104620 case TK_ISNOT:
104621 testcase( op==TK_IS );
104622 testcase( op==TK_ISNOT );
104623 op = (op==TK_IS) ? TK_EQ : TK_NE;
104624 jumpIfNull = SQLITE_NULLEQ;
104625 /* no break */ deliberate_fall_through
104626 case TK_LT:
104627 case TK_LE:
104628 case TK_GT:
104629 case TK_GE:
104630 case TK_NE:
@@ -104776,11 +104796,11 @@
104796 case TK_ISNOT:
104797 testcase( pExpr->op==TK_IS );
104798 testcase( pExpr->op==TK_ISNOT );
104799 op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ;
104800 jumpIfNull = SQLITE_NULLEQ;
104801 /* no break */ deliberate_fall_through
104802 case TK_LT:
104803 case TK_LE:
104804 case TK_GT:
104805 case TK_GE:
104806 case TK_NE:
@@ -105088,17 +105108,17 @@
105108 case TK_BITOR:
105109 case TK_LSHIFT:
105110 case TK_RSHIFT:
105111 case TK_CONCAT:
105112 seenNot = 1;
105113 /* no break */ deliberate_fall_through
105114 case TK_STAR:
105115 case TK_REM:
105116 case TK_BITAND:
105117 case TK_SLASH: {
105118 if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
105119 /* no break */ deliberate_fall_through
105120 }
105121 case TK_SPAN:
105122 case TK_COLLATE:
105123 case TK_UPLUS:
105124 case TK_UMINUS: {
@@ -105243,10 +105263,11 @@
105263 || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
105264 && IsVirtual(pRight->y.pTab))
105265 ){
105266 return WRC_Prune;
105267 }
105268 /* no break */ deliberate_fall_through
105269 }
105270 default:
105271 return WRC_Continue;
105272 }
105273 }
@@ -120447,10 +120468,11 @@
120468 case OE_Cascade:
120469 if( !pChanges ){
120470 pStep->op = TK_DELETE;
120471 break;
120472 }
120473 /* no break */ deliberate_fall_through
120474 default:
120475 pStep->op = TK_UPDATE;
120476 }
120477 pStep->pTrig = pTrigger;
120478 pTrigger->pSchema = pTab->pSchema;
@@ -122151,11 +122173,11 @@
122173 sqlite3VdbeJumpHere(v, addr1);
122174 break;
122175 }
122176 case OE_Abort:
122177 sqlite3MayAbort(pParse);
122178 /* no break */ deliberate_fall_through
122179 case OE_Rollback:
122180 case OE_Fail: {
122181 char *zMsg = sqlite3MPrintf(db, "%s.%s", pTab->zName,
122182 pCol->zName);
122183 sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT_NOTNULL,
@@ -122379,11 +122401,11 @@
122401 VdbeCoverage(v);
122402
122403 switch( onError ){
122404 default: {
122405 onError = OE_Abort;
122406 /* no break */ deliberate_fall_through
122407 }
122408 case OE_Rollback:
122409 case OE_Abort:
122410 case OE_Fail: {
122411 testcase( onError==OE_Rollback );
@@ -122440,11 +122462,11 @@
122462 break;
122463 }
122464 #ifndef SQLITE_OMIT_UPSERT
122465 case OE_Update: {
122466 sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, 0, iDataCur);
122467 /* no break */ deliberate_fall_through
122468 }
122469 #endif
122470 case OE_Ignore: {
122471 testcase( onError==OE_Ignore );
122472 sqlite3VdbeGoto(v, ignoreDest);
@@ -122661,11 +122683,11 @@
122683 break;
122684 }
122685 #ifndef SQLITE_OMIT_UPSERT
122686 case OE_Update: {
122687 sqlite3UpsertDoUpdate(pParse, pUpsert, pTab, pIdx, iIdxCur+ix);
122688 /* no break */ deliberate_fall_through
122689 }
122690 #endif
122691 case OE_Ignore: {
122692 testcase( onError==OE_Ignore );
122693 sqlite3VdbeGoto(v, ignoreDest);
@@ -133471,11 +133493,11 @@
133493 sqlite3AggInfoPersistWalkerInit(&w, pParse);
133494 sqlite3WalkSelect(&w,pSub1);
133495 sqlite3SelectDelete(db, pSub1);
133496
133497 #if SELECTTRACE_ENABLED
133498 if( sqlite3_unsupported_selecttrace & 0x100 ){
133499 SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
133500 sqlite3TreeViewSelect(0, p, 0);
133501 }
133502 #endif
133503
@@ -134909,11 +134931,11 @@
134931 sWalker.pParse = pParse;
134932 sWalker.xExprCallback = havingToWhereExprCb;
134933 sWalker.u.pSelect = p;
134934 sqlite3WalkExpr(&sWalker, p->pHaving);
134935 #if SELECTTRACE_ENABLED
134936 if( sWalker.eCode && (sqlite3_unsupported_selecttrace & 0x100)!=0 ){
134937 SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
134938 sqlite3TreeViewSelect(0, p, 0);
134939 }
134940 #endif
134941 }
@@ -135031,11 +135053,11 @@
135053 }
135054 p->pEList->a[0].pExpr = pExpr;
135055 p->selFlags &= ~SF_Aggregate;
135056
135057 #if SELECTTRACE_ENABLED
135058 if( sqlite3_unsupported_selecttrace & 0x400 ){
135059 SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
135060 sqlite3TreeViewSelect(0, p, 0);
135061 }
135062 #endif
135063 return 1;
@@ -135084,11 +135106,11 @@
135106 return 1;
135107 }
135108 if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
135109 #if SELECTTRACE_ENABLED
135110 SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
135111 if( sqlite3_unsupported_selecttrace & 0x100 ){
135112 sqlite3TreeViewSelect(0, p, 0);
135113 }
135114 #endif
135115
135116 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135111,11 +135133,11 @@
135133 if( pParse->nErr || db->mallocFailed ){
135134 goto select_end;
135135 }
135136 assert( p->pEList!=0 );
135137 #if SELECTTRACE_ENABLED
135138 if( sqlite3_unsupported_selecttrace & 0x104 ){
135139 SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
135140 sqlite3TreeViewSelect(0, p, 0);
135141 }
135142 #endif
135143
@@ -135146,11 +135168,11 @@
135168 if( rc ){
135169 assert( db->mallocFailed || pParse->nErr>0 );
135170 goto select_end;
135171 }
135172 #if SELECTTRACE_ENABLED
135173 if( p->pWin && (sqlite3_unsupported_selecttrace & 0x108)!=0 ){
135174 SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
135175 sqlite3TreeViewSelect(0, p, 0);
135176 }
135177 #endif
135178 #endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135253,11 +135275,11 @@
135275 */
135276 if( p->pPrior ){
135277 rc = multiSelect(pParse, p, pDest);
135278 #if SELECTTRACE_ENABLED
135279 SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
135280 if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135281 sqlite3TreeViewSelect(0, p, 0);
135282 }
135283 #endif
135284 if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
135285 return rc;
@@ -135272,11 +135294,11 @@
135294 if( pTabList->nSrc>1
135295 && OptimizationEnabled(db, SQLITE_PropagateConst)
135296 && propagateConstants(pParse, p)
135297 ){
135298 #if SELECTTRACE_ENABLED
135299 if( sqlite3_unsupported_selecttrace & 0x100 ){
135300 SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
135301 sqlite3TreeViewSelect(0, p, 0);
135302 }
135303 #endif
135304 }else{
@@ -135360,11 +135382,11 @@
135382 if( OptimizationEnabled(db, SQLITE_PushDown)
135383 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
135384 (pItem->fg.jointype & JT_OUTER)!=0)
135385 ){
135386 #if SELECTTRACE_ENABLED
135387 if( sqlite3_unsupported_selecttrace & 0x100 ){
135388 SELECTTRACE(0x100,pParse,p,
135389 ("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
135390 sqlite3TreeViewSelect(0, p, 0);
135391 }
135392 #endif
@@ -135460,11 +135482,11 @@
135482 pGroupBy = p->pGroupBy;
135483 pHaving = p->pHaving;
135484 sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
135485
135486 #if SELECTTRACE_ENABLED
135487 if( sqlite3_unsupported_selecttrace & 0x400 ){
135488 SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
135489 sqlite3TreeViewSelect(0, p, 0);
135490 }
135491 #endif
135492
@@ -135496,11 +135518,11 @@
135518 ** the sDistinct.isTnct is still set. Hence, isTnct represents the
135519 ** original setting of the SF_Distinct flag, not the current setting */
135520 assert( sDistinct.isTnct );
135521
135522 #if SELECTTRACE_ENABLED
135523 if( sqlite3_unsupported_selecttrace & 0x400 ){
135524 SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
135525 sqlite3TreeViewSelect(0, p, 0);
135526 }
135527 #endif
135528 }
@@ -135744,11 +135766,11 @@
135766 sNC.ncFlags &= ~NC_InAggFunc;
135767 }
135768 pAggInfo->mxReg = pParse->nMem;
135769 if( db->mallocFailed ) goto select_end;
135770 #if SELECTTRACE_ENABLED
135771 if( sqlite3_unsupported_selecttrace & 0x400 ){
135772 int ii;
135773 SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
135774 sqlite3TreeViewSelect(0, p, 0);
135775 for(ii=0; ii<pAggInfo->nColumn; ii++){
135776 sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136163,11 +136185,11 @@
136185 }
136186 #endif
136187
136188 #if SELECTTRACE_ENABLED
136189 SELECTTRACE(0x1,pParse,p,("end processing\n"));
136190 if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136191 sqlite3TreeViewSelect(0, p, 0);
136192 }
136193 #endif
136194 ExplainQueryPlanPop(pParse);
136195 return rc;
@@ -151934,11 +151956,11 @@
151956 assert( pWin->pOwner==pExpr );
151957 return WRC_Prune;
151958 }
151959 }
151960 }
151961 /* no break */ deliberate_fall_through
151962
151963 case TK_AGG_FUNCTION:
151964 case TK_COLUMN: {
151965 int iCol = -1;
151966 if( p->pSub ){
@@ -160151,10 +160173,11 @@
160173 *tokenType = TK_DOT;
160174 return 1;
160175 }
160176 /* If the next character is a digit, this is a floating point
160177 ** number that begins with ".". Fall thru into the next case */
160178 /* no break */ deliberate_fall_through
160179 }
160180 case CC_DIGIT: {
160181 testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' );
160182 testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' );
160183 testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
@@ -160255,10 +160278,11 @@
160278 return i;
160279 }
160280 #endif
160281 /* If it is not a BLOB literal, then it must be an ID, since no
160282 ** SQL keywords start with the letter 'x'. Fall through */
160283 /* no break */ deliberate_fall_through
160284 }
160285 case CC_ID: {
160286 i = 1;
160287 break;
160288 }
@@ -162185,11 +162209,11 @@
162209 if( !sqlite3SafetyCheckSickOrOk(db) ){
162210 return SQLITE_MISUSE_BKPT;
162211 }
162212 sqlite3_mutex_enter(db->mutex);
162213 if( db->mTrace & SQLITE_TRACE_CLOSE ){
162214 db->trace.xV2(SQLITE_TRACE_CLOSE, db->pTraceArg, db, 0);
162215 }
162216
162217 /* Force xDisconnect calls on all virtual tables */
162218 disconnectAllVtab(db);
162219
@@ -163074,11 +163098,11 @@
163098 }
163099 #endif
163100 sqlite3_mutex_enter(db->mutex);
163101 pOld = db->pTraceArg;
163102 db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0;
163103 db->trace.xLegacy = xTrace;
163104 db->pTraceArg = pArg;
163105 sqlite3_mutex_leave(db->mutex);
163106 return pOld;
163107 }
163108 #endif /* SQLITE_OMIT_DEPRECATED */
@@ -163098,11 +163122,11 @@
163122 #endif
163123 sqlite3_mutex_enter(db->mutex);
163124 if( mTrace==0 ) xTrace = 0;
163125 if( xTrace==0 ) mTrace = 0;
163126 db->mTrace = mTrace;
163127 db->trace.xV2 = xTrace;
163128 db->pTraceArg = pArg;
163129 sqlite3_mutex_leave(db->mutex);
163130 return SQLITE_OK;
163131 }
163132
@@ -166694,10 +166718,12 @@
166718 # define TESTONLY(X)
166719 #endif
166720
166721 #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
166722 #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
166723
166724 #define deliberate_fall_through
166725
166726 #endif /* SQLITE_AMALGAMATION */
166727
166728 #ifdef SQLITE_DEBUG
166729 SQLITE_PRIVATE int sqlite3Fts3Corrupt(void);
@@ -170337,11 +170363,11 @@
170363 }else if( p->zLanguageid==0 ){
170364 sqlite3_result_int(pCtx, 0);
170365 break;
170366 }else{
170367 iCol = p->nColumn;
170368 /* no break */ deliberate_fall_through
170369 }
170370
170371 default:
170372 /* A user column. Or, if this is a full-table scan, possibly the
170373 ** language-id column. Seek the cursor. */
@@ -170580,13 +170606,17 @@
170606 }
170607 if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return;
170608
170609 switch( nVal ){
170610 case 6: nToken = sqlite3_value_int(apVal[5]);
170611 /* no break */ deliberate_fall_through
170612 case 5: iCol = sqlite3_value_int(apVal[4]);
170613 /* no break */ deliberate_fall_through
170614 case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
170615 /* no break */ deliberate_fall_through
170616 case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
170617 /* no break */ deliberate_fall_through
170618 case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
170619 }
170620 if( !zEllipsis || !zEnd || !zStart ){
170621 sqlite3_result_error_nomem(pContext);
170622 }else if( nToken==0 ){
@@ -185444,10 +185474,14 @@
185474 #ifndef LARGEST_INT64
185475 # define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
185476 # define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64)
185477 #endif
185478
185479 #ifndef deliberate_fall_through
185480 # define deliberate_fall_through
185481 #endif
185482
185483 /*
185484 ** Versions of isspace(), isalnum() and isdigit() to which it is safe
185485 ** to pass signed char values.
185486 */
185487 #ifdef sqlite3Isdigit
@@ -185862,11 +185896,11 @@
185896 case JSON_STRING: {
185897 if( pNode->jnFlags & JNODE_RAW ){
185898 jsonAppendString(pOut, pNode->u.zJContent, pNode->n);
185899 break;
185900 }
185901 /* no break */ deliberate_fall_through
185902 }
185903 case JSON_REAL:
185904 case JSON_INT: {
185905 jsonAppendRaw(pOut, pNode->u.zJContent, pNode->n);
185906 break;
@@ -186003,11 +186037,11 @@
186037 }
186038 if( pNode->u.zJContent[0]=='-' ){ i = -i; }
186039 sqlite3_result_int64(pCtx, i);
186040 int_done:
186041 break;
186042 int_as_real: i=0; /* no break */ deliberate_fall_through
186043 }
186044 case JSON_REAL: {
186045 double r;
186046 #ifdef SQLITE_AMALGAMATION
186047 const char *z = pNode->u.zJContent;
@@ -187706,10 +187740,11 @@
187740 jsonResult(&x);
187741 break;
187742 }
187743 /* For json_each() path and root are the same so fall through
187744 ** into the root case */
187745 /* no break */ deliberate_fall_through
187746 }
187747 default: {
187748 const char *zRoot = p->zRoot;
187749 if( zRoot==0 ) zRoot = "$";
187750 sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);
@@ -225692,11 +225727,11 @@
225727 int nArg, /* Number of args */
225728 sqlite3_value **apUnused /* Function arguments */
225729 ){
225730 assert( nArg==0 );
225731 UNUSED_PARAM2(nArg, apUnused);
225732 sqlite3_result_text(pCtx, "fts5: 2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f", -1, SQLITE_TRANSIENT);
225733 }
225734
225735 /*
225736 ** Return true if zName is the extension on one of the shadow tables used
225737 ** by this module.
@@ -230475,12 +230510,12 @@
230510 }
230511 #endif /* SQLITE_CORE */
230512 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230513
230514 /************** End of stmt.c ************************************************/
230515 #if __LINE__!=230515
230516 #undef SQLITE_SOURCE_ID
230517 #define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff7alt2"
230518 #endif
230519 /* Return the source-id for this library */
230520 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230521 /************************** End of sqlite3.c ******************************/
230522
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.33.0"
127127
#define SQLITE_VERSION_NUMBER 3033000
128
-#define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635241d"
128
+#define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-08-08 00:44:45 eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635241d"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-08-10 19:35:01 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134

Keyboard Shortcuts

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