Fossil SCM

Increase the version number to 2.14 to begin the next release cycle. Update the built-in SQLite to the latest 3.34.0 alpha for testing.

drh 2020-11-01 00:30 trunk
Commit e9b5a983cc8014939af1722451be96e5a009bd9d91c2b6da3b9934a822ed1148
+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-2.13
1
+2.14
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.13
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.14
2
+7 -4
--- src/shell.c
+++ src/shell.c
@@ -20717,10 +20717,11 @@
2071720717
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
2071820718
" -sorterref SIZE sorter references threshold size\n"
2071920719
#endif
2072020720
" -stats print memory stats before each finalize\n"
2072120721
" -table set output mode to 'table'\n"
20722
+ " -tabs set output mode to 'tabs'\n"
2072220723
" -version show SQLite version\n"
2072320724
" -vfs NAME use NAME as the default VFS\n"
2072420725
#ifdef SQLITE_ENABLE_VFSTRACE
2072520726
" -vfstrace enable tracing of all VFS calls\n"
2072620727
#endif
@@ -21152,14 +21153,16 @@
2115221153
data.openMode = SHELL_OPEN_READONLY;
2115321154
}else if( strcmp(z,"-nofollow")==0 ){
2115421155
data.openFlags |= SQLITE_OPEN_NOFOLLOW;
2115521156
}else if( strcmp(z,"-ascii")==0 ){
2115621157
data.mode = MODE_Ascii;
21157
- sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
21158
- SEP_Unit);
21159
- sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
21160
- SEP_Record);
21158
+ sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, SEP_Unit);
21159
+ sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, SEP_Record);
21160
+ }else if( strcmp(z,"-tabs")==0 ){
21161
+ data.mode = MODE_List;
21162
+ sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, SEP_Tab);
21163
+ sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, SEP_Row);
2116121164
}else if( strcmp(z,"-separator")==0 ){
2116221165
sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
2116321166
"%s",cmdline_option_value(argc,argv,++i));
2116421167
}else if( strcmp(z,"-newline")==0 ){
2116521168
sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
2116621169
--- src/shell.c
+++ src/shell.c
@@ -20717,10 +20717,11 @@
20717 #ifdef SQLITE_ENABLE_SORTER_REFERENCES
20718 " -sorterref SIZE sorter references threshold size\n"
20719 #endif
20720 " -stats print memory stats before each finalize\n"
20721 " -table set output mode to 'table'\n"
 
20722 " -version show SQLite version\n"
20723 " -vfs NAME use NAME as the default VFS\n"
20724 #ifdef SQLITE_ENABLE_VFSTRACE
20725 " -vfstrace enable tracing of all VFS calls\n"
20726 #endif
@@ -21152,14 +21153,16 @@
21152 data.openMode = SHELL_OPEN_READONLY;
21153 }else if( strcmp(z,"-nofollow")==0 ){
21154 data.openFlags |= SQLITE_OPEN_NOFOLLOW;
21155 }else if( strcmp(z,"-ascii")==0 ){
21156 data.mode = MODE_Ascii;
21157 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
21158 SEP_Unit);
21159 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
21160 SEP_Record);
 
 
21161 }else if( strcmp(z,"-separator")==0 ){
21162 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
21163 "%s",cmdline_option_value(argc,argv,++i));
21164 }else if( strcmp(z,"-newline")==0 ){
21165 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
21166
--- src/shell.c
+++ src/shell.c
@@ -20717,10 +20717,11 @@
20717 #ifdef SQLITE_ENABLE_SORTER_REFERENCES
20718 " -sorterref SIZE sorter references threshold size\n"
20719 #endif
20720 " -stats print memory stats before each finalize\n"
20721 " -table set output mode to 'table'\n"
20722 " -tabs set output mode to 'tabs'\n"
20723 " -version show SQLite version\n"
20724 " -vfs NAME use NAME as the default VFS\n"
20725 #ifdef SQLITE_ENABLE_VFSTRACE
20726 " -vfstrace enable tracing of all VFS calls\n"
20727 #endif
@@ -21152,14 +21153,16 @@
21153 data.openMode = SHELL_OPEN_READONLY;
21154 }else if( strcmp(z,"-nofollow")==0 ){
21155 data.openFlags |= SQLITE_OPEN_NOFOLLOW;
21156 }else if( strcmp(z,"-ascii")==0 ){
21157 data.mode = MODE_Ascii;
21158 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, SEP_Unit);
21159 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, SEP_Record);
21160 }else if( strcmp(z,"-tabs")==0 ){
21161 data.mode = MODE_List;
21162 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, SEP_Tab);
21163 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator, SEP_Row);
21164 }else if( strcmp(z,"-separator")==0 ){
21165 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
21166 "%s",cmdline_option_value(argc,argv,++i));
21167 }else if( strcmp(z,"-newline")==0 ){
21168 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
21169
+57 -15
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
11711171
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11721172
** [sqlite_version()] and [sqlite_source_id()].
11731173
*/
11741174
#define SQLITE_VERSION "3.34.0"
11751175
#define SQLITE_VERSION_NUMBER 3034000
1176
-#define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d"
1176
+#define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d"
11771177
11781178
/*
11791179
** CAPI3REF: Run-Time Library Version Numbers
11801180
** KEYWORDS: sqlite3_version sqlite3_sourceid
11811181
**
@@ -17621,10 +17621,11 @@
1762117621
** Index.aiRowLogEst[] values */
1762217622
#define TF_NoVisibleRowid 0x0200 /* No user-visible "rowid" column */
1762317623
#define TF_OOOHidden 0x0400 /* Out-of-Order hidden columns */
1762417624
#define TF_HasNotNull 0x0800 /* Contains NOT NULL constraints */
1762517625
#define TF_Shadow 0x1000 /* True for a shadow table */
17626
+#define TF_HasStat4 0x2000 /* STAT4 info available for this table */
1762617627
1762717628
/*
1762817629
** Test to see whether or not a table is a virtual table. This is
1762917630
** done as a macro so that it will be optimized out when virtual
1763017631
** table support is omitted from the build.
@@ -27864,16 +27865,21 @@
2786427865
** xRoundup. */
2786527866
nNew = sqlite3GlobalConfig.m.xRoundup((int)nBytes);
2786627867
if( nOld==nNew ){
2786727868
pNew = pOld;
2786827869
}else if( sqlite3GlobalConfig.bMemstat ){
27870
+ sqlite3_int64 nUsed;
2786927871
sqlite3_mutex_enter(mem0.mutex);
2787027872
sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
2787127873
nDiff = nNew - nOld;
27872
- if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
27874
+ if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >=
2787327875
mem0.alarmThreshold-nDiff ){
2787427876
sqlite3MallocAlarm(nDiff);
27877
+ if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
27878
+ sqlite3_mutex_leave(mem0.mutex);
27879
+ return 0;
27880
+ }
2787527881
}
2787627882
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
2787727883
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2787827884
if( pNew==0 && mem0.alarmThreshold>0 ){
2787927885
sqlite3MallocAlarm((int)nBytes);
@@ -48529,12 +48535,16 @@
4852948535
if( iDb<0 ){
4853048536
rc = SQLITE_ERROR;
4853148537
goto end_deserialize;
4853248538
}
4853348539
zSql = sqlite3_mprintf("ATTACH x AS %Q", zSchema);
48534
- rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
48535
- sqlite3_free(zSql);
48540
+ if( zSql==0 ){
48541
+ rc = SQLITE_NOMEM;
48542
+ }else{
48543
+ rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
48544
+ sqlite3_free(zSql);
48545
+ }
4853648546
if( rc ) goto end_deserialize;
4853748547
db->init.iDb = (u8)iDb;
4853848548
db->init.reopenMemdb = 1;
4853948549
rc = sqlite3_step(pStmt);
4854048550
db->init.reopenMemdb = 0;
@@ -78362,10 +78372,11 @@
7836278372
*/
7836378373
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere){
7836478374
int j;
7836578375
sqlite3VdbeAddOp4(p, OP_ParseSchema, iDb, 0, 0, zWhere, P4_DYNAMIC);
7836678376
for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j);
78377
+ sqlite3MayAbort(p->pParse);
7836778378
}
7836878379
7836978380
/*
7837078381
** Add an opcode that includes the p4 value as an integer.
7837178382
*/
@@ -78590,11 +78601,11 @@
7859078601
while( (pOp = opIterNext(&sIter))!=0 ){
7859178602
int opcode = pOp->opcode;
7859278603
if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
7859378604
|| opcode==OP_VDestroy
7859478605
|| opcode==OP_VCreate
78595
- || (opcode==OP_ParseSchema && pOp->p4.z==0)
78606
+ || opcode==OP_ParseSchema
7859678607
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull)
7859778608
&& ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
7859878609
){
7859978610
hasAbort = 1;
7860078611
break;
@@ -79408,11 +79419,11 @@
7940879419
sqlite3_context *pCtx = pOp->p4.pCtx;
7940979420
if( pOp->p4type!=P4_FUNCCTX || pCtx->argc==1 ){
7941079421
sqlite3_str_appendf(&x, "%d", v1);
7941179422
}else if( pCtx->argc>1 ){
7941279423
sqlite3_str_appendf(&x, "%d..%d", v1, v1+pCtx->argc-1);
79413
- }else{
79424
+ }else if( x.accError==0 ){
7941479425
assert( x.nChar>2 );
7941579426
x.nChar -= 2;
7941679427
ii++;
7941779428
}
7941879429
ii += 3;
@@ -107329,17 +107340,25 @@
107329107340
SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107330107341
if( pSrc ){
107331107342
int i;
107332107343
for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107333107344
struct SrcList_item *p = &pSrc->a[i];
107334
- p->pTab = sqlite3LocateTableItem(pParse, 0, p);
107335107345
p->iCursor = pParse->nTab++;
107336
- if( p->pTab==0 ){
107337
- rc = SQLITE_ERROR;
107346
+ if( p->pSelect ){
107347
+ sqlite3SelectPrep(pParse, p->pSelect, 0);
107348
+ sqlite3ExpandSubquery(pParse, p);
107349
+ assert( i>0 );
107350
+ assert( pStep->pFrom->a[i-1].pSelect );
107351
+ sqlite3SelectPrep(pParse, pStep->pFrom->a[i-1].pSelect, 0);
107338107352
}else{
107339
- p->pTab->nTabRef++;
107340
- rc = sqlite3ViewGetColumnNames(pParse, p->pTab);
107353
+ p->pTab = sqlite3LocateTableItem(pParse, 0, p);
107354
+ if( p->pTab==0 ){
107355
+ rc = SQLITE_ERROR;
107356
+ }else{
107357
+ p->pTab->nTabRef++;
107358
+ rc = sqlite3ViewGetColumnNames(pParse, p->pTab);
107359
+ }
107341107360
}
107342107361
}
107343107362
sNC.pSrcList = pSrc;
107344107363
if( rc==SQLITE_OK && pStep->pWhere ){
107345107364
rc = sqlite3ResolveExprNames(&sNC, pStep->pWhere);
@@ -107396,10 +107415,16 @@
107396107415
Upsert *pUpsert = pStep->pUpsert;
107397107416
sqlite3WalkExprList(pWalker, pUpsert->pUpsertTarget);
107398107417
sqlite3WalkExprList(pWalker, pUpsert->pUpsertSet);
107399107418
sqlite3WalkExpr(pWalker, pUpsert->pUpsertWhere);
107400107419
sqlite3WalkExpr(pWalker, pUpsert->pUpsertTargetWhere);
107420
+ }
107421
+ if( pStep->pFrom ){
107422
+ int i;
107423
+ for(i=0; i<pStep->pFrom->nSrc; i++){
107424
+ sqlite3WalkSelect(pWalker, pStep->pFrom->a[i].pSelect);
107425
+ }
107401107426
}
107402107427
}
107403107428
}
107404107429
107405107430
/*
@@ -109655,10 +109680,11 @@
109655109680
sqlite3_finalize(pStmt);
109656109681
return SQLITE_NOMEM_BKPT;
109657109682
}
109658109683
pSpace = (tRowcnt*)&pIdx->aSample[nSample];
109659109684
pIdx->aAvgEq = pSpace; pSpace += nIdxCol;
109685
+ pIdx->pTable->tabFlags |= TF_HasStat4;
109660109686
for(i=0; i<nSample; i++){
109661109687
pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol;
109662109688
pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol;
109663109689
pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol;
109664109690
}
@@ -149074,12 +149100,27 @@
149074149100
/* Integer primary key index */
149075149101
pNew->wsFlags = WHERE_IPK;
149076149102
149077149103
/* Full table scan */
149078149104
pNew->iSortIdx = b ? iSortIdx : 0;
149079
- /* TUNING: Cost of full table scan is (N*3.0). */
149105
+ /* TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an
149106
+ ** extra cost designed to discourage the use of full table scans,
149107
+ ** since index lookups have better worst-case performance if our
149108
+ ** stat guesses are wrong. Reduce the 3.0 penalty slightly
149109
+ ** (to 2.75) if we have valid STAT4 information for the table.
149110
+ ** At 2.75, a full table scan is preferred over using an index on
149111
+ ** a column with just two distinct values where each value has about
149112
+ ** an equal number of appearances. Without STAT4 data, we still want
149113
+ ** to use an index in that case, since the constraint might be for
149114
+ ** the scarcer of the two values, and in that case an index lookup is
149115
+ ** better.
149116
+ */
149117
+#ifdef SQLITE_ENABLE_STAT4
149118
+ pNew->rRun = rSize + 16 - 2*((pTab->tabFlags & TF_HasStat4)!=0);
149119
+#else
149080149120
pNew->rRun = rSize + 16;
149121
+#endif
149081149122
ApplyCostMultiplier(pNew->rRun, pTab->costMult);
149082149123
whereLoopOutputAdjust(pWC, pNew, rSize);
149083149124
rc = whereLoopInsert(pBuilder, pNew);
149084149125
pNew->nOut = rSize;
149085149126
if( rc ) break;
@@ -226638,11 +226679,11 @@
226638226679
int nArg, /* Number of args */
226639226680
sqlite3_value **apUnused /* Function arguments */
226640226681
){
226641226682
assert( nArg==0 );
226642226683
UNUSED_PARAM2(nArg, apUnused);
226643
- sqlite3_result_text(pCtx, "fts5: 2020-10-12 18:09:16 7e17c2f4b7dc9b563d0b4da949bb134dc7c4fc9c86ce03891432a884ca6409d5", -1, SQLITE_TRANSIENT);
226684
+ sqlite3_result_text(pCtx, "fts5: 2020-10-26 16:22:31 80eba105d6d1b49ba8ca2ad4e14ddec2de0bdc2f6686c2f8a1c1d24fc1fe846f", -1, SQLITE_TRANSIENT);
226644226685
}
226645226686
226646226687
/*
226647226688
** Return true if zName is the extension on one of the shadow tables used
226648226689
** by this module.
@@ -230121,10 +230162,11 @@
230121230162
for(; i<128 && i<n; i++){
230122230163
aAscii[i] = (u8)bToken;
230123230164
}
230124230165
iTbl++;
230125230166
}
230167
+ aAscii[0] = 0; /* 0x00 is never a token character */
230126230168
}
230127230169
230128230170
/*
230129230171
** 2015 May 30
230130230172
**
@@ -231560,12 +231602,12 @@
231560231602
}
231561231603
#endif /* SQLITE_CORE */
231562231604
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231563231605
231564231606
/************** End of stmt.c ************************************************/
231565
-#if __LINE__!=231565
231607
+#if __LINE__!=231607
231566231608
#undef SQLITE_SOURCE_ID
231567
-#define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a19678alt2"
231609
+#define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692alt2"
231568231610
#endif
231569231611
/* Return the source-id for this library */
231570231612
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231571231613
/************************** End of sqlite3.c ******************************/
231572231614
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.34.0"
1175 #define SQLITE_VERSION_NUMBER 3034000
1176 #define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -17621,10 +17621,11 @@
17621 ** Index.aiRowLogEst[] values */
17622 #define TF_NoVisibleRowid 0x0200 /* No user-visible "rowid" column */
17623 #define TF_OOOHidden 0x0400 /* Out-of-Order hidden columns */
17624 #define TF_HasNotNull 0x0800 /* Contains NOT NULL constraints */
17625 #define TF_Shadow 0x1000 /* True for a shadow table */
 
