Fossil SCM

Update the built-in SQLite to the 3.25.2 release candidate, for testing.

drh 2018-09-25 17:26 trunk
Commit 5fdd53120e12a9f95ccc5e637803543745acc6b7874f248e34505a578415d172
2 files changed +76 -56 +3 -3
+76 -56
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.25.1. By combining all the individual C code files into this
3
+** version 3.25.2. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -1154,13 +1154,13 @@
11541154
**
11551155
** See also: [sqlite3_libversion()],
11561156
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11571157
** [sqlite_version()] and [sqlite_source_id()].
11581158
*/
1159
-#define SQLITE_VERSION "3.25.1"
1160
-#define SQLITE_VERSION_NUMBER 3025001
1161
-#define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386"
1159
+#define SQLITE_VERSION "3.25.2"
1160
+#define SQLITE_VERSION_NUMBER 3025002
1161
+#define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e238183"
11621162
11631163
/*
11641164
** CAPI3REF: Run-Time Library Version Numbers
11651165
** KEYWORDS: sqlite3_version sqlite3_sourceid
11661166
**
@@ -16267,10 +16267,11 @@
1626716267
#define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */
1626816268
#define SQLITE_Fts3Tokenizer 0x00400000 /* Enable fts3_tokenizer(2) */
1626916269
#define SQLITE_EnableQPSG 0x00800000 /* Query Planner Stability Guarantee*/
1627016270
#define SQLITE_TriggerEQP 0x01000000 /* Show trigger EXPLAIN QUERY PLAN */
1627116271
#define SQLITE_ResetDatabase 0x02000000 /* Reset the database */
16272
+#define SQLITE_LegacyAlter 0x04000000 /* Legacy ALTER TABLE behaviour */
1627216273
1627316274
/* Flags used only if debugging */
1627416275
#ifdef SQLITE_DEBUG
1627516276
#define SQLITE_SqlTrace 0x08000000 /* Debug print SQL as it executes */
1627616277
#define SQLITE_VdbeListing 0x10000000 /* Debug listings of VDBE programs */
@@ -32617,11 +32618,15 @@
3261732618
{ "lstat", (sqlite3_syscall_ptr)0, 0 },
3261832619
#endif
3261932620
#define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent)
3262032621
3262132622
#if defined(__linux__) && defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
32623
+# ifdef __ANDROID__
32624
+ { "ioctl", (sqlite3_syscall_ptr)(int(*)(int, int, ...))ioctl, 0 },
32625
+# else
3262232626
{ "ioctl", (sqlite3_syscall_ptr)ioctl, 0 },
32627
+# endif
3262332628
#else
3262432629
{ "ioctl", (sqlite3_syscall_ptr)0, 0 },
3262532630
#endif
3262632631
#define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent)
3262732632
@@ -89711,11 +89716,14 @@
8971189716
** in register P1 is passed as the zName argument to the xRename method.
8971289717
*/
8971389718
case OP_VRename: {
8971489719
sqlite3_vtab *pVtab;
8971589720
Mem *pName;
89716
-
89721
+ int isLegacy;
89722
+
89723
+ isLegacy = (db->flags & SQLITE_LegacyAlter);
89724
+ db->flags |= SQLITE_LegacyAlter;
8971789725
pVtab = pOp->p4.pVtab->pVtab;
8971889726
pName = &aMem[pOp->p1];
8971989727
assert( pVtab->pModule->xRename );
8972089728
assert( memIsValid(pName) );
8972189729
assert( p->readOnly==0 );
@@ -89725,10 +89733,11 @@
8972589733
testcase( pName->enc==SQLITE_UTF16BE );
8972689734
testcase( pName->enc==SQLITE_UTF16LE );
8972789735
rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8);
8972889736
if( rc ) goto abort_due_to_error;
8972989737
rc = pVtab->pModule->xRename(pVtab, pName->z);
89738
+ if( isLegacy==0 ) db->flags &= ~SQLITE_LegacyAlter;
8973089739
sqlite3VtabImportErrmsg(p, pVtab);
8973189740
p->expired = 0;
8973289741
if( rc ) goto abort_due_to_error;
8973389742
break;
8973489743
}
@@ -97045,21 +97054,18 @@
9704597054
pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
9704697055
}
9704797056
}
9704897057
9704997058
/* Fill in pNew->pLeft and pNew->pRight. */
97059
+ zAlloc += dupedExprNodeSize(p, dupFlags);
9705097060
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
97051
- zAlloc += dupedExprNodeSize(p, dupFlags);
9705297061
if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
9705397062
pNew->pLeft = p->pLeft ?
9705497063
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
9705597064
pNew->pRight = p->pRight ?
9705697065
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
9705797066
}
97058
- if( pzBuffer ){
97059
- *pzBuffer = zAlloc;
97060
- }
9706197067
}else{
9706297068
#ifndef SQLITE_OMIT_WINDOWFUNC
9706397069
if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){
9706497070
pNew->pWin = 0;
9706597071
}else{
@@ -97075,10 +97081,13 @@
9707597081
pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
9707697082
}
9707797083
pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
9707897084
}
9707997085
}
97086
+ if( pzBuffer ){
97087
+ *pzBuffer = zAlloc;
97088
+ }
9708097089
}
9708197090
return pNew;
9708297091
}
9708397092
9708497093
/*
@@ -100626,22 +100635,19 @@
100626100635
}
100627100636
100628100637
/*
100629100638
** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
100630100639
** If the expression node requires that the table at pWalker->iCur
100631
-** have a non-NULL column, then set pWalker->eCode to 1 and abort.
100640
+** have one or more non-NULL column, then set pWalker->eCode to 1 and abort.
100641
+**
100642
+** This routine controls an optimization. False positives (setting
100643
+** pWalker->eCode to 1 when it should not be) are deadly, but false-negatives
100644
+** (never setting pWalker->eCode) is a harmless missed optimization.
100632100645
*/
100633100646
static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
100634
- /* This routine is only called for WHERE clause expressions and so it
100635
- ** cannot have any TK_AGG_COLUMN entries because those are only found
100636
- ** in HAVING clauses. We can get a TK_AGG_FUNCTION in a WHERE clause,
100637
- ** but that is an illegal construct and the query will be rejected at
100638
- ** a later stage of processing, so the TK_AGG_FUNCTION case does not
100639
- ** need to be considered here. */
100640
- assert( pExpr->op!=TK_AGG_COLUMN );
100647
+ testcase( pExpr->op==TK_AGG_COLUMN );
100641100648
testcase( pExpr->op==TK_AGG_FUNCTION );
100642
-
100643100649
if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
100644100650
switch( pExpr->op ){
100645100651
case TK_ISNOT:
100646100652
case TK_NOT:
100647100653
case TK_ISNULL:
@@ -101296,24 +101302,10 @@
101296101302
v = sqlite3GetVdbe(pParse);
101297101303
if( v==0 ){
101298101304
goto exit_rename_table;
101299101305
}
101300101306
101301
- /* If this is a virtual table, invoke the xRename() function if
101302
- ** one is defined. The xRename() callback will modify the names
101303
- ** of any resources used by the v-table implementation (including other
101304
- ** SQLite tables) that are identified by the name of the virtual table.
101305
- */
101306
-#ifndef SQLITE_OMIT_VIRTUALTABLE
101307
- if( pVTab ){
101308
- int i = ++pParse->nMem;
101309
- sqlite3VdbeLoadString(v, i, zName);
101310
- sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
101311
- sqlite3MayAbort(pParse);
101312
- }
101313
-#endif
101314
-
101315101307
/* figure out how many UTF-8 characters are in zName */
101316101308
zTabName = pTab->zName;
101317101309
nTabName = sqlite3Utf8CharLen(zTabName, -1);
101318101310
101319101311
/* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in
@@ -101366,10 +101358,24 @@
101366101358
" sqlite_rename_test(%Q, sql, type, name, 1) "
101367101359
"THEN %Q ELSE tbl_name END "
101368101360
"WHERE type IN ('view', 'trigger')"
101369101361
, zDb, zTabName, zName, zTabName, zDb, zName);
101370101362
}
101363
+
101364
+ /* If this is a virtual table, invoke the xRename() function if
101365
+ ** one is defined. The xRename() callback will modify the names
101366
+ ** of any resources used by the v-table implementation (including other
101367
+ ** SQLite tables) that are identified by the name of the virtual table.
101368
+ */
101369
+#ifndef SQLITE_OMIT_VIRTUALTABLE
101370
+ if( pVTab ){
101371
+ int i = ++pParse->nMem;
101372
+ sqlite3VdbeLoadString(v, i, zName);
101373
+ sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
101374
+ sqlite3MayAbort(pParse);
101375
+ }
101376
+#endif
101371101377
101372101378
renameReloadSchema(pParse, iDb);
101373101379
renameTestSchema(pParse, zDb, iDb==1);
101374101380
101375101381
exit_rename_table:
@@ -102549,21 +102555,24 @@
102549102555
sWalker.u.pRename = &sCtx;
102550102556
102551102557
rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102552102558
102553102559
if( rc==SQLITE_OK ){
102560
+ int isLegacy = (db->flags & SQLITE_LegacyAlter);
102554102561
if( sParse.pNewTable ){
102555102562
Table *pTab = sParse.pNewTable;
102556102563
102557102564
if( pTab->pSelect ){
102558
- NameContext sNC;
102559
- memset(&sNC, 0, sizeof(sNC));
102560
- sNC.pParse = &sParse;
102565
+ if( isLegacy==0 ){
102566
+ NameContext sNC;
102567
+ memset(&sNC, 0, sizeof(sNC));
102568
+ sNC.pParse = &sParse;
102561102569
102562
- sqlite3SelectPrep(&sParse, pTab->pSelect, &sNC);
102563
- if( sParse.nErr ) rc = sParse.rc;
102564
- sqlite3WalkSelect(&sWalker, pTab->pSelect);
102570
+ sqlite3SelectPrep(&sParse, pTab->pSelect, &sNC);
102571
+ if( sParse.nErr ) rc = sParse.rc;
102572
+ sqlite3WalkSelect(&sWalker, pTab->pSelect);
102573
+ }
102565102574
}else{
102566102575
/* Modify any FK definitions to point to the new table. */
102567102576
#ifndef SQLITE_OMIT_FOREIGN_KEY
102568102577
if( db->flags & SQLITE_ForeignKeys ){
102569102578
FKey *pFKey;
@@ -102578,19 +102587,23 @@
102578102587
/* If this is the table being altered, fix any table refs in CHECK
102579102588
** expressions. Also update the name that appears right after the
102580102589
** "CREATE [VIRTUAL] TABLE" bit. */
102581102590
if( sqlite3_stricmp(zOld, pTab->zName)==0 ){
102582102591
sCtx.pTab = pTab;
102583
- sqlite3WalkExprList(&sWalker, pTab->pCheck);
102592
+ if( isLegacy==0 ){
102593
+ sqlite3WalkExprList(&sWalker, pTab->pCheck);
102594
+ }
102584102595
renameTokenFind(&sParse, &sCtx, pTab->zName);
102585102596
}
102586102597
}
102587102598
}
102588102599
102589102600
else if( sParse.pNewIndex ){
102590102601
renameTokenFind(&sParse, &sCtx, sParse.pNewIndex->zName);
102591
- sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere);
102602
+ if( isLegacy==0 ){
102603
+ sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere);
102604
+ }
102592102605
}
102593102606
102594102607
#ifndef SQLITE_OMIT_TRIGGER
102595102608
else{
102596102609
Trigger *pTrigger = sParse.pNewTrigger;
@@ -102599,16 +102612,18 @@
102599102612
&& sCtx.pTab->pSchema==pTrigger->pTabSchema
102600102613
){
102601102614
renameTokenFind(&sParse, &sCtx, sParse.pNewTrigger->table);
102602102615
}
102603102616
102604
- rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102605
- if( rc==SQLITE_OK ){
102606
- renameWalkTrigger(&sWalker, pTrigger);
102607
- for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
102608
- if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
102609
- renameTokenFind(&sParse, &sCtx, pStep->zTarget);
102617
+ if( isLegacy==0 ){
102618
+ rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102619
+ if( rc==SQLITE_OK ){
102620
+ renameWalkTrigger(&sWalker, pTrigger);
102621
+ for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
102622
+ if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
102623
+ renameTokenFind(&sParse, &sCtx, pStep->zTarget);
102624
+ }
102610102625
}
102611102626
}
102612102627
}
102613102628
}
102614102629
#endif
@@ -102662,10 +102677,11 @@
102662102677
){
102663102678
sqlite3 *db = sqlite3_context_db_handle(context);
102664102679
char const *zDb = (const char*)sqlite3_value_text(argv[0]);
102665102680
char const *zInput = (const char*)sqlite3_value_text(argv[1]);
102666102681
int bTemp = sqlite3_value_int(argv[4]);
102682
+ int isLegacy = (db->flags & SQLITE_LegacyAlter);
102667102683
102668102684
#ifndef SQLITE_OMIT_AUTHORIZATION
102669102685
sqlite3_xauth xAuth = db->xAuth;
102670102686
db->xAuth = 0;
102671102687
#endif
@@ -102674,20 +102690,22 @@
102674102690
if( zDb && zInput ){
102675102691
int rc;
102676102692
Parse sParse;
102677102693
rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102678102694
if( rc==SQLITE_OK ){
102679
- if( sParse.pNewTable && sParse.pNewTable->pSelect ){
102695
+ if( isLegacy==0 && sParse.pNewTable && sParse.pNewTable->pSelect ){
102680102696
NameContext sNC;
102681102697
memset(&sNC, 0, sizeof(sNC));
102682102698
sNC.pParse = &sParse;
102683102699
sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, &sNC);
102684102700
if( sParse.nErr ) rc = sParse.rc;
102685102701
}
102686102702
102687102703
else if( sParse.pNewTrigger ){
102688
- rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102704
+ if( isLegacy==0 ){
102705
+ rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102706
+ }
102689102707
if( rc==SQLITE_OK ){
102690102708
int i1 = sqlite3SchemaToIndex(db, sParse.pNewTrigger->pTabSchema);
102691102709
int i2 = sqlite3FindDbName(db, zDb);
102692102710
if( i1==i2 ) sqlite3_result_int(context, 1);
102693102711
}
@@ -107333,14 +107351,10 @@
107333107351
pTab->aCol[i].notNull = OE_Abort;
107334107352
}
107335107353
}
107336107354
}
107337107355
107338
- /* The remaining transformations only apply to b-tree tables, not to
107339
- ** virtual tables */
107340
- if( IN_DECLARE_VTAB ) return;
107341
-
107342107356
/* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY
107343107357
** into BTREE_BLOBKEY.
107344107358
*/
107345107359
if( pParse->addrCrTab ){
107346107360
assert( v );
@@ -119467,10 +119481,15 @@
119467119481
/* ePragFlg: */ 0,
119468119482
/* ColNames: */ 0, 0,
119469119483
/* iArg: */ 0 },
119470119484
#endif
119471119485
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
119486
+ {/* zName: */ "legacy_alter_table",
119487
+ /* ePragTyp: */ PragTyp_FLAG,
119488
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119489
+ /* ColNames: */ 0, 0,
119490
+ /* iArg: */ SQLITE_LegacyAlter },
119472119491
{/* zName: */ "legacy_file_format",
119473119492
/* ePragTyp: */ PragTyp_FLAG,
119474119493
/* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119475119494
/* ColNames: */ 0, 0,
119476119495
/* iArg: */ SQLITE_LegacyFileFmt },
@@ -119720,11 +119739,11 @@
119720119739
/* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119721119740
/* ColNames: */ 0, 0,
119722119741
/* iArg: */ SQLITE_WriteSchema },
119723119742
#endif
119724119743
};
119725
-/* Number of pragmas: 60 on by default, 77 total. */
119744
+/* Number of pragmas: 61 on by default, 78 total. */
119726119745
119727119746
/************** End of pragma.h **********************************************/
119728119747
/************** Continuing where we left off in pragma.c *********************/
119729119748
119730119749
/*
@@ -154761,10 +154780,11 @@
154761154780
sqlite3_mutex_enter(db->mutex);
154762154781
db->errMask = 0xff;
154763154782
db->nDb = 2;
154764154783
db->magic = SQLITE_MAGIC_BUSY;
154765154784
db->aDb = db->aDbStatic;
154785
+ db->lookaside.bDisable = 1;
154766154786
154767154787
assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
154768154788
memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
154769154789
db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
154770154790
db->autoCommit = 1;
@@ -214422,11 +214442,11 @@
214422214442
int nArg, /* Number of args */
214423214443
sqlite3_value **apUnused /* Function arguments */
214424214444
){
214425214445
assert( nArg==0 );
214426214446
UNUSED_PARAM2(nArg, apUnused);
214427
- sqlite3_result_text(pCtx, "fts5: 2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386", -1, SQLITE_TRANSIENT);
214447
+ sqlite3_result_text(pCtx, "fts5: 2018-09-25 01:38:00 996d74f501a45ae12ddc16fe66f849993142e47ccb8b068c412d2ea9bd301ec2", -1, SQLITE_TRANSIENT);
214428214448
}
214429214449
214430214450
static int fts5Init(sqlite3 *db){
214431214451
static const sqlite3_module fts5Mod = {
214432214452
/* iVersion */ 2,
@@ -219132,12 +219152,12 @@
219132219152
}
219133219153
#endif /* SQLITE_CORE */
219134219154
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219135219155
219136219156
/************** End of stmt.c ************************************************/
219137
-#if __LINE__!=219137
219157
+#if __LINE__!=219157
219138219158
#undef SQLITE_SOURCE_ID
219139
-#define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460alt2"
219159
+#define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e23alt2"
219140219160
#endif
219141219161
/* Return the source-id for this library */
219142219162
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219143219163
/************************** End of sqlite3.c ******************************/
219144219164
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.25.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1154,13 +1154,13 @@
1154 **
1155 ** See also: [sqlite3_libversion()],
1156 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1157 ** [sqlite_version()] and [sqlite_source_id()].
1158 */
1159 #define SQLITE_VERSION "3.25.1"
1160 #define SQLITE_VERSION_NUMBER 3025001
1161 #define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386"
1162
1163 /*
1164 ** CAPI3REF: Run-Time Library Version Numbers
1165 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1166 **
@@ -16267,10 +16267,11 @@
16267 #define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */
16268 #define SQLITE_Fts3Tokenizer 0x00400000 /* Enable fts3_tokenizer(2) */
16269 #define SQLITE_EnableQPSG 0x00800000 /* Query Planner Stability Guarantee*/
16270 #define SQLITE_TriggerEQP 0x01000000 /* Show trigger EXPLAIN QUERY PLAN */
16271 #define SQLITE_ResetDatabase 0x02000000 /* Reset the database */
 
16272
16273 /* Flags used only if debugging */
16274 #ifdef SQLITE_DEBUG
16275 #define SQLITE_SqlTrace 0x08000000 /* Debug print SQL as it executes */
16276 #define SQLITE_VdbeListing 0x10000000 /* Debug listings of VDBE programs */
@@ -32617,11 +32618,15 @@
32617 { "lstat", (sqlite3_syscall_ptr)0, 0 },
32618 #endif
32619 #define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent)
32620
32621 #if defined(__linux__) && defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
 
 
 
32622 { "ioctl", (sqlite3_syscall_ptr)ioctl, 0 },
 
32623 #else
32624 { "ioctl", (sqlite3_syscall_ptr)0, 0 },
32625 #endif
32626 #define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent)
32627
@@ -89711,11 +89716,14 @@
89711 ** in register P1 is passed as the zName argument to the xRename method.
89712 */
89713 case OP_VRename: {
89714 sqlite3_vtab *pVtab;
89715 Mem *pName;
89716
 
 
 
89717 pVtab = pOp->p4.pVtab->pVtab;
89718 pName = &aMem[pOp->p1];
89719 assert( pVtab->pModule->xRename );
89720 assert( memIsValid(pName) );
89721 assert( p->readOnly==0 );
@@ -89725,10 +89733,11 @@
89725 testcase( pName->enc==SQLITE_UTF16BE );
89726 testcase( pName->enc==SQLITE_UTF16LE );
89727 rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8);
89728 if( rc ) goto abort_due_to_error;
89729 rc = pVtab->pModule->xRename(pVtab, pName->z);
 
89730 sqlite3VtabImportErrmsg(p, pVtab);
89731 p->expired = 0;
89732 if( rc ) goto abort_due_to_error;
89733 break;
89734 }
@@ -97045,21 +97054,18 @@
97045 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
97046 }
97047 }
97048
97049 /* Fill in pNew->pLeft and pNew->pRight. */
 
