Fossil SCM

Update the built-in SQLite to the latest 3.29.0 alpha that includes compiler warning fixes.

drh 2019-06-13 14:10 trunk
Commit 7b7f5df8911f5d89bd2df1ed830c9c97961225d112f8580b3b7cc28c8cfdaf37
3 files changed +6 -4 +114 -80 +9 -3
+6 -4
--- src/shell.c
+++ src/shell.c
@@ -15105,11 +15105,11 @@
1510515105
int bFreelist = 1; /* 0 if --freelist-corrupt is specified */
1510615106
for(i=1; i<nArg; i++){
1510715107
char *z = azArg[i];
1510815108
int n;
1510915109
if( z[0]=='-' && z[1]=='-' ) z++;
15110
- n = strlen(z);
15110
+ n = strlen30(z);
1511115111
if( n<=17 && memcmp("-freelist-corrupt", z, n)==0 ){
1511215112
bFreelist = 0;
1511315113
}else
1511415114
if( n<=12 && memcmp("-recovery-db", z, n)==0 && i<(nArg-1) ){
1511515115
i++;
@@ -15842,12 +15842,12 @@
1584215842
{ "has_moved", SQLITE_FCNTL_HAS_MOVED, "" },
1584315843
{ "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" },
1584415844
};
1584515845
int filectrl = -1;
1584615846
int iCtrl = -1;
15847
- sqlite3_int64 iRes; /* Integer result to display if rc2==1 */
15848
- int isOk = 0; /* 0: usage 1: %lld 2: no-result */
15847
+ sqlite3_int64 iRes = 0; /* Integer result to display if rc2==1 */
15848
+ int isOk = 0; /* 0: usage 1: %lld 2: no-result */
1584915849
int n2, i;
1585015850
const char *zCmd = 0;
1585115851
1585215852
open_db(p, 0);
1585315853
zCmd = nArg>=2 ? azArg[1] : "help";
@@ -15939,11 +15939,13 @@
1593915939
}
1594015940
if( isOk==0 && iCtrl>=0 ){
1594115941
utf8_printf(p->out, "Usage: .filectrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage);
1594215942
rc = 1;
1594315943
}else if( isOk==1 ){
15944
- raw_printf(p->out, "%lld\n", iRes);
15944
+ char zBuf[100];
15945
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", iRes);
15946
+ raw_printf(p->out, "%s\n", zBuf);
1594515947
}
1594615948
}else
1594715949
1594815950
if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){
1594915951
ShellState data;
1595015952
--- src/shell.c
+++ src/shell.c
@@ -15105,11 +15105,11 @@
15105 int bFreelist = 1; /* 0 if --freelist-corrupt is specified */
15106 for(i=1; i<nArg; i++){
15107 char *z = azArg[i];
15108 int n;
15109 if( z[0]=='-' && z[1]=='-' ) z++;
15110 n = strlen(z);
15111 if( n<=17 && memcmp("-freelist-corrupt", z, n)==0 ){
15112 bFreelist = 0;
15113 }else
15114 if( n<=12 && memcmp("-recovery-db", z, n)==0 && i<(nArg-1) ){
15115 i++;
@@ -15842,12 +15842,12 @@
15842 { "has_moved", SQLITE_FCNTL_HAS_MOVED, "" },
15843 { "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" },
15844 };
15845 int filectrl = -1;
15846 int iCtrl = -1;
15847 sqlite3_int64 iRes; /* Integer result to display if rc2==1 */
15848 int isOk = 0; /* 0: usage 1: %lld 2: no-result */
15849 int n2, i;
15850 const char *zCmd = 0;
15851
15852 open_db(p, 0);
15853 zCmd = nArg>=2 ? azArg[1] : "help";
@@ -15939,11 +15939,13 @@
15939 }
15940 if( isOk==0 && iCtrl>=0 ){
15941 utf8_printf(p->out, "Usage: .filectrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage);
15942 rc = 1;
15943 }else if( isOk==1 ){
15944 raw_printf(p->out, "%lld\n", iRes);
 
 
15945 }
15946 }else
15947
15948 if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){
15949 ShellState data;
15950
--- src/shell.c
+++ src/shell.c
@@ -15105,11 +15105,11 @@
15105 int bFreelist = 1; /* 0 if --freelist-corrupt is specified */
15106 for(i=1; i<nArg; i++){
15107 char *z = azArg[i];
15108 int n;
15109 if( z[0]=='-' && z[1]=='-' ) z++;
15110 n = strlen30(z);
15111 if( n<=17 && memcmp("-freelist-corrupt", z, n)==0 ){
15112 bFreelist = 0;
15113 }else
15114 if( n<=12 && memcmp("-recovery-db", z, n)==0 && i<(nArg-1) ){
15115 i++;
@@ -15842,12 +15842,12 @@
15842 { "has_moved", SQLITE_FCNTL_HAS_MOVED, "" },
15843 { "lock_timeout", SQLITE_FCNTL_LOCK_TIMEOUT, "MILLISEC" },
15844 };
15845 int filectrl = -1;
15846 int iCtrl = -1;
15847 sqlite3_int64 iRes = 0; /* Integer result to display if rc2==1 */
15848 int isOk = 0; /* 0: usage 1: %lld 2: no-result */
15849 int n2, i;
15850 const char *zCmd = 0;
15851
15852 open_db(p, 0);
15853 zCmd = nArg>=2 ? azArg[1] : "help";
@@ -15939,11 +15939,13 @@
15939 }
15940 if( isOk==0 && iCtrl>=0 ){
15941 utf8_printf(p->out, "Usage: .filectrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage);
15942 rc = 1;
15943 }else if( isOk==1 ){
15944 char zBuf[100];
15945 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", iRes);
15946 raw_printf(p->out, "%s\n", zBuf);
15947 }
15948 }else
15949
15950 if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){
15951 ShellState data;
15952
+114 -80
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1167,11 +1167,11 @@
11671167
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11681168
** [sqlite_version()] and [sqlite_source_id()].
11691169
*/
11701170
#define SQLITE_VERSION "3.29.0"
11711171
#define SQLITE_VERSION_NUMBER 3029000
1172
-#define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872466c"
1172
+#define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4"
11731173
11741174
/*
11751175
** CAPI3REF: Run-Time Library Version Numbers
11761176
** KEYWORDS: sqlite3_version sqlite3_sourceid
11771177
**
@@ -2338,12 +2338,18 @@
23382338
**
23392339
** [[sqlite3_vfs.xAccess]]
23402340
** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
23412341
** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
23422342
** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
2343
-** to test whether a file is at least readable. The file can be a
2344
-** directory.
2343
+** to test whether a file is at least readable. The SQLITE_ACCESS_READ
2344
+** flag is never actually used and is not implemented in the built-in
2345
+** VFSes of SQLite. The file is named by the second argument and can be a
2346
+** directory. The xAccess method returns [SQLITE_OK] on success or some
2347
+** non-zero error code if there is an I/O error or if the name of
2348
+** the file given in the second argument is illegal. If SQLITE_OK
2349
+** is returned, then non-zero or zero is written into *pResOut to indicate
2350
+** whether or not the file is accessible.
23452351
**
23462352
** ^SQLite will always allocate at least mxPathname+1 bytes for the
23472353
** output buffer xFullPathname. The exact size of the output buffer
23482354
** is also passed as a parameter to both methods. If the output buffer
23492355
** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
@@ -17444,11 +17450,11 @@
1744417450
#define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
1744517451
#define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */
1744617452
#define EP_Generic 0x000200 /* Ignore COLLATE or affinity on this tree */
1744717453
#define EP_IntValue 0x000400 /* Integer value contained in u.iValue */
1744817454
#define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */
17449
-#define EP_Skip 0x001000 /* COLLATE, AS, or UNLIKELY */
17455
+#define EP_Skip 0x001000 /* Operator does not contribute to affinity */
1745017456
#define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
1745117457
#define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
1745217458
#define EP_Win 0x008000 /* Contains window functions */
1745317459
#define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */
1745417460
#define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */
@@ -18799,10 +18805,11 @@
1879918805
SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse*,Expr*, Expr*);
1880018806
SQLITE_PRIVATE Expr *sqlite3ExprSimplifiedAndOr(Expr*);
1880118807
SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int);
1880218808
SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
1880318809
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
18810
+SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
1880418811
SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
1880518812
SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
1880618813
SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
1880718814
SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
1880818815
SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
@@ -21327,11 +21334,11 @@
2132721334
return 0;
2132821335
}else if( parseHhMmSs(zDate, p)==0 ){
2132921336
return 0;
2133021337
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
2133121338
return setDateTimeToCurrent(context, p);
21332
- }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8) ){
21339
+ }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
2133321340
setRawDateNumber(p, r);
2133421341
return 0;
2133521342
}
2133621343
return 1;
2133721344
}
@@ -21661,11 +21668,11 @@
2166121668
** Move the date to the same time on the next occurrence of
2166221669
** weekday N where 0==Sunday, 1==Monday, and so forth. If the
2166321670
** date is already on the appropriate weekday, this is a no-op.
2166421671
*/
2166521672
if( sqlite3_strnicmp(z, "weekday ", 8)==0
21666
- && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)
21673
+ && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
2166721674
&& (n=(int)r)==r && n>=0 && r<7 ){
2166821675
sqlite3_int64 Z;
2166921676
computeYMD_HMS(p);
2167021677
p->validTZ = 0;
2167121678
p->validJD = 0;
@@ -21720,11 +21727,11 @@
2172021727
case '8':
2172121728
case '9': {
2172221729
double rRounder;
2172321730
int i;
2172421731
for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){}
21725
- if( !sqlite3AtoF(z, &r, n, SQLITE_UTF8) ){
21732
+ if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
2172621733
rc = 1;
2172721734
break;
2172821735
}
2172921736
if( z[n]==':' ){
2173021737
/* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
@@ -29068,11 +29075,11 @@
2906829075
const char *azOp[] = {
2906929076
"IS-FALSE", "IS-TRUE", "IS-NOT-FALSE", "IS-NOT-TRUE"
2907029077
};
2907129078
assert( pExpr->op2==TK_IS || pExpr->op2==TK_ISNOT );
2907229079
assert( pExpr->pRight );
29073
- assert( pExpr->pRight->op==TK_TRUEFALSE );
29080
+ assert( sqlite3ExprSkipCollate(pExpr->pRight)->op==TK_TRUEFALSE );
2907429081
x = (pExpr->op2==TK_ISNOT)*2 + sqlite3ExprTruthValue(pExpr->pRight);
2907529082
zUniOp = azOp[x];
2907629083
break;
2907729084
}
2907829085
@@ -30598,11 +30605,13 @@
3059830605
** Return TRUE if the result is a valid real number (or integer) and FALSE
3059930606
** if the string is empty or contains extraneous text. More specifically
3060030607
** return
3060130608
** 1 => The input string is a pure integer
3060230609
** 2 or more => The input has a decimal point or eNNN clause
30603
-** 0 => The input string is not a valid number
30610
+** 0 or less => The input string is not a valid number
30611
+** -1 => Not a valid number, but has a valid prefix which
30612
+** includes a decimal point and/or an eNNN clause
3060430613
**
3060530614
** Valid numbers are in one of these formats:
3060630615
**
3060730616
** [+-]digits[E[+-]digits]
3060830617
** [+-]digits.[digits][E[+-]digits]
@@ -30789,11 +30798,17 @@
3078930798
3079030799
/* store the result */
3079130800
*pResult = result;
3079230801
3079330802
/* return true if number and no extra non-whitespace chracters after */
30794
- return z==zEnd && nDigit>0 && eValid && eType>0 ? eType : 0;
30803
+ if( z==zEnd && nDigit>0 && eValid && eType>0 ){
30804
+ return eType;
30805
+ }else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){
30806
+ return -1;
30807
+ }else{
30808
+ return 0;
30809
+ }
3079530810
#else
3079630811
return !sqlite3Atoi64(z, pResult, length, enc);
3079730812
#endif /* SQLITE_OMIT_FLOATING_POINT */
3079830813
}
3079930814
@@ -30832,10 +30847,11 @@
3083230847
** Convert zNum to a 64-bit signed integer. zNum must be decimal. This
3083330848
** routine does *not* accept hexadecimal notation.
3083430849
**
3083530850
** Returns:
3083630851
**
30852
+** -1 Not even a prefix of the input text looks like an integer
3083730853
** 0 Successful transformation. Fits in a 64-bit signed integer.
3083830854
** 1 Excess non-space text after the integer value
3083930855
** 2 Integer too large for a 64-bit signed integer or is malformed
3084030856
** 3 Special case of 9223372036854775808
3084130857
**
@@ -30891,13 +30907,13 @@
3089130907
*pNum = -(i64)u;
3089230908
}else{
3089330909
*pNum = (i64)u;
3089430910
}
3089530911
rc = 0;
30896
- if( (i==0 && zStart==zNum) /* No digits */
30897
- || nonNum /* UTF16 with high-order bytes non-zero */
30898
- ){
30912
+ if( i==0 && zStart==zNum ){ /* No digits */
30913
+ rc = -1;
30914
+ }else if( nonNum ){ /* UTF16 with high-order bytes non-zero */
3089930915
rc = 1;
3090030916
}else if( &zNum[i]<zEnd ){ /* Extra bytes at the end */
3090130917
int jj = i;
3090230918
do{
3090330919
if( !sqlite3Isspace(zNum[jj]) ){
@@ -48009,13 +48025,14 @@
4800948025
if( p->szCache>=0 ){
4801048026
/* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
4801148027
** suggested cache size is set to N. */
4801248028
return p->szCache;
4801348029
}else{
48014
- /* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
48015
- ** the number of cache pages is adjusted to use approximately abs(N*1024)
48016
- ** bytes of memory. */
48030
+ /* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
48031
+ ** number of cache pages is adjusted to be a number of pages that would
48032
+ ** use approximately abs(N*1024) bytes of memory based on the current
48033
+ ** page size. */
4801748034
return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
4801848035
}
4801948036
}
4802048037
4802148038
/*************************************************** General Interfaces ******
@@ -75137,18 +75154,22 @@
7513775154
return SQLITE_OK;
7513875155
}
7513975156
7514075157
/* Compare a floating point value to an integer. Return true if the two
7514175158
** values are the same within the precision of the floating point value.
75159
+**
75160
+** This function assumes that i was obtained by assignment from r1.
7514275161
**
7514375162
** For some versions of GCC on 32-bit machines, if you do the more obvious
7514475163
** comparison of "r1==(double)i" you sometimes get an answer of false even
7514575164
** though the r1 and (double)i values are bit-for-bit the same.
7514675165
*/
7514775166
SQLITE_PRIVATE int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
7514875167
double r2 = (double)i;
75149
- return memcmp(&r1, &r2, sizeof(r1))==0;
75168
+ return r1==0.0
75169
+ || (memcmp(&r1, &r2, sizeof(r1))==0
75170
+ && i >= -2251799813685248 && i < 2251799813685248);
7515075171
}
7515175172
7515275173
/*
7515375174
** Convert pMem so that it has type MEM_Real or MEM_Int.
7515475175
** Invalidate any prior representations.
@@ -75162,24 +75183,21 @@
7516275183
testcase( pMem->flags & MEM_Real );
7516375184
testcase( pMem->flags & MEM_IntReal );
7516475185
testcase( pMem->flags & MEM_Null );
7516575186
if( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))==0 ){
7516675187
int rc;
75188
+ sqlite3_int64 ix;
7516775189
assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
7516875190
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
75169
- rc = sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc);
75170
- if( rc==0 ){
75191
+ rc = sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
75192
+ if( ((rc==0 || rc==1) && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1)
75193
+ || sqlite3RealSameAsInt(pMem->u.r, (ix = (i64)pMem->u.r))
75194
+ ){
75195
+ pMem->u.i = ix;
7517175196
MemSetTypeFlag(pMem, MEM_Int);
7517275197
}else{
75173
- i64 i = pMem->u.i;
75174
- sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
75175
- if( rc==1 && sqlite3RealSameAsInt(pMem->u.r, i) ){
75176
- pMem->u.i = i;
75177
- MemSetTypeFlag(pMem, MEM_Int);
75178
- }else{
75179
- MemSetTypeFlag(pMem, MEM_Real);
75180
- }
75198
+ MemSetTypeFlag(pMem, MEM_Real);
7518175199
}
7518275200
}
7518375201
assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))!=0 );
7518475202
pMem->flags &= ~(MEM_Str|MEM_Blob|MEM_Zero);
7518575203
return SQLITE_OK;
@@ -83936,21 +83954,12 @@
8393683954
** return false.
8393783955
*/
8393883956
static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
8393983957
i64 iValue = (double)rValue;
8394083958
if( sqlite3RealSameAsInt(rValue,iValue) ){
83941
- testcase( iValue<-2251799813685248 );
83942
- testcase( iValue==-2251799813685248 );
83943
- testcase( iValue==-2251799813685247 );
83944
- testcase( iValue>-2251799813685247 && iValue<+2251799813685247 );
83945
- testcase( iValue==+2251799813685247 );
83946
- testcase( iValue==+2251799813685248 );
83947
- testcase( iValue>+2251799813685248 );
83948
- if( iValue > -2251799813685248 && iValue < 2251799813685248 ){
83949
- *piValue = iValue;
83950
- return 1;
83951
- }
83959
+ *piValue = iValue;
83960
+ return 1;
8395283961
}
8395383962
return 0==sqlite3Atoi64(pRec->z, piValue, pRec->n, pRec->enc);
8395483963
}
8395583964
8395683965
/*
@@ -83972,11 +83981,11 @@
8397283981
double rValue;
8397383982
u8 enc = pRec->enc;
8397483983
int rc;
8397583984
assert( (pRec->flags & (MEM_Str|MEM_Int|MEM_Real|MEM_IntReal))==MEM_Str );
8397683985
rc = sqlite3AtoF(pRec->z, &rValue, pRec->n, enc);
83977
- if( rc==0 ) return;
83986
+ if( rc<=0 ) return;
8397883987
if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
8397983988
pRec->flags |= MEM_Int;
8398083989
}else{
8398183990
pRec->u.r = rValue;
8398283991
pRec->flags |= MEM_Real;
@@ -84073,17 +84082,25 @@
8407384082
** interpret as a string if we want to). Compute its corresponding
8407484083
** numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
8407584084
** accordingly.
8407684085
*/
8407784086
static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){
84087
+ int rc;
84088
+ sqlite3_int64 ix;
8407884089
assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal))==0 );
8407984090
assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 );
8408084091
ExpandBlob(pMem);
84081
- if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){
84082
- return 0;
84083
- }
84084
- if( sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc)==0 ){
84092
+ rc = sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
84093
+ if( rc<=0 ){
84094
+ if( rc==0 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1 ){
84095
+ pMem->u.i = ix;
84096
+ return MEM_Int;
84097
+ }else{
84098
+ return MEM_Real;
84099
+ }
84100
+ }else if( rc==1 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)==0 ){
84101
+ pMem->u.i = ix;
8408584102
return MEM_Int;
8408684103
}
8408784104
return MEM_Real;
8408884105
}
8408984106
@@ -85330,11 +85347,10 @@
8533085347
case OP_Add: /* same as TK_PLUS, in1, in2, out3 */
8533185348
case OP_Subtract: /* same as TK_MINUS, in1, in2, out3 */
8533285349
case OP_Multiply: /* same as TK_STAR, in1, in2, out3 */
8533385350
case OP_Divide: /* same as TK_SLASH, in1, in2, out3 */
8533485351
case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */
85335
- char bIntint; /* Started out as two integer operands */
8533685352
u16 flags; /* Combined MEM_* flags from both inputs */
8533785353
u16 type1; /* Numeric type of left operand */
8533885354
u16 type2; /* Numeric type of right operand */
8533985355
i64 iA; /* Integer value of left operand */
8534085356
i64 iB; /* Integer value of right operand */
@@ -85348,11 +85364,10 @@
8534885364
pOut = &aMem[pOp->p3];
8534985365
flags = pIn1->flags | pIn2->flags;
8535085366
if( (type1 & type2 & MEM_Int)!=0 ){
8535185367
iA = pIn1->u.i;
8535285368
iB = pIn2->u.i;
85353
- bIntint = 1;
8535485369
switch( pOp->opcode ){
8535585370
case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break;
8535685371
case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break;
8535785372
case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break;
8535885373
case OP_Divide: {
@@ -85371,11 +85386,10 @@
8537185386
pOut->u.i = iB;
8537285387
MemSetTypeFlag(pOut, MEM_Int);
8537385388
}else if( (flags & MEM_Null)!=0 ){
8537485389
goto arithmetic_result_is_null;
8537585390
}else{
85376
- bIntint = 0;
8537785391
fp_math:
8537885392
rA = sqlite3VdbeRealValue(pIn1);
8537985393
rB = sqlite3VdbeRealValue(pIn2);
8538085394
switch( pOp->opcode ){
8538185395
case OP_Add: rB += rA; break;
@@ -85403,13 +85417,10 @@
8540385417
if( sqlite3IsNaN(rB) ){
8540485418
goto arithmetic_result_is_null;
8540585419
}
8540685420
pOut->u.r = rB;
8540785421
MemSetTypeFlag(pOut, MEM_Real);
85408
- if( ((type1|type2)&(MEM_Real|MEM_IntReal))==0 && !bIntint ){
85409
- sqlite3VdbeIntegerAffinity(pOut);
85410
- }
8541185422
#endif
8541285423
}
8541385424
break;
8541485425
8541585426
arithmetic_result_is_null:
@@ -96110,11 +96121,11 @@
9611096121
wrong_num_args = 1;
9611196122
}
9611296123
}else{
9611396124
is_agg = pDef->xFinalize!=0;
9611496125
if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){
96115
- ExprSetProperty(pExpr, EP_Unlikely|EP_Skip);
96126
+ ExprSetProperty(pExpr, EP_Unlikely);
9611696127
if( n==2 ){
9611796128
pExpr->iTable = exprProbability(pList->a[1].pExpr);
9611896129
if( pExpr->iTable<0 ){
9611996130
sqlite3ErrorMsg(pParse,
9612096131
"second argument to likelihood() must be a "
@@ -96293,15 +96304,15 @@
9629396304
notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
9629496305
break;
9629596306
}
9629696307
case TK_IS:
9629796308
case TK_ISNOT: {
96298
- Expr *pRight;
96309
+ Expr *pRight = sqlite3ExprSkipCollate(pExpr->pRight);
9629996310
assert( !ExprHasProperty(pExpr, EP_Reduced) );
9630096311
/* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
9630196312
** and "x IS NOT FALSE". */
96302
- if( (pRight = pExpr->pRight)->op==TK_ID ){
96313
+ if( pRight->op==TK_ID ){
9630396314
int rc = resolveExprStep(pWalker, pRight);
9630496315
if( rc==WRC_Abort ) return WRC_Abort;
9630596316
if( pRight->op==TK_TRUEFALSE ){
9630696317
pExpr->op2 = pExpr->op;
9630796318
pExpr->op = TK_TRUTH;
@@ -97190,12 +97201,16 @@
9719097201
** SELECT a AS b FROM t1 WHERE b;
9719197202
** SELECT * FROM t1 WHERE (select a from t1);
9719297203
*/
9719397204
SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
9719497205
int op;
97195
- pExpr = sqlite3ExprSkipCollate(pExpr);
9719697206
if( pExpr->flags & EP_Generic ) return 0;
97207
+ while( ExprHasProperty(pExpr, EP_Skip) ){
97208
+ assert( pExpr->op==TK_COLLATE );
97209
+ pExpr = pExpr->pLeft;
97210
+ assert( pExpr!=0 );
97211
+ }
9719797212
op = pExpr->op;
9719897213
if( op==TK_SELECT ){
9719997214
assert( pExpr->flags&EP_xIsSelect );
9720097215
return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
9720197216
}
@@ -97252,11 +97267,11 @@
9725297267
/*
9725397268
** Skip over any TK_COLLATE operators and any unlikely()
9725497269
** or likelihood() function at the root of an expression.
9725597270
*/
9725697271
SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
97257
- while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
97272
+ while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
9725897273
if( ExprHasProperty(pExpr, EP_Unlikely) ){
9725997274
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
9726097275
assert( pExpr->x.pList->nExpr>0 );
9726197276
assert( pExpr->op==TK_FUNCTION );
9726297277
pExpr = pExpr->x.pList->a[0].pExpr;
@@ -98040,15 +98055,13 @@
9804098055
sqlite3 *db = pParse->db;
9804198056
if( pLeft==0 ){
9804298057
return pRight;
9804398058
}else if( pRight==0 ){
9804498059
return pLeft;
98045
- }else if( pParse->nErr || IN_RENAME_OBJECT ){
98046
- return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
9804798060
}else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){
98048
- sqlite3ExprDelete(db, pLeft);
98049
- sqlite3ExprDelete(db, pRight);
98061
+ sqlite3ExprUnmapAndDelete(pParse, pLeft);
98062
+ sqlite3ExprUnmapAndDelete(pParse, pRight);
9805098063
return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0);
9805198064
}else{
9805298065
return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
9805398066
}
9805498067
}
@@ -98203,10 +98216,22 @@
9820398216
}
9820498217
}
9820598218
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
9820698219
if( p ) sqlite3ExprDeleteNN(db, p);
9820798220
}
98221
+
98222
+/* Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
98223
+** expression.
98224
+*/
98225
+SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse *pParse, Expr *p){
98226
+ if( p ){
98227
+ if( IN_RENAME_OBJECT ){
98228
+ sqlite3RenameExprUnmap(pParse, p);
98229
+ }
98230
+ sqlite3ExprDeleteNN(pParse->db, p);
98231
+ }
98232
+}
9820898233
9820998234
/*
9821098235
** Return the number of bytes allocated for the expression structure
9821198236
** passed as the first argument. This is always one of EXPR_FULLSIZE,
9821298237
** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
@@ -98786,14 +98811,11 @@
9878698811
** the RHS and LHS sizes match during code generation. */
9878798812
pFirst->iTable = pColumns->nId;
9878898813
}
9878998814
9879098815
vector_append_error:
98791
- if( IN_RENAME_OBJECT ){
98792
- sqlite3RenameExprUnmap(pParse, pExpr);
98793
- }
98794
- sqlite3ExprDelete(db, pExpr);
98816
+ sqlite3ExprUnmapAndDelete(pParse, pExpr);
9879598817
sqlite3IdListDelete(db, pColumns);
9879698818
return pList;
9879798819
}
9879898820
9879998821
/*
@@ -98948,10 +98970,11 @@
9894898970
/*
9894998971
** The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE
9895098972
** and 0 if it is FALSE.
9895198973
*/
9895298974
SQLITE_PRIVATE int sqlite3ExprTruthValue(const Expr *pExpr){
98975
+ pExpr = sqlite3ExprSkipCollate((Expr*)pExpr);
9895398976
assert( pExpr->op==TK_TRUEFALSE );
9895498977
assert( sqlite3StrICmp(pExpr->u.zToken,"true")==0
9895598978
|| sqlite3StrICmp(pExpr->u.zToken,"false")==0 );
9895698979
return pExpr->u.zToken[4]==0;
9895798980
}
@@ -103410,19 +103433,34 @@
103410103433
static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
103411103434
Parse *pParse = pWalker->pParse;
103412103435
sqlite3RenameTokenRemap(pParse, 0, (void*)pExpr);
103413103436
return WRC_Continue;
103414103437
}
103438
+
103439
+/*
103440
+** Walker callback used by sqlite3RenameExprUnmap().
103441
+*/
103442
+static int renameUnmapSelectCb(Walker *pWalker, Select *p){
103443
+ if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
103444
+ Parse *pParse = pWalker->pParse;
103445
+ int i;
103446
+ for(i=0; i<p->pSrc->nSrc; i++){
103447
+ sqlite3RenameTokenRemap(pParse, 0, (void*)p->pSrc->a[0].zName);
103448
+ }
103449
+ }
103450
+ return WRC_Continue;
103451
+}
103415103452
103416103453
/*
103417103454
** Remove all nodes that are part of expression pExpr from the rename list.
103418103455
*/
103419103456
SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse *pParse, Expr *pExpr){
103420103457
Walker sWalker;
103421103458
memset(&sWalker, 0, sizeof(Walker));
103422103459
sWalker.pParse = pParse;
103423103460
sWalker.xExprCallback = renameUnmapExprCb;
103461
+ sWalker.xSelectCallback = renameUnmapSelectCb;
103424103462
sqlite3WalkExpr(&sWalker, pExpr);
103425103463
}
103426103464
103427103465
/*
103428103466
** Remove all nodes that are part of expression-list pEList from the
@@ -113797,14 +113835,11 @@
113797113835
zBuf = sqlite3_mprintf("%.*f",n,r);
113798113836
if( zBuf==0 ){
113799113837
sqlite3_result_error_nomem(context);
113800113838
return;
113801113839
}
113802
- if( !sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8) ){
113803
- assert( sqlite3_strglob("*Inf", zBuf)==0 );
113804
- r = zBuf[0]=='-' ? -HUGE_VAL : +HUGE_VAL;
113805
- }
113840
+ sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8);
113806113841
sqlite3_free(zBuf);
113807113842
}
113808113843
sqlite3_result_double(context, r);
113809113844
}
113810113845
#endif
@@ -118275,11 +118310,11 @@
118275118310
if( onError==OE_Ignore ){
118276118311
sqlite3VdbeGoto(v, ignoreDest);
118277118312
}else{
118278118313
char *zName = pCheck->a[i].zName;
118279118314
if( zName==0 ) zName = pTab->zName;
118280
- if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
118315
+ if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */
118281118316
sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
118282118317
onError, zName, P4_TRANSIENT,
118283118318
P5_ConstraintCheck);
118284118319
}
118285118320
sqlite3VdbeResolveLabel(v, allOk);
@@ -139140,23 +139175,24 @@
139140139175
zNew[iTo++] = zNew[iFrom];
139141139176
}
139142139177
zNew[iTo] = 0;
139143139178
assert( iTo>0 );
139144139179
139145
- /* If the RHS begins with a digit or a +/- sign, then the LHS must be
139146
- ** an ordinary column (not a virtual table column) with TEXT affinity.
139147
- ** Otherwise the LHS might be numeric and "lhs >= rhs" would be false
139148
- ** even though "lhs LIKE rhs" is true. But if the RHS does not start
139149
- ** with a digit or +/-, then "lhs LIKE rhs" will always be false if
139150
- ** the LHS is numeric and so the optimization still works.
139180
+ /* If the RHS begins with a digit, a +/- sign or whitespace, then the
139181
+ ** LHS must be an ordinary column (not a virtual table column) with
139182
+ ** TEXT affinity. Otherwise the LHS might be numeric and "lhs >= rhs"
139183
+ ** would be false even though "lhs LIKE rhs" is true. But if the RHS
139184
+ ** does not start with a digit or +/-, then "lhs LIKE rhs" will always
139185
+ ** be false if the LHS is numeric and so the optimization still works.
139151139186
**
139152139187
** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033
139153139188
** The RHS pattern must not be '/%' because the termination condition
139154139189
** will then become "x<'0'" and if the affinity is numeric, will then
139155139190
** be converted into "x<0", which is incorrect.
139156139191
*/
139157139192
if( sqlite3Isdigit(zNew[0])
139193
+ || sqlite3Isspace(zNew[0])
139158139194
|| zNew[0]=='-'
139159139195
|| zNew[0]=='+'
139160139196
|| zNew[iTo-1]=='0'-1
139161139197
){
139162139198
if( pLeft->op!=TK_COLUMN
@@ -152641,14 +152677,12 @@
152641152677
** expr1 NOT IN ()
152642152678
**
152643152679
** simplify to constants 0 (false) and 1 (true), respectively,
152644152680
** regardless of the value of expr1.
152645152681
*/
152646
- if( IN_RENAME_OBJECT==0 ){
152647
- sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy102);
152648
- yymsp[-4].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy100],1);
152649
- }
152682
+ sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy102);
152683
+ yymsp[-4].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy100],1);
152650152684
}else if( yymsp[-1].minor.yy94->nExpr==1 ){
152651152685
/* Expressions of the form:
152652152686
**
152653152687
** expr1 IN (?1)
152654152688
** expr1 NOT IN (?2)
@@ -218857,11 +218891,11 @@
218857218891
int nArg, /* Number of args */
218858218892
sqlite3_value **apUnused /* Function arguments */
218859218893
){
218860218894
assert( nArg==0 );
218861218895
UNUSED_PARAM2(nArg, apUnused);
218862
- sqlite3_result_text(pCtx, "fts5: 2019-06-04 18:21:59 4979f138e8c8bef7dd6b5921fb9ca9fea86bbf7ec1419934bb2d1a0d74e77183", -1, SQLITE_TRANSIENT);
218896
+ sqlite3_result_text(pCtx, "fts5: 2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4", -1, SQLITE_TRANSIENT);
218863218897
}
218864218898
218865218899
/*
218866218900
** Return true if zName is the extension on one of the shadow tables used
218867218901
** by this module.
@@ -223623,12 +223657,12 @@
223623223657
}
223624223658
#endif /* SQLITE_CORE */
223625223659
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
223626223660
223627223661
/************** End of stmt.c ************************************************/
223628
-#if __LINE__!=223628
223662
+#if __LINE__!=223662
223629223663
#undef SQLITE_SOURCE_ID
223630
-#define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872alt2"
223664
+#define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6calt2"
223631223665
#endif
223632223666
/* Return the source-id for this library */
223633223667
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
223634223668
/************************** End of sqlite3.c ******************************/
223635223669
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1167,11 +1167,11 @@
1167 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1168 ** [sqlite_version()] and [sqlite_source_id()].
1169 */
1170 #define SQLITE_VERSION "3.29.0"
1171 #define SQLITE_VERSION_NUMBER 3029000
1172 #define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872466c"
1173
1174 /*
1175 ** CAPI3REF: Run-Time Library Version Numbers
1176 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1177 **
@@ -2338,12 +2338,18 @@
2338 **
2339 ** [[sqlite3_vfs.xAccess]]
2340 ** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
2341 ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
2342 ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
2343 ** to test whether a file is at least readable. The file can be a
2344 ** directory.
 
 
 
 
 
 
2345 **
2346 ** ^SQLite will always allocate at least mxPathname+1 bytes for the
2347 ** output buffer xFullPathname. The exact size of the output buffer
2348 ** is also passed as a parameter to both methods. If the output buffer
2349 ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
@@ -17444,11 +17450,11 @@
17444 #define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
17445 #define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */
17446 #define EP_Generic 0x000200 /* Ignore COLLATE or affinity on this tree */
17447 #define EP_IntValue 0x000400 /* Integer value contained in u.iValue */
17448 #define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */
17449 #define EP_Skip 0x001000 /* COLLATE, AS, or UNLIKELY */
17450 #define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
17451 #define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
17452 #define EP_Win 0x008000 /* Contains window functions */
17453 #define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */
17454 #define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */
@@ -18799,10 +18805,11 @@
18799 SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse*,Expr*, Expr*);
18800 SQLITE_PRIVATE Expr *sqlite3ExprSimplifiedAndOr(Expr*);
18801 SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int);
18802 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
18803 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
 
