Fossil SCM
Update to SQLite 3.25.2
Commit
c7db0ee51d86843527cac12a9c2ef6440b0bb08bcd622b2c9f1e5909ca48ece3
Parent
9d067b61eba052d…
2 files changed
+76
-56
+3
-3
+76
-56
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | /****************************************************************************** |
| 2 | 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 | |
| 3 | +** version 3.25.2. By combining all the individual C code files into this | |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| @@ -1154,13 +1154,13 @@ | ||
| 1154 | 1154 | ** |
| 1155 | 1155 | ** See also: [sqlite3_libversion()], |
| 1156 | 1156 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1157 | 1157 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1158 | 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" | |
| 1159 | +#define SQLITE_VERSION "3.25.2" | |
| 1160 | +#define SQLITE_VERSION_NUMBER 3025002 | |
| 1161 | +#define SQLITE_SOURCE_ID "2018-09-25 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7" | |
| 1162 | 1162 | |
| 1163 | 1163 | /* |
| 1164 | 1164 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1165 | 1165 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1166 | 1166 | ** |
| @@ -16267,10 +16267,11 @@ | ||
| 16267 | 16267 | #define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */ |
| 16268 | 16268 | #define SQLITE_Fts3Tokenizer 0x00400000 /* Enable fts3_tokenizer(2) */ |
| 16269 | 16269 | #define SQLITE_EnableQPSG 0x00800000 /* Query Planner Stability Guarantee*/ |
| 16270 | 16270 | #define SQLITE_TriggerEQP 0x01000000 /* Show trigger EXPLAIN QUERY PLAN */ |
| 16271 | 16271 | #define SQLITE_ResetDatabase 0x02000000 /* Reset the database */ |
| 16272 | +#define SQLITE_LegacyAlter 0x04000000 /* Legacy ALTER TABLE behaviour */ | |
| 16272 | 16273 | |
| 16273 | 16274 | /* Flags used only if debugging */ |
| 16274 | 16275 | #ifdef SQLITE_DEBUG |
| 16275 | 16276 | #define SQLITE_SqlTrace 0x08000000 /* Debug print SQL as it executes */ |
| 16276 | 16277 | #define SQLITE_VdbeListing 0x10000000 /* Debug listings of VDBE programs */ |
| @@ -32617,11 +32618,15 @@ | ||
| 32617 | 32618 | { "lstat", (sqlite3_syscall_ptr)0, 0 }, |
| 32618 | 32619 | #endif |
| 32619 | 32620 | #define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent) |
| 32620 | 32621 | |
| 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 | |
| 32622 | 32626 | { "ioctl", (sqlite3_syscall_ptr)ioctl, 0 }, |
| 32627 | +# endif | |
| 32623 | 32628 | #else |
| 32624 | 32629 | { "ioctl", (sqlite3_syscall_ptr)0, 0 }, |
| 32625 | 32630 | #endif |
| 32626 | 32631 | #define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent) |
| 32627 | 32632 | |
| @@ -89711,11 +89716,14 @@ | ||
| 89711 | 89716 | ** in register P1 is passed as the zName argument to the xRename method. |
| 89712 | 89717 | */ |
| 89713 | 89718 | case OP_VRename: { |
| 89714 | 89719 | sqlite3_vtab *pVtab; |
| 89715 | 89720 | Mem *pName; |
| 89716 | - | |
| 89721 | + int isLegacy; | |
| 89722 | + | |
| 89723 | + isLegacy = (db->flags & SQLITE_LegacyAlter); | |
| 89724 | + db->flags |= SQLITE_LegacyAlter; | |
| 89717 | 89725 | pVtab = pOp->p4.pVtab->pVtab; |
| 89718 | 89726 | pName = &aMem[pOp->p1]; |
| 89719 | 89727 | assert( pVtab->pModule->xRename ); |
| 89720 | 89728 | assert( memIsValid(pName) ); |
| 89721 | 89729 | assert( p->readOnly==0 ); |
| @@ -89725,10 +89733,11 @@ | ||
| 89725 | 89733 | testcase( pName->enc==SQLITE_UTF16BE ); |
| 89726 | 89734 | testcase( pName->enc==SQLITE_UTF16LE ); |
| 89727 | 89735 | rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8); |
| 89728 | 89736 | if( rc ) goto abort_due_to_error; |
| 89729 | 89737 | rc = pVtab->pModule->xRename(pVtab, pName->z); |
| 89738 | + if( isLegacy==0 ) db->flags &= ~SQLITE_LegacyAlter; | |
| 89730 | 89739 | sqlite3VtabImportErrmsg(p, pVtab); |
| 89731 | 89740 | p->expired = 0; |
| 89732 | 89741 | if( rc ) goto abort_due_to_error; |
| 89733 | 89742 | break; |
| 89734 | 89743 | } |
| @@ -97045,21 +97054,18 @@ | ||
| 97045 | 97054 | pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags); |
| 97046 | 97055 | } |
| 97047 | 97056 | } |
| 97048 | 97057 | |
| 97049 | 97058 | /* Fill in pNew->pLeft and pNew->pRight. */ |
| 97059 | + zAlloc += dupedExprNodeSize(p, dupFlags); | |
| 97050 | 97060 | if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){ |
| 97051 | - zAlloc += dupedExprNodeSize(p, dupFlags); | |
| 97052 | 97061 | if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){ |
| 97053 | 97062 | pNew->pLeft = p->pLeft ? |
| 97054 | 97063 | exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0; |
| 97055 | 97064 | pNew->pRight = p->pRight ? |
| 97056 | 97065 | exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0; |
| 97057 | 97066 | } |
| 97058 | - if( pzBuffer ){ | |
| 97059 | - *pzBuffer = zAlloc; | |
| 97060 | - } | |
| 97061 | 97067 | }else{ |
| 97062 | 97068 | #ifndef SQLITE_OMIT_WINDOWFUNC |
| 97063 | 97069 | if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){ |
| 97064 | 97070 | pNew->pWin = 0; |
| 97065 | 97071 | }else{ |
| @@ -97075,10 +97081,13 @@ | ||
| 97075 | 97081 | pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0); |
| 97076 | 97082 | } |
| 97077 | 97083 | pNew->pRight = sqlite3ExprDup(db, p->pRight, 0); |
| 97078 | 97084 | } |
| 97079 | 97085 | } |
| 97086 | + if( pzBuffer ){ | |
| 97087 | + *pzBuffer = zAlloc; | |
| 97088 | + } | |
| 97080 | 97089 | } |
| 97081 | 97090 | return pNew; |
| 97082 | 97091 | } |
| 97083 | 97092 | |
| 97084 | 97093 | /* |
| @@ -100626,22 +100635,19 @@ | ||
| 100626 | 100635 | } |
| 100627 | 100636 | |
| 100628 | 100637 | /* |
| 100629 | 100638 | ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow(). |
| 100630 | 100639 | ** 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. | |
| 100632 | 100645 | */ |
| 100633 | 100646 | 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 ); | |
| 100641 | 100648 | testcase( pExpr->op==TK_AGG_FUNCTION ); |
| 100642 | - | |
| 100643 | 100649 | if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune; |
| 100644 | 100650 | switch( pExpr->op ){ |
| 100645 | 100651 | case TK_ISNOT: |
| 100646 | 100652 | case TK_NOT: |
| 100647 | 100653 | case TK_ISNULL: |
| @@ -101296,24 +101302,10 @@ | ||
| 101296 | 101302 | v = sqlite3GetVdbe(pParse); |
| 101297 | 101303 | if( v==0 ){ |
| 101298 | 101304 | goto exit_rename_table; |
| 101299 | 101305 | } |
| 101300 | 101306 | |
| 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 | 101307 | /* figure out how many UTF-8 characters are in zName */ |
| 101316 | 101308 | zTabName = pTab->zName; |
| 101317 | 101309 | nTabName = sqlite3Utf8CharLen(zTabName, -1); |
| 101318 | 101310 | |
| 101319 | 101311 | /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in |
| @@ -101366,10 +101358,24 @@ | ||
| 101366 | 101358 | " sqlite_rename_test(%Q, sql, type, name, 1) " |
| 101367 | 101359 | "THEN %Q ELSE tbl_name END " |
| 101368 | 101360 | "WHERE type IN ('view', 'trigger')" |
| 101369 | 101361 | , zDb, zTabName, zName, zTabName, zDb, zName); |
| 101370 | 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 | |
| 101371 | 101377 | |
| 101372 | 101378 | renameReloadSchema(pParse, iDb); |
| 101373 | 101379 | renameTestSchema(pParse, zDb, iDb==1); |
| 101374 | 101380 | |
| 101375 | 101381 | exit_rename_table: |
| @@ -102549,21 +102555,24 @@ | ||
| 102549 | 102555 | sWalker.u.pRename = &sCtx; |
| 102550 | 102556 | |
| 102551 | 102557 | rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp); |
| 102552 | 102558 | |
| 102553 | 102559 | if( rc==SQLITE_OK ){ |
| 102560 | + int isLegacy = (db->flags & SQLITE_LegacyAlter); | |
| 102554 | 102561 | if( sParse.pNewTable ){ |
| 102555 | 102562 | Table *pTab = sParse.pNewTable; |
| 102556 | 102563 | |
| 102557 | 102564 | 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; | |
| 102561 | 102569 | |
| 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 | + } | |
| 102565 | 102574 | }else{ |
| 102566 | 102575 | /* Modify any FK definitions to point to the new table. */ |
| 102567 | 102576 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 102568 | 102577 | if( db->flags & SQLITE_ForeignKeys ){ |
| 102569 | 102578 | FKey *pFKey; |
| @@ -102578,19 +102587,23 @@ | ||
| 102578 | 102587 | /* If this is the table being altered, fix any table refs in CHECK |
| 102579 | 102588 | ** expressions. Also update the name that appears right after the |
| 102580 | 102589 | ** "CREATE [VIRTUAL] TABLE" bit. */ |
| 102581 | 102590 | if( sqlite3_stricmp(zOld, pTab->zName)==0 ){ |
| 102582 | 102591 | sCtx.pTab = pTab; |
| 102583 | - sqlite3WalkExprList(&sWalker, pTab->pCheck); | |
| 102592 | + if( isLegacy==0 ){ | |
| 102593 | + sqlite3WalkExprList(&sWalker, pTab->pCheck); | |
| 102594 | + } | |
| 102584 | 102595 | renameTokenFind(&sParse, &sCtx, pTab->zName); |
| 102585 | 102596 | } |
| 102586 | 102597 | } |
| 102587 | 102598 | } |
| 102588 | 102599 | |
| 102589 | 102600 | else if( sParse.pNewIndex ){ |
| 102590 | 102601 | renameTokenFind(&sParse, &sCtx, sParse.pNewIndex->zName); |
| 102591 | - sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere); | |
| 102602 | + if( isLegacy==0 ){ | |
| 102603 | + sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere); | |
| 102604 | + } | |
| 102592 | 102605 | } |
| 102593 | 102606 | |
| 102594 | 102607 | #ifndef SQLITE_OMIT_TRIGGER |
| 102595 | 102608 | else{ |
| 102596 | 102609 | Trigger *pTrigger = sParse.pNewTrigger; |
| @@ -102599,16 +102612,18 @@ | ||
| 102599 | 102612 | && sCtx.pTab->pSchema==pTrigger->pTabSchema |
| 102600 | 102613 | ){ |
| 102601 | 102614 | renameTokenFind(&sParse, &sCtx, sParse.pNewTrigger->table); |
| 102602 | 102615 | } |
| 102603 | 102616 | |
| 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 | + } | |
| 102610 | 102625 | } |
| 102611 | 102626 | } |
| 102612 | 102627 | } |
| 102613 | 102628 | } |
| 102614 | 102629 | #endif |
| @@ -102662,10 +102677,11 @@ | ||
| 102662 | 102677 | ){ |
| 102663 | 102678 | sqlite3 *db = sqlite3_context_db_handle(context); |
| 102664 | 102679 | char const *zDb = (const char*)sqlite3_value_text(argv[0]); |
| 102665 | 102680 | char const *zInput = (const char*)sqlite3_value_text(argv[1]); |
| 102666 | 102681 | int bTemp = sqlite3_value_int(argv[4]); |
| 102682 | + int isLegacy = (db->flags & SQLITE_LegacyAlter); | |
| 102667 | 102683 | |
| 102668 | 102684 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 102669 | 102685 | sqlite3_xauth xAuth = db->xAuth; |
| 102670 | 102686 | db->xAuth = 0; |
| 102671 | 102687 | #endif |
| @@ -102674,20 +102690,22 @@ | ||
| 102674 | 102690 | if( zDb && zInput ){ |
| 102675 | 102691 | int rc; |
| 102676 | 102692 | Parse sParse; |
| 102677 | 102693 | rc = renameParseSql(&sParse, zDb, 1, db, zInput, bTemp); |
| 102678 | 102694 | if( rc==SQLITE_OK ){ |
| 102679 | - if( sParse.pNewTable && sParse.pNewTable->pSelect ){ | |
| 102695 | + if( isLegacy==0 && sParse.pNewTable && sParse.pNewTable->pSelect ){ | |
| 102680 | 102696 | NameContext sNC; |
| 102681 | 102697 | memset(&sNC, 0, sizeof(sNC)); |
| 102682 | 102698 | sNC.pParse = &sParse; |
| 102683 | 102699 | sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, &sNC); |
| 102684 | 102700 | if( sParse.nErr ) rc = sParse.rc; |
| 102685 | 102701 | } |
| 102686 | 102702 | |
| 102687 | 102703 | else if( sParse.pNewTrigger ){ |
| 102688 | - rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb); | |
| 102704 | + if( isLegacy==0 ){ | |
| 102705 | + rc = renameResolveTrigger(&sParse, bTemp ? 0 : zDb); | |
| 102706 | + } | |
| 102689 | 102707 | if( rc==SQLITE_OK ){ |
| 102690 | 102708 | int i1 = sqlite3SchemaToIndex(db, sParse.pNewTrigger->pTabSchema); |
| 102691 | 102709 | int i2 = sqlite3FindDbName(db, zDb); |
| 102692 | 102710 | if( i1==i2 ) sqlite3_result_int(context, 1); |
| 102693 | 102711 | } |
| @@ -107333,14 +107351,10 @@ | ||
| 107333 | 107351 | pTab->aCol[i].notNull = OE_Abort; |
| 107334 | 107352 | } |
| 107335 | 107353 | } |
| 107336 | 107354 | } |
| 107337 | 107355 | |
| 107338 | - /* The remaining transformations only apply to b-tree tables, not to | |
| 107339 | - ** virtual tables */ | |
| 107340 | - if( IN_DECLARE_VTAB ) return; | |
| 107341 | - | |
| 107342 | 107356 | /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY |
| 107343 | 107357 | ** into BTREE_BLOBKEY. |
| 107344 | 107358 | */ |
| 107345 | 107359 | if( pParse->addrCrTab ){ |
| 107346 | 107360 | assert( v ); |
| @@ -119467,10 +119481,15 @@ | ||
| 119467 | 119481 | /* ePragFlg: */ 0, |
| 119468 | 119482 | /* ColNames: */ 0, 0, |
| 119469 | 119483 | /* iArg: */ 0 }, |
| 119470 | 119484 | #endif |
| 119471 | 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 }, | |
| 119472 | 119491 | {/* zName: */ "legacy_file_format", |
| 119473 | 119492 | /* ePragTyp: */ PragTyp_FLAG, |
| 119474 | 119493 | /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1, |
| 119475 | 119494 | /* ColNames: */ 0, 0, |
| 119476 | 119495 | /* iArg: */ SQLITE_LegacyFileFmt }, |
| @@ -119720,11 +119739,11 @@ | ||
| 119720 | 119739 | /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1, |
| 119721 | 119740 | /* ColNames: */ 0, 0, |
| 119722 | 119741 | /* iArg: */ SQLITE_WriteSchema }, |
| 119723 | 119742 | #endif |
| 119724 | 119743 | }; |
| 119725 | -/* Number of pragmas: 60 on by default, 77 total. */ | |
| 119744 | +/* Number of pragmas: 61 on by default, 78 total. */ | |
| 119726 | 119745 | |
| 119727 | 119746 | /************** End of pragma.h **********************************************/ |
| 119728 | 119747 | /************** Continuing where we left off in pragma.c *********************/ |
| 119729 | 119748 | |
| 119730 | 119749 | /* |
| @@ -154761,10 +154780,11 @@ | ||
| 154761 | 154780 | sqlite3_mutex_enter(db->mutex); |
| 154762 | 154781 | db->errMask = 0xff; |
| 154763 | 154782 | db->nDb = 2; |
| 154764 | 154783 | db->magic = SQLITE_MAGIC_BUSY; |
| 154765 | 154784 | db->aDb = db->aDbStatic; |
| 154785 | + db->lookaside.bDisable = 1; | |
| 154766 | 154786 | |
| 154767 | 154787 | assert( sizeof(db->aLimit)==sizeof(aHardLimit) ); |
| 154768 | 154788 | memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit)); |
| 154769 | 154789 | db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS; |
| 154770 | 154790 | db->autoCommit = 1; |
| @@ -214422,11 +214442,11 @@ | ||
| 214422 | 214442 | int nArg, /* Number of args */ |
| 214423 | 214443 | sqlite3_value **apUnused /* Function arguments */ |
| 214424 | 214444 | ){ |
| 214425 | 214445 | assert( nArg==0 ); |
| 214426 | 214446 | 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 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7", -1, SQLITE_TRANSIENT); | |
| 214428 | 214448 | } |
| 214429 | 214449 | |
| 214430 | 214450 | static int fts5Init(sqlite3 *db){ |
| 214431 | 214451 | static const sqlite3_module fts5Mod = { |
| 214432 | 214452 | /* iVersion */ 2, |
| @@ -219132,12 +219152,12 @@ | ||
| 219132 | 219152 | } |
| 219133 | 219153 | #endif /* SQLITE_CORE */ |
| 219134 | 219154 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 219135 | 219155 | |
| 219136 | 219156 | /************** End of stmt.c ************************************************/ |
| 219137 | -#if __LINE__!=219137 | |
| 219157 | +#if __LINE__!=219157 | |
| 219138 | 219158 | #undef SQLITE_SOURCE_ID |
| 219139 | -#define SQLITE_SOURCE_ID "2018-09-18 20:20:44 2ac9003de44da7dafa3fbb1915ac5725a9275c86bf2f3b7aa19321bf1460alt2" | |
| 219159 | +#define SQLITE_SOURCE_ID "2018-09-25 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792alt2" | |
| 219140 | 219160 | #endif |
| 219141 | 219161 | /* Return the source-id for this library */ |
| 219142 | 219162 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 219143 | 219163 | /************************** End of sqlite3.c ******************************/ |
| 219144 | 219164 |
| --- 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 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7" |
| 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 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7", -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 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792alt2" |
| 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 @@ | ||
| 121 | 121 | ** |
| 122 | 122 | ** See also: [sqlite3_libversion()], |
| 123 | 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | 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" | |
| 126 | +#define SQLITE_VERSION "3.25.2" | |
| 127 | +#define SQLITE_VERSION_NUMBER 3025002 | |
| 128 | +#define SQLITE_SOURCE_ID "2018-09-25 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7" | |
| 129 | 129 | |
| 130 | 130 | /* |
| 131 | 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | 133 | ** |
| 134 | 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.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 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7" |
| 129 | |
| 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | ** |
| 134 |