97050 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
97051 zAlloc += dupedExprNodeSize(p, dupFlags);
97052 if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
97053 pNew->pLeft = p->pLeft ?
97054 exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
97055 pNew->pRight = p->pRight ?
97056 exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
97057 }
97058 if( pzBuffer ){
97059 *pzBuffer = zAlloc;
97060 }
97061 }else{
97062 #ifndef SQLITE_OMIT_WINDOWFUNC
97063 if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){
97064 pNew->pWin = 0;
97065 }else{
@@ -97075,10 +97081,13 @@
97075 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
97076 }
97077 pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
97078 }
97079 }
 
 
 
97080 }
97081 return pNew;
97082 }
97083
97084 /*
@@ -100626,22 +100635,19 @@
100626 }
100627
100628 /*
100629 ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
100630 ** If the expression node requires that the table at pWalker->iCur
100631 ** have a non-NULL column, then set pWalker->eCode to 1 and abort.
 
 
 
 
100632 */
100633 static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
100634 /* This routine is only called for WHERE clause expressions and so it
100635 ** cannot have any TK_AGG_COLUMN entries because those are only found
100636 ** in HAVING clauses. We can get a TK_AGG_FUNCTION in a WHERE clause,
100637 ** but that is an illegal construct and the query will be rejected at
100638 ** a later stage of processing, so the TK_AGG_FUNCTION case does not
100639 ** need to be considered here. */
100640 assert( pExpr->op!=TK_AGG_COLUMN );
100641 testcase( pExpr->op==TK_AGG_FUNCTION );
100642
100643 if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
100644 switch( pExpr->op ){
100645 case TK_ISNOT:
100646 case TK_NOT:
100647 case TK_ISNULL:
@@ -101296,24 +101302,10 @@
101296 v = sqlite3GetVdbe(pParse);
101297 if( v==0 ){
101298 goto exit_rename_table;
101299 }
101300
101301 /* If this is a virtual table, invoke the xRename() function if
101302 ** one is defined. The xRename() callback will modify the names
101303 ** of any resources used by the v-table implementation (including other
101304 ** SQLite tables) that are identified by the name of the virtual table.
101305 */
101306 #ifndef SQLITE_OMIT_VIRTUALTABLE
101307 if( pVTab ){
101308 int i = ++pParse->nMem;
101309 sqlite3VdbeLoadString(v, i, zName);
101310 sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
101311 sqlite3MayAbort(pParse);
101312 }
101313 #endif
101314
101315 /* figure out how many UTF-8 characters are in zName */
101316 zTabName = pTab->zName;
101317 nTabName = sqlite3Utf8CharLen(zTabName, -1);
101318
101319 /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in
@@ -101366,10 +101358,24 @@
101366 " sqlite_rename_test(%Q, sql, type, name, 1) "
101367 "THEN %Q ELSE tbl_name END "
101368 "WHERE type IN ('view', 'trigger')"
101369 , zDb, zTabName, zName, zTabName, zDb, zName);
101370 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101371
101372 renameReloadSchema(pParse, iDb);
101373 renameTestSchema(pParse, zDb, iDb==1);
101374
101375 exit_rename_table:
@@ -102549,21 +102555,24 @@
102549 sWalker.u.pRename = &sCtx;
102550
102551 rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102552
102553 if( rc==SQLITE_OK ){
 
102554 if( sParse.pNewTable ){
102555 Table *pTab = sParse.pNewTable;
102556
102557 if( pTab->pSelect ){
102558 NameContext sNC;
102559 memset(&sNC, 0, sizeof(sNC));
102560 sNC.pParse = &sParse;
 
102561
102562 sqlite3SelectPrep(&sParse, pTab->pSelect, &sNC);
102563 if( sParse.nErr ) rc = sParse.rc;
102564 sqlite3WalkSelect(&sWalker, pTab->pSelect);
 
102565 }else{
102566 /* Modify any FK definitions to point to the new table. */
102567 #ifndef SQLITE_OMIT_FOREIGN_KEY
102568 if( db->flags & SQLITE_ForeignKeys ){
102569 FKey *pFKey;
@@ -102578,19 +102587,23 @@
102578 /* If this is the table being altered, fix any table refs in CHECK
102579 ** expressions. Also update the name that appears right after the
102580 ** "CREATE [VIRTUAL] TABLE" bit. */
102581 if( sqlite3_stricmp(zOld, pTab->zName)==0 ){
102582 sCtx.pTab = pTab;
102583 sqlite3WalkExprList(&sWalker, pTab->pCheck);
 
 
102584 renameTokenFind(&sParse, &sCtx, pTab->zName);
102585 }
102586 }
102587 }
102588
102589 else if( sParse.pNewIndex ){
102590 renameTokenFind(&sParse, &sCtx, sParse.pNewIndex->zName);
102591 sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere);
 
 
102592 }
102593
102594 #ifndef SQLITE_OMIT_TRIGGER
102595 else{
102596 Trigger *pTrigger = sParse.pNewTrigger;
@@ -102599,16 +102612,18 @@
102599 && sCtx.pTab->pSchema==pTrigger->pTabSchema
102600 ){
102601 renameTokenFind(&sParse, &sCtx, sParse.pNewTrigger->table);
102602 }
102603
102604 rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102605 if( rc==SQLITE_OK ){
102606 renameWalkTrigger(&sWalker, pTrigger);
102607 for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
102608 if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
102609 renameTokenFind(&sParse, &sCtx, pStep->zTarget);
 
 
102610 }
102611 }
102612 }
102613 }
102614 #endif
@@ -102662,10 +102677,11 @@
102662 ){
102663 sqlite3 *db = sqlite3_context_db_handle(context);
102664 char const *zDb = (const char*)sqlite3_value_text(argv[0]);
102665 char const *zInput = (const char*)sqlite3_value_text(argv[1]);
102666 int bTemp = sqlite3_value_int(argv[4]);
 
102667
102668 #ifndef SQLITE_OMIT_AUTHORIZATION
102669 sqlite3_xauth xAuth = db->xAuth;
102670 db->xAuth = 0;
102671 #endif
@@ -102674,20 +102690,22 @@
102674 if( zDb && zInput ){
102675 int rc;
102676 Parse sParse;
102677 rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102678 if( rc==SQLITE_OK ){
102679 if( sParse.pNewTable && sParse.pNewTable->pSelect ){
102680 NameContext sNC;
102681 memset(&sNC, 0, sizeof(sNC));
102682 sNC.pParse = &sParse;
102683 sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, &sNC);
102684 if( sParse.nErr ) rc = sParse.rc;
102685 }
102686
102687 else if( sParse.pNewTrigger ){
102688 rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
 
 
102689 if( rc==SQLITE_OK ){
102690 int i1 = sqlite3SchemaToIndex(db, sParse.pNewTrigger->pTabSchema);
102691 int i2 = sqlite3FindDbName(db, zDb);
102692 if( i1==i2 ) sqlite3_result_int(context, 1);
102693 }
@@ -107333,14 +107351,10 @@
107333 pTab->aCol[i].notNull = OE_Abort;
107334 }
107335 }
107336 }
107337
107338 /* The remaining transformations only apply to b-tree tables, not to
107339 ** virtual tables */
107340 if( IN_DECLARE_VTAB ) return;
107341
107342 /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY
107343 ** into BTREE_BLOBKEY.
107344 */
107345 if( pParse->addrCrTab ){
107346 assert( v );
@@ -119467,10 +119481,15 @@
119467 /* ePragFlg: */ 0,
119468 /* ColNames: */ 0, 0,
119469 /* iArg: */ 0 },
119470 #endif
119471 #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
 
 
 
 
 