18804 SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
18805 SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
18806 SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
18807 SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
18808 SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
@@ -21327,11 +21334,11 @@
21327 return 0;
21328 }else if( parseHhMmSs(zDate, p)==0 ){
21329 return 0;
21330 }else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
21331 return setDateTimeToCurrent(context, p);
21332 }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8) ){
21333 setRawDateNumber(p, r);
21334 return 0;
21335 }
21336 return 1;
21337 }
@@ -21661,11 +21668,11 @@
21661 ** Move the date to the same time on the next occurrence of
21662 ** weekday N where 0==Sunday, 1==Monday, and so forth. If the
21663 ** date is already on the appropriate weekday, this is a no-op.
21664 */
21665 if( sqlite3_strnicmp(z, "weekday ", 8)==0
21666 && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)
21667 && (n=(int)r)==r && n>=0 && r<7 ){
21668 sqlite3_int64 Z;
21669 computeYMD_HMS(p);
21670 p->validTZ = 0;
21671 p->validJD = 0;
@@ -21720,11 +21727,11 @@
21720 case '8':
21721 case '9': {
21722 double rRounder;
21723 int i;
21724 for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){}
21725 if( !sqlite3AtoF(z, &r, n, SQLITE_UTF8) ){
21726 rc = 1;
21727 break;
21728 }
21729 if( z[n]==':' ){
21730 /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
@@ -29068,11 +29075,11 @@
29068 const char *azOp[] = {
29069 "IS-FALSE", "IS-TRUE", "IS-NOT-FALSE", "IS-NOT-TRUE"
29070 };
29071 assert( pExpr->op2==TK_IS || pExpr->op2==TK_ISNOT );
29072 assert( pExpr->pRight );
29073 assert( pExpr->pRight->op==TK_TRUEFALSE );
29074 x = (pExpr->op2==TK_ISNOT)*2 + sqlite3ExprTruthValue(pExpr->pRight);
29075 zUniOp = azOp[x];
29076 break;
29077 }
29078
@@ -30598,11 +30605,13 @@
30598 ** Return TRUE if the result is a valid real number (or integer) and FALSE
30599 ** if the string is empty or contains extraneous text. More specifically
30600 ** return
30601 ** 1 => The input string is a pure integer
30602 ** 2 or more => The input has a decimal point or eNNN clause
30603 ** 0 => The input string is not a valid number
 
 
30604 **
30605 ** Valid numbers are in one of these formats:
30606 **
30607 ** [+-]digits[E[+-]digits]
30608 ** [+-]digits.[digits][E[+-]digits]
@@ -30789,11 +30798,17 @@
30789
30790 /* store the result */
30791 *pResult = result;
30792
30793 /* return true if number and no extra non-whitespace chracters after */
30794 return z==zEnd && nDigit>0 && eValid && eType>0 ? eType : 0;
 
 
 
 
 
 
30795 #else
30796 return !sqlite3Atoi64(z, pResult, length, enc);
30797 #endif /* SQLITE_OMIT_FLOATING_POINT */
30798 }
30799
@@ -30832,10 +30847,11 @@
30832 ** Convert zNum to a 64-bit signed integer. zNum must be decimal. This
30833 ** routine does *not* accept hexadecimal notation.
30834 **
30835 ** Returns:
30836 **
 
