Fossil SCM
Update the built-in SQLite to the 3.19.1 patch release.
Commit
4465be15d2b006aac948480a00f5e45d85c386781675ebc31c1f23acadaa78bb
Parent
09bcc322f7bcf52…
2 files changed
+18
-8
+3
-3
+18
-8
| --- 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.19.0. By combining all the individual C code files into this | |
| 3 | +** version 3.19.1. 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. |
| @@ -396,13 +396,13 @@ | ||
| 396 | 396 | ** |
| 397 | 397 | ** See also: [sqlite3_libversion()], |
| 398 | 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | 400 | */ |
| 401 | -#define SQLITE_VERSION "3.19.0" | |
| 402 | -#define SQLITE_VERSION_NUMBER 3019000 | |
| 403 | -#define SQLITE_SOURCE_ID "2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40" | |
| 401 | +#define SQLITE_VERSION "3.19.1" | |
| 402 | +#define SQLITE_VERSION_NUMBER 3019001 | |
| 403 | +#define SQLITE_SOURCE_ID "2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86" | |
| 404 | 404 | |
| 405 | 405 | /* |
| 406 | 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | 408 | ** |
| @@ -80723,10 +80723,11 @@ | ||
| 80723 | 80723 | ** If P1 is not on a NULL row, then fall through without making any |
| 80724 | 80724 | ** changes. |
| 80725 | 80725 | */ |
| 80726 | 80726 | case OP_IfNullRow: { /* jump */ |
| 80727 | 80727 | assert( pOp->p1>=0 && pOp->p1<p->nCursor ); |
| 80728 | + assert( p->apCsr[pOp->p1]!=0 ); | |
| 80728 | 80729 | if( p->apCsr[pOp->p1]->nullRow ){ |
| 80729 | 80730 | sqlite3VdbeMemSetNull(aMem + pOp->p3); |
| 80730 | 80731 | goto jump_to_p2; |
| 80731 | 80732 | } |
| 80732 | 80733 | break; |
| @@ -119724,10 +119725,13 @@ | ||
| 119724 | 119725 | sqlite3ExprDelete(db, pExpr); |
| 119725 | 119726 | pExpr = pNew; |
| 119726 | 119727 | } |
| 119727 | 119728 | } |
| 119728 | 119729 | }else{ |
| 119730 | + if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ | |
| 119731 | + pExpr->iTable = pSubst->iNewTable; | |
| 119732 | + } | |
| 119729 | 119733 | pExpr->pLeft = substExpr(pSubst, pExpr->pLeft); |
| 119730 | 119734 | pExpr->pRight = substExpr(pSubst, pExpr->pRight); |
| 119731 | 119735 | if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
| 119732 | 119736 | substSelect(pSubst, pExpr->x.pSelect, 1); |
| 119733 | 119737 | }else{ |
| @@ -119808,11 +119812,12 @@ | ||
| 119808 | 119812 | ** and (2b) the outer query does not use subqueries other than the one |
| 119809 | 119813 | ** FROM-clause subquery that is a candidate for flattening. (2b is |
| 119810 | 119814 | ** due to ticket [2f7170d73bf9abf80] from 2015-02-09.) |
| 119811 | 119815 | ** |
| 119812 | 119816 | ** (3) The subquery is not the right operand of a LEFT JOIN |
| 119813 | -** or the subquery is not itself a join. | |
| 119817 | +** or the subquery is not itself a join and the outer query is not | |
| 119818 | +** an aggregate. | |
| 119814 | 119819 | ** |
| 119815 | 119820 | ** (4) The subquery is not DISTINCT. |
| 119816 | 119821 | ** |
| 119817 | 119822 | ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT |
| 119818 | 119823 | ** sub-queries that were excluded from this optimization. Restriction |
| @@ -120003,16 +120008,21 @@ | ||
| 120003 | 120008 | ** If we flatten the above, we would get |
| 120004 | 120009 | ** |
| 120005 | 120010 | ** (t1 LEFT OUTER JOIN t2) JOIN t3 |
| 120006 | 120011 | ** |
| 120007 | 120012 | ** which is not at all the same thing. |
| 120013 | + ** | |
| 120014 | + ** If the subquery is the right operand of a LEFT JOIN, then the outer | |
| 120015 | + ** query cannot be an aggregate. This is an artifact of the way aggregates | |
| 120016 | + ** are processed - there is not mechanism to determine if the LEFT JOIN | |
| 120017 | + ** table should be all-NULL. | |
| 120008 | 120018 | ** |
| 120009 | 120019 | ** See also tickets #306, #350, and #3300. |
| 120010 | 120020 | */ |
| 120011 | 120021 | if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){ |
| 120012 | 120022 | isLeftJoin = 1; |
| 120013 | - if( pSubSrc->nSrc>1 ){ | |
| 120023 | + if( pSubSrc->nSrc>1 || isAgg ){ | |
| 120014 | 120024 | return 0; /* Restriction (3) */ |
| 120015 | 120025 | } |
| 120016 | 120026 | } |
| 120017 | 120027 | |
| 120018 | 120028 | /* Restriction 17: If the sub-query is a compound SELECT, then it must |
| @@ -143536,11 +143546,11 @@ | ||
| 143536 | 143546 | } |
| 143537 | 143547 | #endif |
| 143538 | 143548 | #if defined(SQLITE_HAS_CODEC) |
| 143539 | 143549 | if( rc==SQLITE_OK ){ |
| 143540 | 143550 | const char *zKey; |
| 143541 | - if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){; | |
| 143551 | + if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){ | |
| 143542 | 143552 | u8 iByte; |
| 143543 | 143553 | int i; |
| 143544 | 143554 | char zDecoded[40]; |
| 143545 | 143555 | for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){ |
| 143546 | 143556 | iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]); |
| @@ -199034,11 +199044,11 @@ | ||
| 199034 | 199044 | int nArg, /* Number of args */ |
| 199035 | 199045 | sqlite3_value **apUnused /* Function arguments */ |
| 199036 | 199046 | ){ |
| 199037 | 199047 | assert( nArg==0 ); |
| 199038 | 199048 | UNUSED_PARAM2(nArg, apUnused); |
| 199039 | - sqlite3_result_text(pCtx, "fts5: 2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40", -1, SQLITE_TRANSIENT); | |
| 199049 | + sqlite3_result_text(pCtx, "fts5: 2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86", -1, SQLITE_TRANSIENT); | |
| 199040 | 199050 | } |
| 199041 | 199051 | |
| 199042 | 199052 | static int fts5Init(sqlite3 *db){ |
| 199043 | 199053 | static const sqlite3_module fts5Mod = { |
| 199044 | 199054 | /* iVersion */ 2, |
| 199045 | 199055 |
| --- 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.19.0. 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. |
| @@ -396,13 +396,13 @@ | |
| 396 | ** |
| 397 | ** See also: [sqlite3_libversion()], |
| 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | */ |
| 401 | #define SQLITE_VERSION "3.19.0" |
| 402 | #define SQLITE_VERSION_NUMBER 3019000 |
| 403 | #define SQLITE_SOURCE_ID "2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40" |
| 404 | |
| 405 | /* |
| 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | ** |
| @@ -80723,10 +80723,11 @@ | |
| 80723 | ** If P1 is not on a NULL row, then fall through without making any |
| 80724 | ** changes. |
| 80725 | */ |
| 80726 | case OP_IfNullRow: { /* jump */ |
| 80727 | assert( pOp->p1>=0 && pOp->p1<p->nCursor ); |
| 80728 | if( p->apCsr[pOp->p1]->nullRow ){ |
| 80729 | sqlite3VdbeMemSetNull(aMem + pOp->p3); |
| 80730 | goto jump_to_p2; |
| 80731 | } |
| 80732 | break; |
| @@ -119724,10 +119725,13 @@ | |
| 119724 | sqlite3ExprDelete(db, pExpr); |
| 119725 | pExpr = pNew; |
| 119726 | } |
| 119727 | } |
| 119728 | }else{ |
| 119729 | pExpr->pLeft = substExpr(pSubst, pExpr->pLeft); |
| 119730 | pExpr->pRight = substExpr(pSubst, pExpr->pRight); |
| 119731 | if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
| 119732 | substSelect(pSubst, pExpr->x.pSelect, 1); |
| 119733 | }else{ |
| @@ -119808,11 +119812,12 @@ | |
| 119808 | ** and (2b) the outer query does not use subqueries other than the one |
| 119809 | ** FROM-clause subquery that is a candidate for flattening. (2b is |
| 119810 | ** due to ticket [2f7170d73bf9abf80] from 2015-02-09.) |
| 119811 | ** |
| 119812 | ** (3) The subquery is not the right operand of a LEFT JOIN |
| 119813 | ** or the subquery is not itself a join. |
| 119814 | ** |
| 119815 | ** (4) The subquery is not DISTINCT. |
| 119816 | ** |
| 119817 | ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT |
| 119818 | ** sub-queries that were excluded from this optimization. Restriction |
| @@ -120003,16 +120008,21 @@ | |
| 120003 | ** If we flatten the above, we would get |
| 120004 | ** |
| 120005 | ** (t1 LEFT OUTER JOIN t2) JOIN t3 |
| 120006 | ** |
| 120007 | ** which is not at all the same thing. |
| 120008 | ** |
| 120009 | ** See also tickets #306, #350, and #3300. |
| 120010 | */ |
| 120011 | if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){ |
| 120012 | isLeftJoin = 1; |
| 120013 | if( pSubSrc->nSrc>1 ){ |
| 120014 | return 0; /* Restriction (3) */ |
| 120015 | } |
| 120016 | } |
| 120017 | |
| 120018 | /* Restriction 17: If the sub-query is a compound SELECT, then it must |
| @@ -143536,11 +143546,11 @@ | |
| 143536 | } |
| 143537 | #endif |
| 143538 | #if defined(SQLITE_HAS_CODEC) |
| 143539 | if( rc==SQLITE_OK ){ |
| 143540 | const char *zKey; |
| 143541 | if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){; |
| 143542 | u8 iByte; |
| 143543 | int i; |
| 143544 | char zDecoded[40]; |
| 143545 | for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){ |
| 143546 | iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]); |
| @@ -199034,11 +199044,11 @@ | |
| 199034 | int nArg, /* Number of args */ |
| 199035 | sqlite3_value **apUnused /* Function arguments */ |
| 199036 | ){ |
| 199037 | assert( nArg==0 ); |
| 199038 | UNUSED_PARAM2(nArg, apUnused); |
| 199039 | sqlite3_result_text(pCtx, "fts5: 2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40", -1, SQLITE_TRANSIENT); |
| 199040 | } |
| 199041 | |
| 199042 | static int fts5Init(sqlite3 *db){ |
| 199043 | static const sqlite3_module fts5Mod = { |
| 199044 | /* iVersion */ 2, |
| 199045 |
| --- 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.19.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. |
| @@ -396,13 +396,13 @@ | |
| 396 | ** |
| 397 | ** See also: [sqlite3_libversion()], |
| 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | */ |
| 401 | #define SQLITE_VERSION "3.19.1" |
| 402 | #define SQLITE_VERSION_NUMBER 3019001 |
| 403 | #define SQLITE_SOURCE_ID "2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86" |
| 404 | |
| 405 | /* |
| 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | ** |
| @@ -80723,10 +80723,11 @@ | |
| 80723 | ** If P1 is not on a NULL row, then fall through without making any |
| 80724 | ** changes. |
| 80725 | */ |
| 80726 | case OP_IfNullRow: { /* jump */ |
| 80727 | assert( pOp->p1>=0 && pOp->p1<p->nCursor ); |
| 80728 | assert( p->apCsr[pOp->p1]!=0 ); |
| 80729 | if( p->apCsr[pOp->p1]->nullRow ){ |
| 80730 | sqlite3VdbeMemSetNull(aMem + pOp->p3); |
| 80731 | goto jump_to_p2; |
| 80732 | } |
| 80733 | break; |
| @@ -119724,10 +119725,13 @@ | |
| 119725 | sqlite3ExprDelete(db, pExpr); |
| 119726 | pExpr = pNew; |
| 119727 | } |
| 119728 | } |
| 119729 | }else{ |
| 119730 | if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ |
| 119731 | pExpr->iTable = pSubst->iNewTable; |
| 119732 | } |
| 119733 | pExpr->pLeft = substExpr(pSubst, pExpr->pLeft); |
| 119734 | pExpr->pRight = substExpr(pSubst, pExpr->pRight); |
| 119735 | if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
| 119736 | substSelect(pSubst, pExpr->x.pSelect, 1); |
| 119737 | }else{ |
| @@ -119808,11 +119812,12 @@ | |
| 119812 | ** and (2b) the outer query does not use subqueries other than the one |
| 119813 | ** FROM-clause subquery that is a candidate for flattening. (2b is |
| 119814 | ** due to ticket [2f7170d73bf9abf80] from 2015-02-09.) |
| 119815 | ** |
| 119816 | ** (3) The subquery is not the right operand of a LEFT JOIN |
| 119817 | ** or the subquery is not itself a join and the outer query is not |
| 119818 | ** an aggregate. |
| 119819 | ** |
| 119820 | ** (4) The subquery is not DISTINCT. |
| 119821 | ** |
| 119822 | ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT |
| 119823 | ** sub-queries that were excluded from this optimization. Restriction |
| @@ -120003,16 +120008,21 @@ | |
| 120008 | ** If we flatten the above, we would get |
| 120009 | ** |
| 120010 | ** (t1 LEFT OUTER JOIN t2) JOIN t3 |
| 120011 | ** |
| 120012 | ** which is not at all the same thing. |
| 120013 | ** |
| 120014 | ** If the subquery is the right operand of a LEFT JOIN, then the outer |
| 120015 | ** query cannot be an aggregate. This is an artifact of the way aggregates |
| 120016 | ** are processed - there is not mechanism to determine if the LEFT JOIN |
| 120017 | ** table should be all-NULL. |
| 120018 | ** |
| 120019 | ** See also tickets #306, #350, and #3300. |
| 120020 | */ |
| 120021 | if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){ |
| 120022 | isLeftJoin = 1; |
| 120023 | if( pSubSrc->nSrc>1 || isAgg ){ |
| 120024 | return 0; /* Restriction (3) */ |
| 120025 | } |
| 120026 | } |
| 120027 | |
| 120028 | /* Restriction 17: If the sub-query is a compound SELECT, then it must |
| @@ -143536,11 +143546,11 @@ | |
| 143546 | } |
| 143547 | #endif |
| 143548 | #if defined(SQLITE_HAS_CODEC) |
| 143549 | if( rc==SQLITE_OK ){ |
| 143550 | const char *zKey; |
| 143551 | if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){ |
| 143552 | u8 iByte; |
| 143553 | int i; |
| 143554 | char zDecoded[40]; |
| 143555 | for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){ |
| 143556 | iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]); |
| @@ -199034,11 +199044,11 @@ | |
| 199044 | int nArg, /* Number of args */ |
| 199045 | sqlite3_value **apUnused /* Function arguments */ |
| 199046 | ){ |
| 199047 | assert( nArg==0 ); |
| 199048 | UNUSED_PARAM2(nArg, apUnused); |
| 199049 | sqlite3_result_text(pCtx, "fts5: 2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86", -1, SQLITE_TRANSIENT); |
| 199050 | } |
| 199051 | |
| 199052 | static int fts5Init(sqlite3 *db){ |
| 199053 | static const sqlite3_module fts5Mod = { |
| 199054 | /* iVersion */ 2, |
| 199055 |
+3
-3
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -119,13 +119,13 @@ | ||
| 119 | 119 | ** |
| 120 | 120 | ** See also: [sqlite3_libversion()], |
| 121 | 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | 123 | */ |
| 124 | -#define SQLITE_VERSION "3.19.0" | |
| 125 | -#define SQLITE_VERSION_NUMBER 3019000 | |
| 126 | -#define SQLITE_SOURCE_ID "2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40" | |
| 124 | +#define SQLITE_VERSION "3.19.1" | |
| 125 | +#define SQLITE_VERSION_NUMBER 3019001 | |
| 126 | +#define SQLITE_SOURCE_ID "2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86" | |
| 127 | 127 | |
| 128 | 128 | /* |
| 129 | 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | 131 | ** |
| 132 | 132 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -119,13 +119,13 @@ | |
| 119 | ** |
| 120 | ** See also: [sqlite3_libversion()], |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.19.0" |
| 125 | #define SQLITE_VERSION_NUMBER 3019000 |
| 126 | #define SQLITE_SOURCE_ID "2017-05-22 13:58:13 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| 132 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -119,13 +119,13 @@ | |
| 119 | ** |
| 120 | ** See also: [sqlite3_libversion()], |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.19.1" |
| 125 | #define SQLITE_VERSION_NUMBER 3019001 |
| 126 | #define SQLITE_SOURCE_ID "2017-05-24 13:08:33 f6d7b988f40217821a382bc298180e9e6794f3ed79a83c6ef5cae048989b3f86" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| 132 |