119472 {/* zName: */ "legacy_file_format",
119473 /* ePragTyp: */ PragTyp_FLAG,
119474 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119475 /* ColNames: */ 0, 0,
119476 /* iArg: */ SQLITE_LegacyFileFmt },
@@ -119720,11 +119739,11 @@
119720 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119721 /* ColNames: */ 0, 0,
119722 /* iArg: */ SQLITE_WriteSchema },
119723 #endif
119724 };
119725 /* Number of pragmas: 60 on by default, 77 total. */
119726
119727 /************** End of pragma.h **********************************************/
119728 /************** Continuing where we left off in pragma.c *********************/
119729
119730 /*
@@ -154761,10 +154780,11 @@
154761 sqlite3_mutex_enter(db->mutex);
154762 db->errMask = 0xff;
154763 db->nDb = 2;
154764 db->magic = SQLITE_MAGIC_BUSY;
154765 db->aDb = db->aDbStatic;
 
154766
154767 assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
154768 memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
154769 db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
154770 db->autoCommit = 1;
@@ -214422,11 +214442,11 @@
214422 int nArg, /* Number of args */
214423 sqlite3_value **apUnused /* Function arguments */
214424 ){
214425 assert( nArg==0 );
214426 UNUSED_PARAM2(nArg, apUnused);
214427 sqlite3_result_text(pCtx, "fts5: 2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386", -1, SQLITE_TRANSIENT);
214428 }
214429
214430 static int fts5Init(sqlite3 *db){
214431 static const sqlite3_module fts5Mod = {
214432 /* iVersion */ 2,
@@ -219132,12 +219152,12 @@
219132 }
219133 #endif /* SQLITE_CORE */
219134 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219135
219136 /************** End of stmt.c ************************************************/
219137 #if __LINE__!=219137
219138 #undef SQLITE_SOURCE_ID
219139 #define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460alt2"
219140 #endif
219141 /* Return the source-id for this library */
219142 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219143 /************************** End of sqlite3.c ******************************/
219144
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.25.2. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1154,13 +1154,13 @@
1154 **
1155 ** See also: [sqlite3_libversion()],
1156 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1157 ** [sqlite_version()] and [sqlite_source_id()].
1158 */
1159 #define SQLITE_VERSION "3.25.2"
1160 #define SQLITE_VERSION_NUMBER 3025002
1161 #define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e238183"
1162
1163 /*
1164 ** CAPI3REF: Run-Time Library Version Numbers
1165 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1166 **
@@ -16267,10 +16267,11 @@
16267 #define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */
16268 #define SQLITE_Fts3Tokenizer 0x00400000 /* Enable fts3_tokenizer(2) */
16269 #define SQLITE_EnableQPSG 0x00800000 /* Query Planner Stability Guarantee*/
16270 #define SQLITE_TriggerEQP 0x01000000 /* Show trigger EXPLAIN QUERY PLAN */
16271 #define SQLITE_ResetDatabase 0x02000000 /* Reset the database */
16272 #define SQLITE_LegacyAlter 0x04000000 /* Legacy ALTER TABLE behaviour */
16273
16274 /* Flags used only if debugging */
16275 #ifdef SQLITE_DEBUG
16276 #define SQLITE_SqlTrace 0x08000000 /* Debug print SQL as it executes */
16277 #define SQLITE_VdbeListing 0x10000000 /* Debug listings of VDBE programs */
@@ -32617,11 +32618,15 @@
32618 { "lstat", (sqlite3_syscall_ptr)0, 0 },
32619 #endif
32620 #define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent)
32621
32622 #if defined(__linux__) && defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
32623 # ifdef __ANDROID__
32624 { "ioctl", (sqlite3_syscall_ptr)(int(*)(int, int, ...))ioctl, 0 },
32625 # else
32626 { "ioctl", (sqlite3_syscall_ptr)ioctl, 0 },
32627 # endif
32628 #else
32629 { "ioctl", (sqlite3_syscall_ptr)0, 0 },
32630 #endif
32631 #define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent)
32632
@@ -89711,11 +89716,14 @@
89716 ** in register P1 is passed as the zName argument to the xRename method.
89717 */
89718 case OP_VRename: {
89719 sqlite3_vtab *pVtab;
89720 Mem *pName;
89721 int isLegacy;
89722
89723 isLegacy = (db->flags & SQLITE_LegacyAlter);
89724 db->flags |= SQLITE_LegacyAlter;
89725 pVtab = pOp->p4.pVtab->pVtab;
89726 pName = &aMem[pOp->p1];
89727 assert( pVtab->pModule->xRename );
89728 assert( memIsValid(pName) );
89729 assert( p->readOnly==0 );
@@ -89725,10 +89733,11 @@
89733 testcase( pName->enc==SQLITE_UTF16BE );
89734 testcase( pName->enc==SQLITE_UTF16LE );
89735 rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8);
89736 if( rc ) goto abort_due_to_error;
89737 rc = pVtab->pModule->xRename(pVtab, pName->z);
89738 if( isLegacy==0 ) db->flags &= ~SQLITE_LegacyAlter;
89739 sqlite3VtabImportErrmsg(p, pVtab);
89740 p->expired = 0;
89741 if( rc ) goto abort_due_to_error;
89742 break;
89743 }
@@ -97045,21 +97054,18 @@
97054 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
97055 }
97056 }
97057
97058 /* Fill in pNew->pLeft and pNew->pRight. */
97059 zAlloc += dupedExprNodeSize(p, dupFlags);
97060 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
 