30837 ** 0 Successful transformation. Fits in a 64-bit signed integer.
30838 ** 1 Excess non-space text after the integer value
30839 ** 2 Integer too large for a 64-bit signed integer or is malformed
30840 ** 3 Special case of 9223372036854775808
30841 **
@@ -30891,13 +30907,13 @@
30891 *pNum = -(i64)u;
30892 }else{
30893 *pNum = (i64)u;
30894 }
30895 rc = 0;
30896 if( (i==0 && zStart==zNum) /* No digits */
30897 || nonNum /* UTF16 with high-order bytes non-zero */
30898 ){
30899 rc = 1;
30900 }else if( &zNum[i]<zEnd ){ /* Extra bytes at the end */
30901 int jj = i;
30902 do{
30903 if( !sqlite3Isspace(zNum[jj]) ){
@@ -48009,13 +48025,14 @@
48009 if( p->szCache>=0 ){
48010 /* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
48011 ** suggested cache size is set to N. */
48012 return p->szCache;
48013 }else{
48014 /* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
48015 ** the number of cache pages is adjusted to use approximately abs(N*1024)
48016 ** bytes of memory. */
 
48017 return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
48018 }
48019 }
48020
48021 /*************************************************** General Interfaces ******
@@ -75137,18 +75154,22 @@
75137 return SQLITE_OK;
75138 }
75139
75140 /* Compare a floating point value to an integer. Return true if the two
75141 ** values are the same within the precision of the floating point value.
 
 
75142 **
75143 ** For some versions of GCC on 32-bit machines, if you do the more obvious
75144 ** comparison of "r1==(double)i" you sometimes get an answer of false even
75145 ** though the r1 and (double)i values are bit-for-bit the same.
75146 */
75147 SQLITE_PRIVATE int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
75148 double r2 = (double)i;
75149 return memcmp(&r1, &r2, sizeof(r1))==0;
 
 
75150 }
75151
75152 /*
75153 ** Convert pMem so that it has type MEM_Real or MEM_Int.
75154 ** Invalidate any prior representations.
@@ -75162,24 +75183,21 @@
75162 testcase( pMem->flags & MEM_Real );
75163 testcase( pMem->flags & MEM_IntReal );
75164 testcase( pMem->flags & MEM_Null );
75165 if( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))==0 ){
75166 int rc;
 
75167 assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
75168 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
75169 rc = sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc);
75170 if( rc==0 ){
 
 
 
75171 MemSetTypeFlag(pMem, MEM_Int);
75172 }else{
75173 i64 i = pMem->u.i;
75174 sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
75175 if( rc==1 && sqlite3RealSameAsInt(pMem->u.r, i) ){
75176 pMem->u.i = i;
75177 MemSetTypeFlag(pMem, MEM_Int);
75178 }else{
75179 MemSetTypeFlag(pMem, MEM_Real);
75180 }
75181 }
75182 }
75183 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))!=0 );
75184 pMem->flags &= ~(MEM_Str|MEM_Blob|MEM_Zero);
75185 return SQLITE_OK;
@@ -83936,21 +83954,12 @@
83936 ** return false.
83937 */
83938 static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
83939 i64 iValue = (double)rValue;
83940 if( sqlite3RealSameAsInt(rValue,iValue) ){
83941 testcase( iValue<-2251799813685248 );
83942 testcase( iValue==-2251799813685248 );
83943 testcase( iValue==-2251799813685247 );
83944 testcase( iValue>-2251799813685247 && iValue<+2251799813685247 );
83945 testcase( iValue==+2251799813685247 );
83946 testcase( iValue==+2251799813685248 );
83947 testcase( iValue>+2251799813685248 );
83948 if( iValue > -2251799813685248 && iValue < 2251799813685248 ){
83949 *piValue = iValue;
83950 return 1;
83951 }
83952 }
83953 return 0==sqlite3Atoi64(pRec->z, piValue, pRec->n, pRec->enc);
83954 }
83955
83956 /*
@@ -83972,11 +83981,11 @@
83972 double rValue;
83973 u8 enc = pRec->enc;
83974 int rc;
83975 assert( (pRec->flags & (MEM_Str|MEM_Int|MEM_Real|MEM_IntReal))==MEM_Str );
83976 rc = sqlite3AtoF(pRec->z, &rValue, pRec->n, enc);
83977 if( rc==0 ) return;
83978 if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
83979 pRec->flags |= MEM_Int;
83980 }else{
83981 pRec->u.r = rValue;
83982 pRec->flags |= MEM_Real;
@@ -84073,17 +84082,25 @@
84073 ** interpret as a string if we want to). Compute its corresponding
84074 ** numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
84075 ** accordingly.
84076 */
84077 static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){
 
 
84078 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal))==0 );
84079 assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 );
84080 ExpandBlob(pMem);
84081 if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){
84082 return 0;
84083 }
84084 if( sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc)==0 ){
 
 
 
 
 
 
84085 return MEM_Int;
84086 }
84087 return MEM_Real;
84088 }
84089
@@ -85330,11 +85347,10 @@
85330 case OP_Add: /* same as TK_PLUS, in1, in2, out3 */
85331 case OP_Subtract: /* same as TK_MINUS, in1, in2, out3 */
85332 case OP_Multiply: /* same as TK_STAR, in1, in2, out3 */
85333 case OP_Divide: /* same as TK_SLASH, in1, in2, out3 */
85334 case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */
85335 char bIntint; /* Started out as two integer operands */
85336 u16 flags; /* Combined MEM_* flags from both inputs */
85337 u16 type1; /* Numeric type of left operand */
85338 u16 type2; /* Numeric type of right operand */
85339 i64 iA; /* Integer value of left operand */
85340 i64 iB; /* Integer value of right operand */
@@ -85348,11 +85364,10 @@
85348 pOut = &aMem[pOp->p3];
85349 flags = pIn1->flags | pIn2->flags;
85350 if( (type1 & type2 & MEM_Int)!=0 ){
85351 iA = pIn1->u.i;
85352 iB = pIn2->u.i;
85353 bIntint = 1;
85354 switch( pOp->opcode ){
85355 case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break;
85356 case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break;
85357 case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break;
85358 case OP_Divide: {
@@ -85371,11 +85386,10 @@
85371 pOut->u.i = iB;
85372 MemSetTypeFlag(pOut, MEM_Int);
85373 }else if( (flags & MEM_Null)!=0 ){
85374 goto arithmetic_result_is_null;
85375 }else{
85376 bIntint = 0;
85377 fp_math:
85378 rA = sqlite3VdbeRealValue(pIn1);
85379 rB = sqlite3VdbeRealValue(pIn2);
85380 switch( pOp->opcode ){
85381 case OP_Add: rB += rA; break;
@@ -85403,13 +85417,10 @@
85403 if( sqlite3IsNaN(rB) ){
85404 goto arithmetic_result_is_null;
85405 }
85406 pOut->u.r = rB;
85407 MemSetTypeFlag(pOut, MEM_Real);
85408 if( ((type1|type2)&(MEM_Real|MEM_IntReal))==0 && !bIntint ){
85409 sqlite3VdbeIntegerAffinity(pOut);
85410 }
85411 #endif
85412 }
85413 break;
85414
85415 arithmetic_result_is_null:
@@ -96110,11 +96121,11 @@
96110 wrong_num_args = 1;
96111 }
96112 }else{
96113 is_agg = pDef->xFinalize!=0;
96114 if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){
96115 ExprSetProperty(pExpr, EP_Unlikely|EP_Skip);
96116 if( n==2 ){
96117 pExpr->iTable = exprProbability(pList->a[1].pExpr);
96118 if( pExpr->iTable<0 ){
96119 sqlite3ErrorMsg(pParse,
96120 "second argument to likelihood() must be a "
@@ -96293,15 +96304,15 @@
96293 notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
96294 break;
96295 }
96296 case TK_IS:
96297 case TK_ISNOT: {
96298 Expr *pRight;
96299 assert( !ExprHasProperty(pExpr, EP_Reduced) );
96300 /* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
96301 ** and "x IS NOT FALSE". */
96302 if( (pRight = pExpr->pRight)->op==TK_ID ){
96303 int rc = resolveExprStep(pWalker, pRight);
96304 if( rc==WRC_Abort ) return WRC_Abort;
96305 if( pRight->op==TK_TRUEFALSE ){
96306 pExpr->op2 = pExpr->op;
96307 pExpr->op = TK_TRUTH;
@@ -97190,12 +97201,16 @@
97190 ** SELECT a AS b FROM t1 WHERE b;
97191 ** SELECT * FROM t1 WHERE (select a from t1);
97192 */
97193 SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
97194 int op;
97195 pExpr = sqlite3ExprSkipCollate(pExpr);
97196 if( pExpr->flags & EP_Generic ) return 0;
 
 
 
 
 
97197 op = pExpr->op;
97198 if( op==TK_SELECT ){
97199 assert( pExpr->flags&EP_xIsSelect );
97200 return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
97201 }
@@ -97252,11 +97267,11 @@
97252 /*
97253 ** Skip over any TK_COLLATE operators and any unlikely()
97254 ** or likelihood() function at the root of an expression.
97255 */
97256 SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
97257 while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
97258 if( ExprHasProperty(pExpr, EP_Unlikely) ){
97259 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
97260 assert( pExpr->x.pList->nExpr>0 );
97261 assert( pExpr->op==TK_FUNCTION );
97262 pExpr = pExpr->x.pList->a[0].pExpr;
@@ -98040,15 +98055,13 @@
98040 sqlite3 *db = pParse->db;
98041 if( pLeft==0 ){
98042 return pRight;
98043 }else if( pRight==0 ){
98044 return pLeft;
98045 }else if( pParse->nErr || IN_RENAME_OBJECT ){
98046 return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
98047 }else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){
98048 sqlite3ExprDelete(db, pLeft);
98049 sqlite3ExprDelete(db, pRight);
98050 return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0);
98051 }else{
98052 return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
98053 }
98054 }
@@ -98203,10 +98216,22 @@
98203 }
98204 }
98205 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
98206 if( p ) sqlite3ExprDeleteNN(db, p);
98207 }
 
 
 
 
 
 
 
 
 
 
 
 
98208
98209 /*
98210 ** Return the number of bytes allocated for the expression structure
98211 ** passed as the first argument. This is always one of EXPR_FULLSIZE,
98212 ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
@@ -98786,14 +98811,11 @@
98786 ** the RHS and LHS sizes match during code generation. */
98787 pFirst->iTable = pColumns->nId;
98788 }
98789
98790 vector_append_error:
98791 if( IN_RENAME_OBJECT ){
98792 sqlite3RenameExprUnmap(pParse, pExpr);
98793 }
98794 sqlite3ExprDelete(db, pExpr);
98795 sqlite3IdListDelete(db, pColumns);
98796 return pList;
98797 }
98798
98799 /*
@@ -98948,10 +98970,11 @@
98948 /*
98949 ** The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE
98950 ** and 0 if it is FALSE.
98951 */
98952 SQLITE_PRIVATE int sqlite3ExprTruthValue(const Expr *pExpr){
 
98953 assert( pExpr->op==TK_TRUEFALSE );
98954 assert( sqlite3StrICmp(pExpr->u.zToken,"true")==0
98955 || sqlite3StrICmp(pExpr->u.zToken,"false")==0 );
98956 return pExpr->u.zToken[4]==0;
98957 }
@@ -103410,19 +103433,34 @@
103410 static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
103411 Parse *pParse = pWalker->pParse;
103412 sqlite3RenameTokenRemap(pParse, 0, (void*)pExpr);
103413 return WRC_Continue;
103414 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103415
103416 /*
103417 ** Remove all nodes that are part of expression pExpr from the rename list.
103418 */
103419 SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse *pParse, Expr *pExpr){
103420 Walker sWalker;
103421 memset(&sWalker, 0, sizeof(Walker));
103422 sWalker.pParse = pParse;
103423 sWalker.xExprCallback = renameUnmapExprCb;
 
103424 sqlite3WalkExpr(&sWalker, pExpr);
103425 }
103426
103427 /*
103428 ** Remove all nodes that are part of expression-list pEList from the
@@ -113797,14 +113835,11 @@
113797 zBuf = sqlite3_mprintf("%.*f",n,r);
113798 if( zBuf==0 ){
113799 sqlite3_result_error_nomem(context);
113800 return;
113801 }
113802 if( !sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8) ){
113803 assert( sqlite3_strglob("*Inf", zBuf)==0 );
113804 r = zBuf[0]=='-' ? -HUGE_VAL : +HUGE_VAL;
113805 }
113806 sqlite3_free(zBuf);
113807 }
113808 sqlite3_result_double(context, r);
113809 }
113810 #endif
@@ -118275,11 +118310,11 @@
118275 if( onError==OE_Ignore ){
118276 sqlite3VdbeGoto(v, ignoreDest);
118277 }else{
118278 char *zName = pCheck->a[i].zName;
118279 if( zName==0 ) zName = pTab->zName;
118280 if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
118281 sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
118282 onError, zName, P4_TRANSIENT,
118283 P5_ConstraintCheck);
118284 }
118285 sqlite3VdbeResolveLabel(v, allOk);
@@ -139140,23 +139175,24 @@
139140 zNew[iTo++] = zNew[iFrom];
139141 }
139142 zNew[iTo] = 0;
139143 assert( iTo>0 );
139144
139145 /* If the RHS begins with a digit or a +/- sign, then the LHS must be
139146 ** an ordinary column (not a virtual table column) with TEXT affinity.
139147 ** Otherwise the LHS might be numeric and "lhs >= rhs" would be false
139148 ** even though "lhs LIKE rhs" is true. But if the RHS does not start
139149 ** with a digit or +/-, then "lhs LIKE rhs" will always be false if
139150 ** the LHS is numeric and so the optimization still works.
139151 **
139152 ** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033
139153 ** The RHS pattern must not be '/%' because the termination condition
139154 ** will then become "x<'0'" and if the affinity is numeric, will then
139155 ** be converted into "x<0", which is incorrect.
139156 */
139157 if( sqlite3Isdigit(zNew[0])
 
139158 || zNew[0]=='-'
139159 || zNew[0]=='+'
139160 || zNew[iTo-1]=='0'-1
139161 ){
139162 if( pLeft->op!=TK_COLUMN
@@ -152641,14 +152677,12 @@
152641 ** expr1 NOT IN ()
152642 **
152643 ** simplify to constants 0 (false) and 1 (true), respectively,
152644 ** regardless of the value of expr1.
152645 */
152646 if( IN_RENAME_OBJECT==0 ){
152647 sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy102);
152648 yymsp[-4].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy100],1);
152649 }
152650 }else if( yymsp[-1].minor.yy94->nExpr==1 ){
152651 /* Expressions of the form:
152652 **
152653 ** expr1 IN (?1)
152654 ** expr1 NOT IN (?2)
@@ -218857,11 +218891,11 @@
218857 int nArg, /* Number of args */
218858 sqlite3_value **apUnused /* Function arguments */
218859 ){
218860 assert( nArg==0 );
218861 UNUSED_PARAM2(nArg, apUnused);
218862 sqlite3_result_text(pCtx, "fts5: 2019-06-04 18:21:59 4979f138e8c8bef7dd6b5921fb9ca9fea86bbf7ec1419934bb2d1a0d74e77183", -1, SQLITE_TRANSIENT);
218863 }
218864
218865 /*
218866 ** Return true if zName is the extension on one of the shadow tables used
218867 ** by this module.
@@ -223623,12 +223657,12 @@
223623 }
223624 #endif /* SQLITE_CORE */
223625 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
223626
223627 /************** End of stmt.c ************************************************/
223628 #if __LINE__!=223628
223629 #undef SQLITE_SOURCE_ID
223630 #define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872alt2"
223631 #endif
223632 /* Return the source-id for this library */
223633 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
223634 /************************** End of sqlite3.c ******************************/
223635
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1167,11 +1167,11 @@
1167 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1168 ** [sqlite_version()] and [sqlite_source_id()].
1169 */
1170 #define SQLITE_VERSION "3.29.0"
1171 #define SQLITE_VERSION_NUMBER 3029000
1172 #define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4"
1173
1174 /*
1175 ** CAPI3REF: Run-Time Library Version Numbers
1176 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1177 **
@@ -2338,12 +2338,18 @@
2338 **
2339 ** [[sqlite3_vfs.xAccess]]
2340 ** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
2341 ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
2342 ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
2343 ** to test whether a file is at least readable. The SQLITE_ACCESS_READ
2344 ** flag is never actually used and is not implemented in the built-in
2345 ** VFSes of SQLite. The file is named by the second argument and can be a
2346 ** directory. The xAccess method returns [SQLITE_OK] on success or some
2347 ** non-zero error code if there is an I/O error or if the name of
2348 ** the file given in the second argument is illegal. If SQLITE_OK
2349 ** is returned, then non-zero or zero is written into *pResOut to indicate
2350 ** whether or not the file is accessible.
2351 **
2352 ** ^SQLite will always allocate at least mxPathname+1 bytes for the
2353 ** output buffer xFullPathname. The exact size of the output buffer
2354 ** is also passed as a parameter to both methods. If the output buffer
2355 ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
@@ -17444,11 +17450,11 @@
17450 #define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
17451 #define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */
17452 #define EP_Generic 0x000200 /* Ignore COLLATE or affinity on this tree */
17453 #define EP_IntValue 0x000400 /* Integer value contained in u.iValue */
17454 #define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */
17455 #define EP_Skip 0x001000 /* Operator does not contribute to affinity */
17456 #define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
17457 #define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
17458 #define EP_Win 0x008000 /* Contains window functions */
17459 #define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */
17460 #define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */
@@ -18799,10 +18805,11 @@
18805 SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse*,Expr*, Expr*);
18806 SQLITE_PRIVATE Expr *sqlite3ExprSimplifiedAndOr(Expr*);
18807 SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int);
18808 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
18809 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
18810 SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
18811 SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
18812 SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
18813 SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
18814 SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
18815 SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
@@ -21327,11 +21334,11 @@
21334 return 0;
21335 }else if( parseHhMmSs(zDate, p)==0 ){
21336 return 0;
21337 }else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
21338 return setDateTimeToCurrent(context, p);
21339 }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
21340 setRawDateNumber(p, r);
21341 return 0;
21342 }
21343 return 1;
21344 }
@@ -21661,11 +21668,11 @@
21668 ** Move the date to the same time on the next occurrence of
21669 ** weekday N where 0==Sunday, 1==Monday, and so forth. If the
21670 ** date is already on the appropriate weekday, this is a no-op.
21671 */
21672 if( sqlite3_strnicmp(z, "weekday ", 8)==0
21673 && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
21674 && (n=(int)r)==r && n>=0 && r<7 ){
21675 sqlite3_int64 Z;
21676 computeYMD_HMS(p);
21677 p->validTZ = 0;
21678 p->validJD = 0;
@@ -21720,11 +21727,11 @@
21727 case '8':
21728 case '9': {
21729 double rRounder;
21730 int i;
21731 for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){}
21732 if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
21733 rc = 1;
21734 break;
21735 }
21736 if( z[n]==':' ){
21737 /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
@@ -29068,11 +29075,11 @@
29075 const char *azOp[] = {
29076 "IS-FALSE", "IS-TRUE", "IS-NOT-FALSE", "IS-NOT-TRUE"
29077 };
29078 assert( pExpr->op2==TK_IS || pExpr->op2==TK_ISNOT );
29079 assert( pExpr->pRight );
29080 assert( sqlite3ExprSkipCollate(pExpr->pRight)->op==TK_TRUEFALSE );
29081 x = (pExpr->op2==TK_ISNOT)*2 + sqlite3ExprTruthValue(pExpr->pRight);
29082 zUniOp = azOp[x];
29083 break;
29084 }
29085
@@ -30598,11 +30605,13 @@
30605 ** Return TRUE if the result is a valid real number (or integer) and FALSE
30606 ** if the string is empty or contains extraneous text. More specifically
30607 ** return
30608 ** 1 => The input string is a pure integer
30609 ** 2 or more => The input has a decimal point or eNNN clause
30610 ** 0 or less => The input string is not a valid number
30611 ** -1 => Not a valid number, but has a valid prefix which
30612 ** includes a decimal point and/or an eNNN clause
30613 **
30614 ** Valid numbers are in one of these formats:
30615 **
30616 ** [+-]digits[E[+-]digits]
30617 ** [+-]digits.[digits][E[+-]digits]
@@ -30789,11 +30798,17 @@
30798
30799 /* store the result */
30800 *pResult = result;
30801
30802 /* return true if number and no extra non-whitespace chracters after */
30803 if( z==zEnd && nDigit>0 && eValid && eType>0 ){
30804 return eType;
30805 }else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){
30806 return -1;
30807 }else{
30808 return 0;
30809 }
30810 #else
30811 return !sqlite3Atoi64(z, pResult, length, enc);
30812 #endif /* SQLITE_OMIT_FLOATING_POINT */
30813 }
30814
@@ -30832,10 +30847,11 @@
30847 ** Convert zNum to a 64-bit signed integer. zNum must be decimal. This
30848 ** routine does *not* accept hexadecimal notation.
30849 **
30850 ** Returns:
30851 **
30852 ** -1 Not even a prefix of the input text looks like an integer
30853 ** 0 Successful transformation. Fits in a 64-bit signed integer.
30854 ** 1 Excess non-space text after the integer value
30855 ** 2 Integer too large for a 64-bit signed integer or is malformed
30856 ** 3 Special case of 9223372036854775808
30857 **
@@ -30891,13 +30907,13 @@
30907 *pNum = -(i64)u;
30908 }else{
30909 *pNum = (i64)u;
30910 }
30911 rc = 0;
30912 if( i==0 && zStart==zNum ){ /* No digits */
30913 rc = -1;
30914 }else if( nonNum ){ /* UTF16 with high-order bytes non-zero */
30915 rc = 1;
30916 }else if( &zNum[i]<zEnd ){ /* Extra bytes at the end */
30917 int jj = i;
30918 do{
30919 if( !sqlite3Isspace(zNum[jj]) ){
@@ -48009,13 +48025,14 @@
48025 if( p->szCache>=0 ){
48026 /* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
48027 ** suggested cache size is set to N. */
48028 return p->szCache;
48029 }else{
48030 /* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
48031 ** number of cache pages is adjusted to be a number of pages that would
48032 ** use approximately abs(N*1024) bytes of memory based on the current
48033 ** page size. */
48034 return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
48035 }
48036 }
48037
48038 /*************************************************** General Interfaces ******
@@ -75137,18 +75154,22 @@
75154 return SQLITE_OK;
75155 }
75156
75157 /* Compare a floating point value to an integer. Return true if the two
75158 ** values are the same within the precision of the floating point value.
75159 **
75160 ** This function assumes that i was obtained by assignment from r1.
75161 **
75162 ** For some versions of GCC on 32-bit machines, if you do the more obvious
75163 ** comparison of "r1==(double)i" you sometimes get an answer of false even
75164 ** though the r1 and (double)i values are bit-for-bit the same.
75165 */
75166 SQLITE_PRIVATE int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
75167 double r2 = (double)i;
75168 return r1==0.0
75169 || (memcmp(&r1, &r2, sizeof(r1))==0
75170 && i >= -2251799813685248 && i < 2251799813685248);
75171 }
75172
75173 /*
75174 ** Convert pMem so that it has type MEM_Real or MEM_Int.
75175 ** Invalidate any prior representations.
@@ -75162,24 +75183,21 @@
75183 testcase( pMem->flags & MEM_Real );
75184 testcase( pMem->flags & MEM_IntReal );
75185 testcase( pMem->flags & MEM_Null );
75186 if( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))==0 ){
75187 int rc;
75188 sqlite3_int64 ix;
75189 assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
75190 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
75191 rc = sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
75192 if( ((rc==0 || rc==1) && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1)
75193 || sqlite3RealSameAsInt(pMem->u.r, (ix = (i64)pMem->u.r))
75194 ){
75195 pMem->u.i = ix;
75196 MemSetTypeFlag(pMem, MEM_Int);
75197 }else{
75198 MemSetTypeFlag(pMem, MEM_Real);
 
 
 
 
 
 
 
75199 }
75200 }
75201 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))!=0 );
75202 pMem->flags &= ~(MEM_Str|MEM_Blob|MEM_Zero);
75203 return SQLITE_OK;
@@ -83936,21 +83954,12 @@
83954 ** return false.
83955 */
83956 static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
83957 i64 iValue = (double)rValue;
83958 if( sqlite3RealSameAsInt(rValue,iValue) ){
83959 *piValue = iValue;
83960 return 1;
 
 
 
 
 
 
 
 
 
83961 }
83962 return 0==sqlite3Atoi64(pRec->z, piValue, pRec->n, pRec->enc);
83963 }
83964
83965 /*
@@ -83972,11 +83981,11 @@
83981 double rValue;
83982 u8 enc = pRec->enc;
83983 int rc;
83984 assert( (pRec->flags & (MEM_Str|MEM_Int|MEM_Real|MEM_IntReal))==MEM_Str );
83985 rc = sqlite3AtoF(pRec->z, &rValue, pRec->n, enc);
83986 if( rc<=0 ) return;
83987 if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
83988 pRec->flags |= MEM_Int;
83989 }else{
83990 pRec->u.r = rValue;
83991 pRec->flags |= MEM_Real;
@@ -84073,17 +84082,25 @@
84082 ** interpret as a string if we want to). Compute its corresponding
84083 ** numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
84084 ** accordingly.
84085 */
84086 static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){
84087 int rc;
84088 sqlite3_int64 ix;
84089 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal))==0 );
84090 assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 );
84091 ExpandBlob(pMem);
84092 rc = sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc);
84093 if( rc<=0 ){
84094 if( rc==0 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1 ){
84095 pMem->u.i = ix;
84096 return MEM_Int;
84097 }else{
84098 return MEM_Real;
84099 }
84100 }else if( rc==1 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)==0 ){
84101 pMem->u.i = ix;
84102 return MEM_Int;
84103 }
84104 return MEM_Real;
84105 }
84106
@@ -85330,11 +85347,10 @@
85347 case OP_Add: /* same as TK_PLUS, in1, in2, out3 */
85348 case OP_Subtract: /* same as TK_MINUS, in1, in2, out3 */
85349 case OP_Multiply: /* same as TK_STAR, in1, in2, out3 */
85350 case OP_Divide: /* same as TK_SLASH, in1, in2, out3 */
85351 case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */
 