17626
17627 /*
17628 ** Test to see whether or not a table is a virtual table. This is
17629 ** done as a macro so that it will be optimized out when virtual
17630 ** table support is omitted from the build.
@@ -27864,16 +27865,21 @@
27864 ** xRoundup. */
27865 nNew = sqlite3GlobalConfig.m.xRoundup((int)nBytes);
27866 if( nOld==nNew ){
27867 pNew = pOld;
27868 }else if( sqlite3GlobalConfig.bMemstat ){
 
27869 sqlite3_mutex_enter(mem0.mutex);
27870 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
27871 nDiff = nNew - nOld;
27872 if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
27873 mem0.alarmThreshold-nDiff ){
27874 sqlite3MallocAlarm(nDiff);
 
 
 
 
27875 }
27876 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
27877 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
27878 if( pNew==0 && mem0.alarmThreshold>0 ){
27879 sqlite3MallocAlarm((int)nBytes);
@@ -48529,12 +48535,16 @@
48529 if( iDb<0 ){
48530 rc = SQLITE_ERROR;
48531 goto end_deserialize;
48532 }
48533 zSql = sqlite3_mprintf("ATTACH x AS %Q", zSchema);
48534 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
48535 sqlite3_free(zSql);
 
 
 
 
48536 if( rc ) goto end_deserialize;
48537 db->init.iDb = (u8)iDb;
48538 db->init.reopenMemdb = 1;
48539 rc = sqlite3_step(pStmt);
48540 db->init.reopenMemdb = 0;
@@ -78362,10 +78372,11 @@
78362 */
78363 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere){
78364 int j;
78365 sqlite3VdbeAddOp4(p, OP_ParseSchema, iDb, 0, 0, zWhere, P4_DYNAMIC);
78366 for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j);
 