97061 if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
97062 pNew->pLeft = p->pLeft ?
97063 exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
97064 pNew->pRight = p->pRight ?
97065 exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
97066 }
 
 
 
97067 }else{
97068 #ifndef SQLITE_OMIT_WINDOWFUNC
97069 if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){
97070 pNew->pWin = 0;
97071 }else{
@@ -97075,10 +97081,13 @@
97081 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
97082 }
97083 pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
97084 }
97085 }
97086 if( pzBuffer ){
97087 *pzBuffer = zAlloc;
97088 }
97089 }
97090 return pNew;
97091 }
97092
97093 /*
@@ -100626,22 +100635,19 @@
100635 }
100636
100637 /*
100638 ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
100639 ** If the expression node requires that the table at pWalker->iCur
100640 ** have one or more non-NULL column, then set pWalker->eCode to 1 and abort.
100641 **
100642 ** This routine controls an optimization. False positives (setting
100643 ** pWalker->eCode to 1 when it should not be) are deadly, but false-negatives
100644 ** (never setting pWalker->eCode) is a harmless missed optimization.
100645 */
100646 static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
100647 testcase( pExpr->op==TK_AGG_COLUMN );
 
 
 
 
 
 
100648 testcase( pExpr->op==TK_AGG_FUNCTION );
 