85352 u16 flags; /* Combined MEM_* flags from both inputs */
85353 u16 type1; /* Numeric type of left operand */
85354 u16 type2; /* Numeric type of right operand */
85355 i64 iA; /* Integer value of left operand */
85356 i64 iB; /* Integer value of right operand */
@@ -85348,11 +85364,10 @@
85364 pOut = &aMem[pOp->p3];
85365 flags = pIn1->flags | pIn2->flags;
85366 if( (type1 & type2 & MEM_Int)!=0 ){
85367 iA = pIn1->u.i;
85368 iB = pIn2->u.i;
 
85369 switch( pOp->opcode ){
85370 case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break;
85371 case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break;
85372 case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break;
85373 case OP_Divide: {
@@ -85371,11 +85386,10 @@
85386 pOut->u.i = iB;
85387 MemSetTypeFlag(pOut, MEM_Int);
85388 }else if( (flags & MEM_Null)!=0 ){
85389 goto arithmetic_result_is_null;
85390 }else{
 
85391 fp_math:
85392 rA = sqlite3VdbeRealValue(pIn1);
85393 rB = sqlite3VdbeRealValue(pIn2);
85394 switch( pOp->opcode ){
85395 case OP_Add: rB += rA; break;
@@ -85403,13 +85417,10 @@
85417 if( sqlite3IsNaN(rB) ){
85418 goto arithmetic_result_is_null;
85419 }
85420 pOut->u.r = rB;
85421 MemSetTypeFlag(pOut, MEM_Real);
 
 
 
85422 #endif
85423 }
85424 break;
85425
85426 arithmetic_result_is_null:
@@ -96110,11 +96121,11 @@
96121 wrong_num_args = 1;
96122 }
96123 }else{
96124 is_agg = pDef->xFinalize!=0;
96125 if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){
96126 ExprSetProperty(pExpr, EP_Unlikely);
96127 if( n==2 ){
96128 pExpr->iTable = exprProbability(pList->a[1].pExpr);
96129 if( pExpr->iTable<0 ){
96130 sqlite3ErrorMsg(pParse,
96131 "second argument to likelihood() must be a "
@@ -96293,15 +96304,15 @@
96304 notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
96305 break;
96306 }
96307 case TK_IS:
96308 case TK_ISNOT: {
96309 Expr *pRight = sqlite3ExprSkipCollate(pExpr->pRight);
96310 assert( !ExprHasProperty(pExpr, EP_Reduced) );
96311 /* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
96312 ** and "x IS NOT FALSE". */
96313 if( pRight->op==TK_ID ){
96314 int rc = resolveExprStep(pWalker, pRight);
96315 if( rc==WRC_Abort ) return WRC_Abort;
96316 if( pRight->op==TK_TRUEFALSE ){
96317 pExpr->op2 = pExpr->op;
96318 pExpr->op = TK_TRUTH;
@@ -97190,12 +97201,16 @@
97201 ** SELECT a AS b FROM t1 WHERE b;
97202 ** SELECT * FROM t1 WHERE (select a from t1);
97203 */
97204 SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
97205 int op;
 
97206 if( pExpr->flags & EP_Generic ) return 0;
97207 while( ExprHasProperty(pExpr, EP_Skip) ){
97208 assert( pExpr->op==TK_COLLATE );
97209 pExpr = pExpr->pLeft;
97210 assert( pExpr!=0 );
97211 }
97212 op = pExpr->op;
97213 if( op==TK_SELECT ){
97214 assert( pExpr->flags&EP_xIsSelect );
97215 return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr);
97216 }
@@ -97252,11 +97267,11 @@
97267 /*
97268 ** Skip over any TK_COLLATE operators and any unlikely()
97269 ** or likelihood() function at the root of an expression.
97270 */
97271 SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
97272 while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
97273 if( ExprHasProperty(pExpr, EP_Unlikely) ){
97274 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
97275 assert( pExpr->x.pList->nExpr>0 );
97276 assert( pExpr->op==TK_FUNCTION );
97277 pExpr = pExpr->x.pList->a[0].pExpr;
@@ -98040,15 +98055,13 @@
98055 sqlite3 *db = pParse->db;
98056 if( pLeft==0 ){
98057 return pRight;
98058 }else if( pRight==0 ){
98059 return pLeft;
 
 
98060 }else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){
98061 sqlite3ExprUnmapAndDelete(pParse, pLeft);
98062 sqlite3ExprUnmapAndDelete(pParse, pRight);
98063 return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0);
98064 }else{
98065 return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
98066 }
98067 }
@@ -98203,10 +98216,22 @@
98216 }
98217 }
98218 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
98219 if( p ) sqlite3ExprDeleteNN(db, p);
98220 }
98221
98222 /* Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
98223 ** expression.
98224 */
98225 SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse *pParse, Expr *p){
98226 if( p ){
98227 if( IN_RENAME_OBJECT ){
98228 sqlite3RenameExprUnmap(pParse, p);
98229 }
98230 sqlite3ExprDeleteNN(pParse->db, p);
98231 }
98232 }
98233
98234 /*
98235 ** Return the number of bytes allocated for the expression structure
98236 ** passed as the first argument. This is always one of EXPR_FULLSIZE,
98237 ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
@@ -98786,14 +98811,11 @@
98811 ** the RHS and LHS sizes match during code generation. */
98812 pFirst->iTable = pColumns->nId;
98813 }
98814
98815 vector_append_error:
98816 sqlite3ExprUnmapAndDelete(pParse, pExpr);
 
 
 