78367 }
78368
78369 /*
78370 ** Add an opcode that includes the p4 value as an integer.
78371 */
@@ -78590,11 +78601,11 @@
78590 while( (pOp = opIterNext(&sIter))!=0 ){
78591 int opcode = pOp->opcode;
78592 if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
78593 || opcode==OP_VDestroy
78594 || opcode==OP_VCreate
78595 || (opcode==OP_ParseSchema && pOp->p4.z==0)
78596 || ((opcode==OP_Halt || opcode==OP_HaltIfNull)
78597 && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
78598 ){
78599 hasAbort = 1;
78600 break;
@@ -79408,11 +79419,11 @@
79408 sqlite3_context *pCtx = pOp->p4.pCtx;
79409 if( pOp->p4type!=P4_FUNCCTX || pCtx->argc==1 ){
79410 sqlite3_str_appendf(&x, "%d", v1);
79411 }else if( pCtx->argc>1 ){
79412 sqlite3_str_appendf(&x, "%d..%d", v1, v1+pCtx->argc-1);
79413 }else{
79414 assert( x.nChar>2 );
79415 x.nChar -= 2;
79416 ii++;
79417 }
79418 ii += 3;
@@ -107329,17 +107340,25 @@
107329 SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107330 if( pSrc ){
107331 int i;
107332 for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107333 struct SrcList_item *p = &pSrc->a[i];
107334 p->pTab = sqlite3LocateTableItem(pParse, 0, p);
107335 p->iCursor = pParse->nTab++;
107336 if( p->pTab==0 ){
107337 rc = SQLITE_ERROR;
 
 
 
 
107338 }else{
107339 p->pTab->nTabRef++;
107340 rc = sqlite3ViewGetColumnNames(pParse, p->pTab);
 
 
 
 
 
107341 }
107342 }
107343 sNC.pSrcList = pSrc;
107344 if( rc==SQLITE_OK && pStep->pWhere ){
107345 rc = sqlite3ResolveExprNames(&sNC, pStep->pWhere);
@@ -107396,10 +107415,16 @@
107396 Upsert *pUpsert = pStep->pUpsert;
107397 sqlite3WalkExprList(pWalker, pUpsert->pUpsertTarget);
107398 sqlite3WalkExprList(pWalker, pUpsert->pUpsertSet);
107399 sqlite3WalkExpr(pWalker, pUpsert->pUpsertWhere);
107400 sqlite3WalkExpr(pWalker, pUpsert->pUpsertTargetWhere);
 
 
 
 
 
 
107401 }
107402 }
107403 }
107404
107405 /*
@@ -109655,10 +109680,11 @@
109655 sqlite3_finalize(pStmt);
109656 return SQLITE_NOMEM_BKPT;
109657 }
109658 pSpace = (tRowcnt*)&pIdx->aSample[nSample];
109659 pIdx->aAvgEq = pSpace; pSpace += nIdxCol;
 
109660 for(i=0; i<nSample; i++){
109661 pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol;
109662 pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol;
109663 pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol;
109664 }
@@ -149074,12 +149100,27 @@
149074 /* Integer primary key index */
149075 pNew->wsFlags = WHERE_IPK;
149076
149077 /* Full table scan */
149078 pNew->iSortIdx = b ? iSortIdx : 0;
149079 /* TUNING: Cost of full table scan is (N*3.0). */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149080 pNew->rRun = rSize + 16;
 
