Fossil SCM

Update the built-in SQLite to the 3.19.1 patch release.

drh 2017-05-24 13:19 trunk
Commit 4465be15d2b006aac948480a00f5e45d85c386781675ebc31c1f23acadaa78bb
2 files changed +18 -8 +3 -3
+18 -8
--- 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.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
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.
@@ -396,13 +396,13 @@
396396
**
397397
** See also: [sqlite3_libversion()],
398398
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
399399
** [sqlite_version()] and [sqlite_source_id()].
400400
*/
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"
404404
405405
/*
406406
** CAPI3REF: Run-Time Library Version Numbers
407407
** KEYWORDS: sqlite3_version sqlite3_sourceid
408408
**
@@ -80723,10 +80723,11 @@
8072380723
** If P1 is not on a NULL row, then fall through without making any
8072480724
** changes.
8072580725
*/
8072680726
case OP_IfNullRow: { /* jump */
8072780727
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
80728
+ assert( p->apCsr[pOp->p1]!=0 );
8072880729
if( p->apCsr[pOp->p1]->nullRow ){
8072980730
sqlite3VdbeMemSetNull(aMem + pOp->p3);
8073080731
goto jump_to_p2;
8073180732
}
8073280733
break;
@@ -119724,10 +119725,13 @@
119724119725
sqlite3ExprDelete(db, pExpr);
119725119726
pExpr = pNew;
119726119727
}
119727119728
}
119728119729
}else{
119730
+ if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){
119731
+ pExpr->iTable = pSubst->iNewTable;
119732
+ }
119729119733
pExpr->pLeft = substExpr(pSubst, pExpr->pLeft);
119730119734
pExpr->pRight = substExpr(pSubst, pExpr->pRight);
119731119735
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
119732119736
substSelect(pSubst, pExpr->x.pSelect, 1);
119733119737
}else{
@@ -119808,11 +119812,12 @@
119808119812
** and (2b) the outer query does not use subqueries other than the one
119809119813
** FROM-clause subquery that is a candidate for flattening. (2b is
119810119814
** due to ticket [2f7170d73bf9abf80] from 2015-02-09.)
119811119815
**
119812119816
** (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.
119814119819
**
119815119820
** (4) The subquery is not DISTINCT.
119816119821
**
119817119822
** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT
119818119823
** sub-queries that were excluded from this optimization. Restriction
@@ -120003,16 +120008,21 @@
120003120008
** If we flatten the above, we would get
120004120009
**
120005120010
** (t1 LEFT OUTER JOIN t2) JOIN t3
120006120011
**
120007120012
** 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.
120008120018
**
120009120019
** See also tickets #306, #350, and #3300.
120010120020
*/
120011120021
if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){
120012120022
isLeftJoin = 1;
120013
- if( pSubSrc->nSrc>1 ){
120023
+ if( pSubSrc->nSrc>1 || isAgg ){
120014120024
return 0; /* Restriction (3) */
120015120025
}
120016120026
}
120017120027
120018120028
/* Restriction 17: If the sub-query is a compound SELECT, then it must
@@ -143536,11 +143546,11 @@
143536143546
}
143537143547
#endif
143538143548
#if defined(SQLITE_HAS_CODEC)
143539143549
if( rc==SQLITE_OK ){
143540143550
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] ){
143542143552
u8 iByte;
143543143553
int i;
143544143554
char zDecoded[40];
143545143555
for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){
143546143556
iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]);
@@ -199034,11 +199044,11 @@
199034199044
int nArg, /* Number of args */
199035199045
sqlite3_value **apUnused /* Function arguments */
199036199046
){
199037199047
assert( nArg==0 );
199038199048
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);
199040199050
}
199041199051
199042199052
static int fts5Init(sqlite3 *db){
199043199053
static const sqlite3_module fts5Mod = {
199044199054
/* iVersion */ 2,
199045199055
--- 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 @@
119119
**
120120
** See also: [sqlite3_libversion()],
121121
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122122
** [sqlite_version()] and [sqlite_source_id()].
123123
*/
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"
127127
128128
/*
129129
** CAPI3REF: Run-Time Library Version Numbers
130130
** KEYWORDS: sqlite3_version sqlite3_sourceid
131131
**
132132
--- 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

Keyboard Shortcuts

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