98817 sqlite3IdListDelete(db, pColumns);
98818 return pList;
98819 }
98820
98821 /*
@@ -98948,10 +98970,11 @@
98970 /*
98971 ** The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE
98972 ** and 0 if it is FALSE.
98973 */
98974 SQLITE_PRIVATE int sqlite3ExprTruthValue(const Expr *pExpr){
98975 pExpr = sqlite3ExprSkipCollate((Expr*)pExpr);
98976 assert( pExpr->op==TK_TRUEFALSE );
98977 assert( sqlite3StrICmp(pExpr->u.zToken,"true")==0
98978 || sqlite3StrICmp(pExpr->u.zToken,"false")==0 );
98979 return pExpr->u.zToken[4]==0;
98980 }
@@ -103410,19 +103433,34 @@
103433 static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
103434 Parse *pParse = pWalker->pParse;
103435 sqlite3RenameTokenRemap(pParse, 0, (void*)pExpr);
103436 return WRC_Continue;
103437 }
103438
103439 /*
103440 ** Walker callback used by sqlite3RenameExprUnmap().
103441 */
103442 static int renameUnmapSelectCb(Walker *pWalker, Select *p){
103443 if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
103444 Parse *pParse = pWalker->pParse;
103445 int i;
103446 for(i=0; i<p->pSrc->nSrc; i++){
103447 sqlite3RenameTokenRemap(pParse, 0, (void*)p->pSrc->a[0].zName);
103448 }
103449 }
103450 return WRC_Continue;
103451 }
103452
103453 /*
103454 ** Remove all nodes that are part of expression pExpr from the rename list.
103455 */
103456 SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse *pParse, Expr *pExpr){
103457 Walker sWalker;
103458 memset(&sWalker, 0, sizeof(Walker));
103459 sWalker.pParse = pParse;
103460 sWalker.xExprCallback = renameUnmapExprCb;
103461 sWalker.xSelectCallback = renameUnmapSelectCb;
103462 sqlite3WalkExpr(&sWalker, pExpr);
103463 }
103464
103465 /*
103466 ** Remove all nodes that are part of expression-list pEList from the
@@ -113797,14 +113835,11 @@
113835 zBuf = sqlite3_mprintf("%.*f",n,r);
113836 if( zBuf==0 ){
113837 sqlite3_result_error_nomem(context);
113838 return;
113839 }
113840 sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8);
 
 
 
113841 sqlite3_free(zBuf);
113842 }
113843 sqlite3_result_double(context, r);
113844 }
113845 #endif
@@ -118275,11 +118310,11 @@
118310 if( onError==OE_Ignore ){
118311 sqlite3VdbeGoto(v, ignoreDest);
118312 }else{
118313 char *zName = pCheck->a[i].zName;
118314 if( zName==0 ) zName = pTab->zName;
118315 if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */
118316 sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
118317 onError, zName, P4_TRANSIENT,
118318 P5_ConstraintCheck);
118319 }
118320 sqlite3VdbeResolveLabel(v, allOk);
@@ -139140,23 +139175,24 @@
139175 zNew[iTo++] = zNew[iFrom];
139176 }
139177 zNew[iTo] = 0;
139178 assert( iTo>0 );
139179
139180 /* If the RHS begins with a digit, a +/- sign or whitespace, then the
139181 ** LHS must be an ordinary column (not a virtual table column) with
139182 ** TEXT affinity. Otherwise the LHS might be numeric and "lhs >= rhs"
139183 ** would be false even though "lhs LIKE rhs" is true. But if the RHS
139184 ** does not start with a digit or +/-, then "lhs LIKE rhs" will always
139185 ** be false if the LHS is numeric and so the optimization still works.
139186 **
139187 ** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033
139188 ** The RHS pattern must not be '/%' because the termination condition
139189 ** will then become "x<'0'" and if the affinity is numeric, will then
139190 ** be converted into "x<0", which is incorrect.
139191 */
139192 if( sqlite3Isdigit(zNew[0])
139193 || sqlite3Isspace(zNew[0])
139194 || zNew[0]=='-'
139195 || zNew[0]=='+'
139196 || zNew[iTo-1]=='0'-1
139197 ){
139198 if( pLeft->op!=TK_COLUMN
@@ -152641,14 +152677,12 @@
152677 ** expr1 NOT IN ()
152678 **
152679 ** simplify to constants 0 (false) and 1 (true), respectively,
152680 ** regardless of the value of expr1.
152681 */
152682 sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy102);
152683 yymsp[-4].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy100],1);
 
 
152684 }else if( yymsp[-1].minor.yy94->nExpr==1 ){
152685 /* Expressions of the form:
152686 **
152687 ** expr1 IN (?1)
152688 ** expr1 NOT IN (?2)
@@ -218857,11 +218891,11 @@
218891 int nArg, /* Number of args */
218892 sqlite3_value **apUnused /* Function arguments */
218893 ){
218894 assert( nArg==0 );
218895 UNUSED_PARAM2(nArg, apUnused);
218896 sqlite3_result_text(pCtx, "fts5: 2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4", -1, SQLITE_TRANSIENT);
218897 }
218898
218899 /*
218900 ** Return true if zName is the extension on one of the shadow tables used
218901 ** by this module.
@@ -223623,12 +223657,12 @@
223657 }
223658 #endif /* SQLITE_CORE */
223659 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
223660
223661 /************** End of stmt.c ************************************************/
223662 #if __LINE__!=223662
223663 #undef SQLITE_SOURCE_ID
223664 #define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6calt2"
223665 #endif
223666 /* Return the source-id for this library */
223667 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
223668 /************************** End of sqlite3.c ******************************/
223669
+9 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.29.0"
127127
#define SQLITE_VERSION_NUMBER 3029000
128
-#define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872466c"
128
+#define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -1294,12 +1294,18 @@
12941294
**
12951295
** [[sqlite3_vfs.xAccess]]
12961296
** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
12971297
** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
12981298
** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
1299
-** to test whether a file is at least readable. The file can be a
1300
-** directory.
1299
+** to test whether a file is at least readable. The SQLITE_ACCESS_READ
1300
+** flag is never actually used and is not implemented in the built-in
1301
+** VFSes of SQLite. The file is named by the second argument and can be a
1302
+** directory. The xAccess method returns [SQLITE_OK] on success or some
1303
+** non-zero error code if there is an I/O error or if the name of
1304
+** the file given in the second argument is illegal. If SQLITE_OK
1305
+** is returned, then non-zero or zero is written into *pResOut to indicate
1306
+** whether or not the file is accessible.
13011307
**
13021308
** ^SQLite will always allocate at least mxPathname+1 bytes for the
13031309
** output buffer xFullPathname. The exact size of the output buffer
13041310
** is also passed as a parameter to both methods. If the output buffer
13051311
** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
13061312
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.29.0"
127 #define SQLITE_VERSION_NUMBER 3029000
128 #define SQLITE_SOURCE_ID "2019-06-05 14:29:53 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872466c"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1294,12 +1294,18 @@
1294 **
1295 ** [[sqlite3_vfs.xAccess]]
1296 ** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
1297 ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
1298 ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
1299 ** to test whether a file is at least readable. The file can be a
1300 ** directory.
 
 
 
 
 
 
1301 **
1302 ** ^SQLite will always allocate at least mxPathname+1 bytes for the
1303 ** output buffer xFullPathname. The exact size of the output buffer
1304 ** is also passed as a parameter to both methods. If the output buffer
1305 ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
1306
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.29.0"
127 #define SQLITE_VERSION_NUMBER 3029000
128 #define SQLITE_SOURCE_ID "2019-06-13 14:07:41 f8696b60eec0dcacfe92d9a31cbf1436d674140e5447de0cd1c2f52bff6c2be4"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1294,12 +1294,18 @@
1294 **
1295 ** [[sqlite3_vfs.xAccess]]
1296 ** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
1297 ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
1298 ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
1299 ** to test whether a file is at least readable. The SQLITE_ACCESS_READ
1300 ** flag is never actually used and is not implemented in the built-in
1301 ** VFSes of SQLite. The file is named by the second argument and can be a
1302 ** directory. The xAccess method returns [SQLITE_OK] on success or some
1303 ** non-zero error code if there is an I/O error or if the name of
1304 ** the file given in the second argument is illegal. If SQLITE_OK
1305 ** is returned, then non-zero or zero is written into *pResOut to indicate
1306 ** whether or not the file is accessible.
1307 **
1308 ** ^SQLite will always allocate at least mxPathname+1 bytes for the
1309 ** output buffer xFullPathname. The exact size of the output buffer
1310 ** is also passed as a parameter to both methods. If the output buffer
1311 ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
1312

Keyboard Shortcuts

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