149081 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
149082 whereLoopOutputAdjust(pWC, pNew, rSize);
149083 rc = whereLoopInsert(pBuilder, pNew);
149084 pNew->nOut = rSize;
149085 if( rc ) break;
@@ -226638,11 +226679,11 @@
226638 int nArg, /* Number of args */
226639 sqlite3_value **apUnused /* Function arguments */
226640 ){
226641 assert( nArg==0 );
226642 UNUSED_PARAM2(nArg, apUnused);
226643 sqlite3_result_text(pCtx, "fts5: 2020-10-12 18:09:16 7e17c2f4b7dc9b563d0b4da949bb134dc7c4fc9c86ce03891432a884ca6409d5", -1, SQLITE_TRANSIENT);
226644 }
226645
226646 /*
226647 ** Return true if zName is the extension on one of the shadow tables used
226648 ** by this module.
@@ -230121,10 +230162,11 @@
230121 for(; i<128 && i<n; i++){
230122 aAscii[i] = (u8)bToken;
230123 }
230124 iTbl++;
230125 }
 
230126 }
230127
230128 /*
230129 ** 2015 May 30
230130 **
@@ -231560,12 +231602,12 @@
231560 }
231561 #endif /* SQLITE_CORE */
231562 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231563
231564 /************** End of stmt.c ************************************************/
231565 #if __LINE__!=231565
231566 #undef SQLITE_SOURCE_ID
231567 #define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a19678alt2"
231568 #endif
231569 /* Return the source-id for this library */
231570 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231571 /************************** End of sqlite3.c ******************************/
231572
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.34.0"
1175 #define SQLITE_VERSION_NUMBER 3034000
1176 #define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -17621,10 +17621,11 @@
17621 ** Index.aiRowLogEst[] values */
17622 #define TF_NoVisibleRowid 0x0200 /* No user-visible "rowid" column */
17623 #define TF_OOOHidden 0x0400 /* Out-of-Order hidden columns */
17624 #define TF_HasNotNull 0x0800 /* Contains NOT NULL constraints */
17625 #define TF_Shadow 0x1000 /* True for a shadow table */
17626 #define TF_HasStat4 0x2000 /* STAT4 info available for this table */
17627
17628 /*
17629 ** Test to see whether or not a table is a virtual table. This is
17630 ** done as a macro so that it will be optimized out when virtual
17631 ** table support is omitted from the build.
@@ -27864,16 +27865,21 @@
27865 ** xRoundup. */
27866 nNew = sqlite3GlobalConfig.m.xRoundup((int)nBytes);
27867 if( nOld==nNew ){
27868 pNew = pOld;
27869 }else if( sqlite3GlobalConfig.bMemstat ){
27870 sqlite3_int64 nUsed;
27871 sqlite3_mutex_enter(mem0.mutex);
27872 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
27873 nDiff = nNew - nOld;
27874 if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >=
27875 mem0.alarmThreshold-nDiff ){
27876 sqlite3MallocAlarm(nDiff);
27877 if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
27878 sqlite3_mutex_leave(mem0.mutex);
27879 return 0;
27880 }
27881 }
27882 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
27883 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
27884 if( pNew==0 && mem0.alarmThreshold>0 ){
27885 sqlite3MallocAlarm((int)nBytes);
@@ -48529,12 +48535,16 @@
48535 if( iDb<0 ){
48536 rc = SQLITE_ERROR;
48537 goto end_deserialize;
48538 }
48539 zSql = sqlite3_mprintf("ATTACH x AS %Q", zSchema);
48540 if( zSql==0 ){
48541 rc = SQLITE_NOMEM;
48542 }else{
48543 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
48544 sqlite3_free(zSql);
48545 }
48546 if( rc ) goto end_deserialize;
48547 db->init.iDb = (u8)iDb;
48548 db->init.reopenMemdb = 1;
48549 rc = sqlite3_step(pStmt);
48550 db->init.reopenMemdb = 0;
@@ -78362,10 +78372,11 @@
78372 */
78373 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere){
78374 int j;
78375 sqlite3VdbeAddOp4(p, OP_ParseSchema, iDb, 0, 0, zWhere, P4_DYNAMIC);
78376 for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j);
78377 sqlite3MayAbort(p->pParse);
78378 }
78379
78380 /*
78381 ** Add an opcode that includes the p4 value as an integer.
78382 */
@@ -78590,11 +78601,11 @@
78601 while( (pOp = opIterNext(&sIter))!=0 ){
78602 int opcode = pOp->opcode;
78603 if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
78604 || opcode==OP_VDestroy
78605 || opcode==OP_VCreate
78606 || opcode==OP_ParseSchema
78607 || ((opcode==OP_Halt || opcode==OP_HaltIfNull)
78608 && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
78609 ){
78610 hasAbort = 1;
78611 break;
@@ -79408,11 +79419,11 @@
79419 sqlite3_context *pCtx = pOp->p4.pCtx;
79420 if( pOp->p4type!=P4_FUNCCTX || pCtx->argc==1 ){
79421 sqlite3_str_appendf(&x, "%d", v1);
79422 }else if( pCtx->argc>1 ){
79423 sqlite3_str_appendf(&x, "%d..%d", v1, v1+pCtx->argc-1);
79424 }else if( x.accError==0 ){
79425 assert( x.nChar>2 );
79426 x.nChar -= 2;
79427 ii++;
79428 }
79429 ii += 3;
@@ -107329,17 +107340,25 @@
107340 SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107341 if( pSrc ){
107342 int i;
107343 for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107344 struct SrcList_item *p = &pSrc->a[i];
 
107345 p->iCursor = pParse->nTab++;
107346 if( p->pSelect ){
107347 sqlite3SelectPrep(pParse, p->pSelect, 0);
107348 sqlite3ExpandSubquery(pParse, p);
107349 assert( i>0 );
107350 assert( pStep->pFrom->a[i-1].pSelect );
107351 sqlite3SelectPrep(pParse, pStep->pFrom->a[i-1].pSelect, 0);
107352 }else{
107353 p->pTab = sqlite3LocateTableItem(pParse, 0, p);
107354 if( p->pTab==0 ){
107355 rc = SQLITE_ERROR;
107356 }else{
107357 p->pTab->nTabRef++;
107358 rc = sqlite3ViewGetColumnNames(pParse, p->pTab);
107359 }
107360 }
107361 }
107362 sNC.pSrcList = pSrc;
107363 if( rc==SQLITE_OK && pStep->pWhere ){
107364 rc = sqlite3ResolveExprNames(&sNC, pStep->pWhere);
@@ -107396,10 +107415,16 @@
107415 Upsert *pUpsert = pStep->pUpsert;
107416 sqlite3WalkExprList(pWalker, pUpsert->pUpsertTarget);
107417 sqlite3WalkExprList(pWalker, pUpsert->pUpsertSet);
107418 sqlite3WalkExpr(pWalker, pUpsert->pUpsertWhere);
107419 sqlite3WalkExpr(pWalker, pUpsert->pUpsertTargetWhere);
107420 }
107421 if( pStep->pFrom ){
107422 int i;
107423 for(i=0; i<pStep->pFrom->nSrc; i++){
107424 sqlite3WalkSelect(pWalker, pStep->pFrom->a[i].pSelect);
107425 }
107426 }
107427 }
107428 }
107429
107430 /*
@@ -109655,10 +109680,11 @@
109680 sqlite3_finalize(pStmt);
109681 return SQLITE_NOMEM_BKPT;
109682 }
109683 pSpace = (tRowcnt*)&pIdx->aSample[nSample];
109684 pIdx->aAvgEq = pSpace; pSpace += nIdxCol;
109685 pIdx->pTable->tabFlags |= TF_HasStat4;
109686 for(i=0; i<nSample; i++){
109687 pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol;
109688 pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol;
109689 pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol;
109690 }
@@ -149074,12 +149100,27 @@
149100 /* Integer primary key index */
149101 pNew->wsFlags = WHERE_IPK;
149102
149103 /* Full table scan */
149104 pNew->iSortIdx = b ? iSortIdx : 0;
149105 /* TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an
149106 ** extra cost designed to discourage the use of full table scans,
149107 ** since index lookups have better worst-case performance if our
149108 ** stat guesses are wrong. Reduce the 3.0 penalty slightly
149109 ** (to 2.75) if we have valid STAT4 information for the table.
149110 ** At 2.75, a full table scan is preferred over using an index on
149111 ** a column with just two distinct values where each value has about
149112 ** an equal number of appearances. Without STAT4 data, we still want
149113 ** to use an index in that case, since the constraint might be for
149114 ** the scarcer of the two values, and in that case an index lookup is
149115 ** better.
149116 */
149117 #ifdef SQLITE_ENABLE_STAT4
149118 pNew->rRun = rSize + 16 - 2*((pTab->tabFlags & TF_HasStat4)!=0);
149119 #else
149120 pNew->rRun = rSize + 16;
149121 #endif
149122 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
149123 whereLoopOutputAdjust(pWC, pNew, rSize);
149124 rc = whereLoopInsert(pBuilder, pNew);
149125 pNew->nOut = rSize;
149126 if( rc ) break;
@@ -226638,11 +226679,11 @@
226679 int nArg, /* Number of args */
226680 sqlite3_value **apUnused /* Function arguments */
226681 ){
226682 assert( nArg==0 );
226683 UNUSED_PARAM2(nArg, apUnused);
226684 sqlite3_result_text(pCtx, "fts5: 2020-10-26 16:22:31 80eba105d6d1b49ba8ca2ad4e14ddec2de0bdc2f6686c2f8a1c1d24fc1fe846f", -1, SQLITE_TRANSIENT);
226685 }
226686
226687 /*
226688 ** Return true if zName is the extension on one of the shadow tables used
226689 ** by this module.
@@ -230121,10 +230162,11 @@
230162 for(; i<128 && i<n; i++){
230163 aAscii[i] = (u8)bToken;
230164 }
230165 iTbl++;
230166 }
230167 aAscii[0] = 0; /* 0x00 is never a token character */
230168 }
230169
230170 /*
230171 ** 2015 May 30
230172 **
@@ -231560,12 +231602,12 @@
231602 }
231603 #endif /* SQLITE_CORE */
231604 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231605
231606 /************** End of stmt.c ************************************************/
231607 #if __LINE__!=231607
231608 #undef SQLITE_SOURCE_ID
231609 #define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692alt2"
231610 #endif
231611 /* Return the source-id for this library */
231612 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231613 /************************** End of sqlite3.c ******************************/
231614
+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.34.0"
127127
#define SQLITE_VERSION_NUMBER 3034000
128
-#define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d"
128
+#define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d"
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.34.0"
127 #define SQLITE_VERSION_NUMBER 3034000
128 #define SQLITE_SOURCE_ID "2020-10-19 20:49:54 75a0288871ccb2a69a636cbb328fe19045a0d0ef96a193ecd118b9a196784d2d"
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.34.0"
127 #define SQLITE_VERSION_NUMBER 3034000
128 #define SQLITE_SOURCE_ID "2020-10-31 18:58:37 7d01e84dc49074e6364267eea9fd20d46a457d2498121a0f218fbf482692392d"
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