100649 if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
100650 switch( pExpr->op ){
100651 case TK_ISNOT:
100652 case TK_NOT:
100653 case TK_ISNULL:
@@ -101296,24 +101302,10 @@
101302 v = sqlite3GetVdbe(pParse);
101303 if( v==0 ){
101304 goto exit_rename_table;
101305 }
101306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101307 /* figure out how many UTF-8 characters are in zName */
101308 zTabName = pTab->zName;
101309 nTabName = sqlite3Utf8CharLen(zTabName, -1);
101310
101311 /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in
@@ -101366,10 +101358,24 @@
101358 " sqlite_rename_test(%Q, sql, type, name, 1) "
101359 "THEN %Q ELSE tbl_name END "
101360 "WHERE type IN ('view', 'trigger')"
101361 , zDb, zTabName, zName, zTabName, zDb, zName);
101362 }
101363
101364 /* If this is a virtual table, invoke the xRename() function if
101365 ** one is defined. The xRename() callback will modify the names
101366 ** of any resources used by the v-table implementation (including other
101367 ** SQLite tables) that are identified by the name of the virtual table.
101368 */
101369 #ifndef SQLITE_OMIT_VIRTUALTABLE
101370 if( pVTab ){
101371 int i = ++pParse->nMem;
101372 sqlite3VdbeLoadString(v, i, zName);
101373 sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
101374 sqlite3MayAbort(pParse);
101375 }
101376 #endif
101377
101378 renameReloadSchema(pParse, iDb);
101379 renameTestSchema(pParse, zDb, iDb==1);
101380
101381 exit_rename_table:
@@ -102549,21 +102555,24 @@
102555 sWalker.u.pRename = &sCtx;
102556
102557 rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102558
102559 if( rc==SQLITE_OK ){
102560 int isLegacy = (db->flags & SQLITE_LegacyAlter);
102561 if( sParse.pNewTable ){
102562 Table *pTab = sParse.pNewTable;
102563
102564 if( pTab->pSelect ){
102565 if( isLegacy==0 ){
102566 NameContext sNC;
102567 memset(&sNC, 0, sizeof(sNC));
102568 sNC.pParse = &sParse;
102569
102570 sqlite3SelectPrep(&sParse, pTab->pSelect, &sNC);
102571 if( sParse.nErr ) rc = sParse.rc;
102572 sqlite3WalkSelect(&sWalker, pTab->pSelect);
102573 }
102574 }else{
102575 /* Modify any FK definitions to point to the new table. */
102576 #ifndef SQLITE_OMIT_FOREIGN_KEY
102577 if( db->flags & SQLITE_ForeignKeys ){
102578 FKey *pFKey;
@@ -102578,19 +102587,23 @@
102587 /* If this is the table being altered, fix any table refs in CHECK
102588 ** expressions. Also update the name that appears right after the
102589 ** "CREATE [VIRTUAL] TABLE" bit. */
102590 if( sqlite3_stricmp(zOld, pTab->zName)==0 ){
102591 sCtx.pTab = pTab;
102592 if( isLegacy==0 ){
102593 sqlite3WalkExprList(&sWalker, pTab->pCheck);
102594 }
102595 renameTokenFind(&sParse, &sCtx, pTab->zName);
102596 }
102597 }
102598 }
102599
102600 else if( sParse.pNewIndex ){
102601 renameTokenFind(&sParse, &sCtx, sParse.pNewIndex->zName);
102602 if( isLegacy==0 ){
102603 sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere);
102604 }
102605 }
102606
102607 #ifndef SQLITE_OMIT_TRIGGER
102608 else{
102609 Trigger *pTrigger = sParse.pNewTrigger;
@@ -102599,16 +102612,18 @@
102612 && sCtx.pTab->pSchema==pTrigger->pTabSchema
102613 ){
102614 renameTokenFind(&sParse, &sCtx, sParse.pNewTrigger->table);
102615 }
102616
102617 if( isLegacy==0 ){
102618 rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102619 if( rc==SQLITE_OK ){
102620 renameWalkTrigger(&sWalker, pTrigger);
102621 for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
102622 if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
102623 renameTokenFind(&sParse, &sCtx, pStep->zTarget);
102624 }
102625 }
102626 }
102627 }
102628 }
102629 #endif
@@ -102662,10 +102677,11 @@
102677 ){
102678 sqlite3 *db = sqlite3_context_db_handle(context);
102679 char const *zDb = (const char*)sqlite3_value_text(argv[0]);
102680 char const *zInput = (const char*)sqlite3_value_text(argv[1]);
102681 int bTemp = sqlite3_value_int(argv[4]);
102682 int isLegacy = (db->flags & SQLITE_LegacyAlter);
102683
102684 #ifndef SQLITE_OMIT_AUTHORIZATION
102685 sqlite3_xauth xAuth = db->xAuth;
102686 db->xAuth = 0;
102687 #endif
@@ -102674,20 +102690,22 @@
102690 if( zDb && zInput ){
102691 int rc;
102692 Parse sParse;
102693 rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp);
102694 if( rc==SQLITE_OK ){
102695 if( isLegacy==0 && sParse.pNewTable && sParse.pNewTable->pSelect ){
102696 NameContext sNC;
102697 memset(&sNC, 0, sizeof(sNC));
102698 sNC.pParse = &sParse;
102699 sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, &sNC);
102700 if( sParse.nErr ) rc = sParse.rc;
102701 }
102702
102703 else if( sParse.pNewTrigger ){
102704 if( isLegacy==0 ){
102705 rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb);
102706 }
102707 if( rc==SQLITE_OK ){
102708 int i1 = sqlite3SchemaToIndex(db, sParse.pNewTrigger->pTabSchema);
102709 int i2 = sqlite3FindDbName(db, zDb);
102710 if( i1==i2 ) sqlite3_result_int(context, 1);
102711 }
@@ -107333,14 +107351,10 @@
107351 pTab->aCol[i].notNull = OE_Abort;
107352 }
107353 }
107354 }
107355
 
 
 
 
107356 /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY
107357 ** into BTREE_BLOBKEY.
107358 */
107359 if( pParse->addrCrTab ){
107360 assert( v );
@@ -119467,10 +119481,15 @@
119481 /* ePragFlg: */ 0,
119482 /* ColNames: */ 0, 0,
119483 /* iArg: */ 0 },
119484 #endif
119485 #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
119486 {/* zName: */ "legacy_alter_table",
119487 /* ePragTyp: */ PragTyp_FLAG,
119488 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119489 /* ColNames: */ 0, 0,
119490 /* iArg: */ SQLITE_LegacyAlter },
119491 {/* zName: */ "legacy_file_format",
119492 /* ePragTyp: */ PragTyp_FLAG,
119493 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119494 /* ColNames: */ 0, 0,
119495 /* iArg: */ SQLITE_LegacyFileFmt },
@@ -119720,11 +119739,11 @@
119739 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
119740 /* ColNames: */ 0, 0,
119741 /* iArg: */ SQLITE_WriteSchema },
119742 #endif
119743 };
119744 /* Number of pragmas: 61 on by default, 78 total. */
119745
119746 /************** End of pragma.h **********************************************/
119747 /************** Continuing where we left off in pragma.c *********************/
119748
119749 /*
@@ -154761,10 +154780,11 @@
154780 sqlite3_mutex_enter(db->mutex);
154781 db->errMask = 0xff;
154782 db->nDb = 2;
154783 db->magic = SQLITE_MAGIC_BUSY;
154784 db->aDb = db->aDbStatic;
154785 db->lookaside.bDisable = 1;
154786
154787 assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
154788 memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
154789 db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
154790 db->autoCommit = 1;
@@ -214422,11 +214442,11 @@
214442 int nArg, /* Number of args */
214443 sqlite3_value **apUnused /* Function arguments */
214444 ){
214445 assert( nArg==0 );
214446 UNUSED_PARAM2(nArg, apUnused);
214447 sqlite3_result_text(pCtx, "fts5: 2018-09-25 01:38:00 996d74f501a45ae12ddc16fe66f849993142e47ccb8b068c412d2ea9bd301ec2", -1, SQLITE_TRANSIENT);
214448 }
214449
214450 static int fts5Init(sqlite3 *db){
214451 static const sqlite3_module fts5Mod = {
214452 /* iVersion */ 2,
@@ -219132,12 +219152,12 @@
219152 }
219153 #endif /* SQLITE_CORE */
219154 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219155
219156 /************** End of stmt.c ************************************************/
219157 #if __LINE__!=219157
219158 #undef SQLITE_SOURCE_ID
219159 #define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e23alt2"
219160 #endif
219161 /* Return the source-id for this library */
219162 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219163 /************************** End of sqlite3.c ******************************/
219164
+3 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126
-#define SQLITE_VERSION "3.25.1"
127
-#define SQLITE_VERSION_NUMBER 3025001
128
-#define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386"
126
+#define SQLITE_VERSION "3.25.2"
127
+#define SQLITE_VERSION_NUMBER 3025002
128
+#define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e238183"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.25.1"
127 #define SQLITE_VERSION_NUMBER 3025001
128 #define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460b386"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.25.2"
127 #define SQLITE_VERSION_NUMBER 3025002
128 #define SQLITE_SOURCE_ID "2018-09-25 13:52:54 32ac0014266706baa4e98de808eb5a6d0ffdb39dc37b4e37668f339e9e238183"
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