Fossil SCM

Update the built-in SQLite to the first 3.37.0 beta.

drh 2021-11-22 16:12 trunk
Commit f96e9dfad3164354481e3e346636a35927caed62b01fd7a5b891c52f4250e8ca
3 files changed +3 -6 +59 -32 +1 -1
+3 -6
--- src/shell.c
+++ src/shell.c
@@ -12818,21 +12818,18 @@
1281812818
static void output_csv(ShellState *p, const char *z, int bSep){
1281912819
FILE *out = p->out;
1282012820
if( z==0 ){
1282112821
utf8_printf(out,"%s",p->nullValue);
1282212822
}else{
12823
- int i;
12824
- int nSep = strlen30(p->colSeparator);
12823
+ unsigned i;
1282512824
for(i=0; z[i]; i++){
12826
- if( needCsvQuote[((unsigned char*)z)[i]]
12827
- || (z[i]==p->colSeparator[0] &&
12828
- (nSep==1 || memcmp(z, p->colSeparator, nSep)==0)) ){
12825
+ if( needCsvQuote[((unsigned char*)z)[i]] ){
1282912826
i = 0;
1283012827
break;
1283112828
}
1283212829
}
12833
- if( i==0 ){
12830
+ if( i==0 || strstr(z, p->colSeparator)!=0 ){
1283412831
char *zQuoted = sqlite3_mprintf("\"%w\"", z);
1283512832
utf8_printf(out, "%s", zQuoted);
1283612833
sqlite3_free(zQuoted);
1283712834
}else{
1283812835
utf8_printf(out, "%s", z);
1283912836
--- src/shell.c
+++ src/shell.c
@@ -12818,21 +12818,18 @@
12818 static void output_csv(ShellState *p, const char *z, int bSep){
12819 FILE *out = p->out;
12820 if( z==0 ){
12821 utf8_printf(out,"%s",p->nullValue);
12822 }else{
12823 int i;
12824 int nSep = strlen30(p->colSeparator);
12825 for(i=0; z[i]; i++){
12826 if( needCsvQuote[((unsigned char*)z)[i]]
12827 || (z[i]==p->colSeparator[0] &&
12828 (nSep==1 || memcmp(z, p->colSeparator, nSep)==0)) ){
12829 i = 0;
12830 break;
12831 }
12832 }
12833 if( i==0 ){
12834 char *zQuoted = sqlite3_mprintf("\"%w\"", z);
12835 utf8_printf(out, "%s", zQuoted);
12836 sqlite3_free(zQuoted);
12837 }else{
12838 utf8_printf(out, "%s", z);
12839
--- src/shell.c
+++ src/shell.c
@@ -12818,21 +12818,18 @@
12818 static void output_csv(ShellState *p, const char *z, int bSep){
12819 FILE *out = p->out;
12820 if( z==0 ){
12821 utf8_printf(out,"%s",p->nullValue);
12822 }else{
12823 unsigned i;
 
12824 for(i=0; z[i]; i++){
12825 if( needCsvQuote[((unsigned char*)z)[i]] ){
 
 
12826 i = 0;
12827 break;
12828 }
12829 }
12830 if( i==0 || strstr(z, p->colSeparator)!=0 ){
12831 char *zQuoted = sqlite3_mprintf("\"%w\"", z);
12832 utf8_printf(out, "%s", zQuoted);
12833 sqlite3_free(zQuoted);
12834 }else{
12835 utf8_printf(out, "%s", z);
12836
+59 -32
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -452,11 +452,11 @@
452452
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453453
** [sqlite_version()] and [sqlite_source_id()].
454454
*/
455455
#define SQLITE_VERSION "3.37.0"
456456
#define SQLITE_VERSION_NUMBER 3037000
457
-#define SQLITE_SOURCE_ID "2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba"
457
+#define SQLITE_SOURCE_ID "2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8"
458458
459459
/*
460460
** CAPI3REF: Run-Time Library Version Numbers
461461
** KEYWORDS: sqlite3_version sqlite3_sourceid
462462
**
@@ -18501,11 +18501,10 @@
1850118501
TableLock *aTableLock; /* Required table locks for shared-cache mode */
1850218502
#endif
1850318503
AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
1850418504
Parse *pToplevel; /* Parse structure for main program (or NULL) */
1850518505
Table *pTriggerTab; /* Table triggers are being coded for */
18506
- Parse *pParentParse; /* Parent parser if this parser is nested */
1850718506
union {
1850818507
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
1850918508
Returning *pReturning; /* The RETURNING clause */
1851018509
} u1;
1851118510
u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
@@ -20059,11 +20058,11 @@
2005920058
#else
2006020059
# define sqlite3CteNew(P,T,E,S) ((void*)0)
2006120060
# define sqlite3CteDelete(D,C)
2006220061
# define sqlite3CteWithAdd(P,W,C) ((void*)0)
2006320062
# define sqlite3WithDelete(x,y)
20064
-# define sqlite3WithPush(x,y,z)
20063
+# define sqlite3WithPush(x,y,z) ((void*)0)
2006520064
#endif
2006620065
#ifndef SQLITE_OMIT_UPSERT
2006720066
SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
2006820067
SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
2006920068
SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -40030,40 +40029,50 @@
4003040029
OpenCounter(+1);
4003140030
verifyDbFile(pNew);
4003240031
}
4003340032
return rc;
4003440033
}
40034
+
40035
+/*
40036
+** Directories to consider for temp files.
40037
+*/
40038
+static const char *azTempDirs[] = {
40039
+ 0,
40040
+ 0,
40041
+ "/var/tmp",
40042
+ "/usr/tmp",
40043
+ "/tmp",
40044
+ "."
40045
+};
40046
+
40047
+/*
40048
+** Initialize first two members of azTempDirs[] array.
40049
+*/
40050
+static void unixTempFileInit(void){
40051
+ azTempDirs[0] = getenv("SQLITE_TMPDIR");
40052
+ azTempDirs[1] = getenv("TMPDIR");
40053
+}
4003540054
4003640055
/*
4003740056
** Return the name of a directory in which to put temporary files.
4003840057
** If no suitable temporary file directory can be found, return NULL.
4003940058
*/
4004040059
static const char *unixTempFileDir(void){
40041
- static const char *azDirs[] = {
40042
- 0,
40043
- 0,
40044
- "/var/tmp",
40045
- "/usr/tmp",
40046
- "/tmp",
40047
- "."
40048
- };
4004940060
unsigned int i = 0;
4005040061
struct stat buf;
4005140062
const char *zDir = sqlite3_temp_directory;
4005240063
40053
- if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR");
40054
- if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR");
4005540064
while(1){
4005640065
if( zDir!=0
4005740066
&& osStat(zDir, &buf)==0
4005840067
&& S_ISDIR(buf.st_mode)
4005940068
&& osAccess(zDir, 03)==0
4006040069
){
4006140070
return zDir;
4006240071
}
40063
- if( i>=sizeof(azDirs)/sizeof(azDirs[0]) ) break;
40064
- zDir = azDirs[i++];
40072
+ if( i>=sizeof(azTempDirs)/sizeof(azTempDirs[0]) ) break;
40073
+ zDir = azTempDirs[i++];
4006540074
}
4006640075
return 0;
4006740076
}
4006840077
4006940078
/*
@@ -42330,10 +42339,13 @@
4233042339
** READ-4 UNIX_SHM_BASE+7 127
4233142340
** DMS UNIX_SHM_BASE+8 128
4233242341
*/
4233342342
assert( UNIX_SHM_DMS==128 ); /* Byte offset of the deadman-switch */
4233442343
#endif
42344
+
42345
+ /* Initialize temp file dir array. */
42346
+ unixTempFileInit();
4233542347
4233642348
return SQLITE_OK;
4233742349
}
4233842350
4233942351
/*
@@ -107083,16 +107095,13 @@
107083107095
if( pB->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA,pB->pLeft,iTab)<2 ){
107084107096
return 1;
107085107097
}
107086107098
return 2;
107087107099
}
107088
- if( pA->op!=TK_COLUMN
107089
- && pA->op!=TK_AGG_COLUMN
107090
- && ALWAYS(!ExprHasProperty(pA, EP_IntValue))
107091
- && pA->u.zToken
107092
- ){
107093
- assert( !ExprHasProperty(pB, EP_IntValue) );
107100
+ assert( !ExprHasProperty(pA, EP_IntValue) );
107101
+ assert( !ExprHasProperty(pB, EP_IntValue) );
107102
+ if( pA->u.zToken ){
107094107103
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
107095107104
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107096107105
#ifndef SQLITE_OMIT_WINDOWFUNC
107097107106
assert( pA->op==pB->op );
107098107107
if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
@@ -107106,11 +107115,16 @@
107106107115
#endif
107107107116
}else if( pA->op==TK_NULL ){
107108107117
return 0;
107109107118
}else if( pA->op==TK_COLLATE ){
107110107119
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107111
- }else if( ALWAYS(pB->u.zToken!=0) && strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
107120
+ }else
107121
+ if( pB->u.zToken!=0
107122
+ && pA->op!=TK_COLUMN
107123
+ && pA->op!=TK_AGG_COLUMN
107124
+ && strcmp(pA->u.zToken,pB->u.zToken)!=0
107125
+ ){
107112107126
return 2;
107113107127
}
107114107128
}
107115107129
if( (pA->flags & (EP_Distinct|EP_Commuted))
107116107130
!= (pB->flags & (EP_Distinct|EP_Commuted)) ) return 2;
@@ -165855,10 +165869,11 @@
165855165869
int n = 0; /* Length of the next token token */
165856165870
int tokenType; /* type of the next token */
165857165871
int lastTokenParsed = -1; /* type of the previous token */
165858165872
sqlite3 *db = pParse->db; /* The database connection */
165859165873
int mxSqlLen; /* Max length of an SQL string */
165874
+ Parse *pParentParse = 0; /* Outer parse context, if any */
165860165875
#ifdef sqlite3Parser_ENGINEALWAYSONSTACK
165861165876
yyParser sEngine; /* Space to hold the Lemon-generated Parser object */
165862165877
#endif
165863165878
VVA_ONLY( u8 startedWithOom = db->mallocFailed );
165864165879
@@ -165890,11 +165905,11 @@
165890165905
#endif
165891165906
assert( pParse->pNewTable==0 );
165892165907
assert( pParse->pNewTrigger==0 );
165893165908
assert( pParse->nVar==0 );
165894165909
assert( pParse->pVList==0 );
165895
- pParse->pParentParse = db->pParse;
165910
+ pParentParse = db->pParse;
165896165911
db->pParse = pParse;
165897165912
while( 1 ){
165898165913
n = sqlite3GetToken((u8*)zSql, &tokenType);
165899165914
mxSqlLen -= n;
165900165915
if( mxSqlLen<0 ){
@@ -166005,12 +166020,11 @@
166005166020
}
166006166021
if( !IN_RENAME_OBJECT ){
166007166022
sqlite3DeleteTrigger(db, pParse->pNewTrigger);
166008166023
}
166009166024
sqlite3DbFree(db, pParse->pVList);
166010
- db->pParse = pParse->pParentParse;
166011
- pParse->pParentParse = 0;
166025
+ db->pParse = pParentParse;
166012166026
assert( nErr==0 || pParse->rc!=SQLITE_OK );
166013166027
return nErr;
166014166028
}
166015166029
166016166030
@@ -178984,10 +178998,11 @@
178984178998
}
178985178999
178986179000
if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM;
178987179001
memset(pCsr->aStat, 0, sizeof(struct Fts3auxColstats) * pCsr->nStat);
178988179002
iCol = 0;
179003
+ rc = SQLITE_OK;
178989179004
178990179005
while( i<nDoclist ){
178991179006
sqlite3_int64 v = 0;
178992179007
178993179008
i += sqlite3Fts3GetVarint(&aDoclist[i], &v);
@@ -179027,19 +179042,22 @@
179027179042
break;
179028179043
179029179044
/* State 3. The integer just read is a column number. */
179030179045
default: assert( eState==3 );
179031179046
iCol = (int)v;
179047
+ if( iCol<1 ){
179048
+ rc = SQLITE_CORRUPT_VTAB;
179049
+ break;
179050
+ }
179032179051
if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM;
179033179052
pCsr->aStat[iCol+1].nDoc++;
179034179053
eState = 2;
179035179054
break;
179036179055
}
179037179056
}
179038179057
179039179058
pCsr->iCol = 0;
179040
- rc = SQLITE_OK;
179041179059
}else{
179042179060
pCsr->isEof = 1;
179043179061
}
179044179062
return rc;
179045179063
}
@@ -195171,24 +195189,33 @@
195171195189
|| p->op==RTREE_FALSE );
195172195190
assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */
195173195191
switch( p->op ){
195174195192
case RTREE_TRUE: return; /* Always satisfied */
195175195193
case RTREE_FALSE: break; /* Never satisfied */
195176
- case RTREE_LE:
195177
- case RTREE_LT:
195178195194
case RTREE_EQ:
195179195195
RTREE_DECODE_COORD(eInt, pCellData, val);
195180195196
/* val now holds the lower bound of the coordinate pair */
195197
+ if( p->u.rValue>=val ){
195198
+ pCellData += 4;
195199
+ RTREE_DECODE_COORD(eInt, pCellData, val);
195200
+ /* val now holds the upper bound of the coordinate pair */
195201
+ if( p->u.rValue<=val ) return;
195202
+ }
195203
+ break;
195204
+ case RTREE_LE:
195205
+ case RTREE_LT:
195206
+ RTREE_DECODE_COORD(eInt, pCellData, val);
195207
+ /* val now holds the lower bound of the coordinate pair */
195181195208
if( p->u.rValue>=val ) return;
195182
- if( p->op!=RTREE_EQ ) break; /* RTREE_LE and RTREE_LT end here */
195183
- /* Fall through for the RTREE_EQ case */
195209
+ break;
195184195210
195185
- default: /* RTREE_GT or RTREE_GE, or fallthrough of RTREE_EQ */
195211
+ default:
195186195212
pCellData += 4;
195187195213
RTREE_DECODE_COORD(eInt, pCellData, val);
195188195214
/* val now holds the upper bound of the coordinate pair */
195189195215
if( p->u.rValue<=val ) return;
195216
+ break;
195190195217
}
195191195218
*peWithin = NOT_WITHIN;
195192195219
}
195193195220
195194195221
/*
@@ -232459,11 +232486,11 @@
232459232486
int nArg, /* Number of args */
232460232487
sqlite3_value **apUnused /* Function arguments */
232461232488
){
232462232489
assert( nArg==0 );
232463232490
UNUSED_PARAM2(nArg, apUnused);
232464
- sqlite3_result_text(pCtx, "fts5: 2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba", -1, SQLITE_TRANSIENT);
232491
+ sqlite3_result_text(pCtx, "fts5: 2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8", -1, SQLITE_TRANSIENT);
232465232492
}
232466232493
232467232494
/*
232468232495
** Return true if zName is the extension on one of the shadow tables used
232469232496
** by this module.
232470232497
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.37.0"
456 #define SQLITE_VERSION_NUMBER 3037000
457 #define SQLITE_SOURCE_ID "2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -18501,11 +18501,10 @@
18501 TableLock *aTableLock; /* Required table locks for shared-cache mode */
18502 #endif
18503 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
18504 Parse *pToplevel; /* Parse structure for main program (or NULL) */
18505 Table *pTriggerTab; /* Table triggers are being coded for */
18506 Parse *pParentParse; /* Parent parser if this parser is nested */
18507 union {
18508 int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
18509 Returning *pReturning; /* The RETURNING clause */
18510 } u1;
18511 u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
@@ -20059,11 +20058,11 @@
20059 #else
20060 # define sqlite3CteNew(P,T,E,S) ((void*)0)
20061 # define sqlite3CteDelete(D,C)
20062 # define sqlite3CteWithAdd(P,W,C) ((void*)0)
20063 # define sqlite3WithDelete(x,y)
20064 # define sqlite3WithPush(x,y,z)
20065 #endif
20066 #ifndef SQLITE_OMIT_UPSERT
20067 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
20068 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20069 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -40030,40 +40029,50 @@
40030 OpenCounter(+1);
40031 verifyDbFile(pNew);
40032 }
40033 return rc;
40034 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40035
40036 /*
40037 ** Return the name of a directory in which to put temporary files.
40038 ** If no suitable temporary file directory can be found, return NULL.
40039 */
40040 static const char *unixTempFileDir(void){
40041 static const char *azDirs[] = {
40042 0,
40043 0,
40044 "/var/tmp",
40045 "/usr/tmp",
40046 "/tmp",
40047 "."
40048 };
40049 unsigned int i = 0;
40050 struct stat buf;
40051 const char *zDir = sqlite3_temp_directory;
40052
40053 if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR");
40054 if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR");
40055 while(1){
40056 if( zDir!=0
40057 && osStat(zDir, &buf)==0
40058 && S_ISDIR(buf.st_mode)
40059 && osAccess(zDir, 03)==0
40060 ){
40061 return zDir;
40062 }
40063 if( i>=sizeof(azDirs)/sizeof(azDirs[0]) ) break;
40064 zDir = azDirs[i++];
40065 }
40066 return 0;
40067 }
40068
40069 /*
@@ -42330,10 +42339,13 @@
42330 ** READ-4 UNIX_SHM_BASE+7 127
42331 ** DMS UNIX_SHM_BASE+8 128
42332 */
42333 assert( UNIX_SHM_DMS==128 ); /* Byte offset of the deadman-switch */
42334 #endif
 
 
 
42335
42336 return SQLITE_OK;
42337 }
42338
42339 /*
@@ -107083,16 +107095,13 @@
107083 if( pB->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA,pB->pLeft,iTab)<2 ){
107084 return 1;
107085 }
107086 return 2;
107087 }
107088 if( pA->op!=TK_COLUMN
107089 && pA->op!=TK_AGG_COLUMN
107090 && ALWAYS(!ExprHasProperty(pA, EP_IntValue))
107091 && pA->u.zToken
107092 ){
107093 assert( !ExprHasProperty(pB, EP_IntValue) );
107094 if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
107095 if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107096 #ifndef SQLITE_OMIT_WINDOWFUNC
107097 assert( pA->op==pB->op );
107098 if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
@@ -107106,11 +107115,16 @@
107106 #endif
107107 }else if( pA->op==TK_NULL ){
107108 return 0;
107109 }else if( pA->op==TK_COLLATE ){
107110 if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107111 }else if( ALWAYS(pB->u.zToken!=0) && strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
 
 
 
 
 
107112 return 2;
107113 }
107114 }
107115 if( (pA->flags & (EP_Distinct|EP_Commuted))
107116 != (pB->flags & (EP_Distinct|EP_Commuted)) ) return 2;
@@ -165855,10 +165869,11 @@
165855 int n = 0; /* Length of the next token token */
165856 int tokenType; /* type of the next token */
165857 int lastTokenParsed = -1; /* type of the previous token */
165858 sqlite3 *db = pParse->db; /* The database connection */
165859 int mxSqlLen; /* Max length of an SQL string */
 
165860 #ifdef sqlite3Parser_ENGINEALWAYSONSTACK
165861 yyParser sEngine; /* Space to hold the Lemon-generated Parser object */
165862 #endif
165863 VVA_ONLY( u8 startedWithOom = db->mallocFailed );
165864
@@ -165890,11 +165905,11 @@
165890 #endif
165891 assert( pParse->pNewTable==0 );
165892 assert( pParse->pNewTrigger==0 );
165893 assert( pParse->nVar==0 );
165894 assert( pParse->pVList==0 );
165895 pParse->pParentParse = db->pParse;
165896 db->pParse = pParse;
165897 while( 1 ){
165898 n = sqlite3GetToken((u8*)zSql, &tokenType);
165899 mxSqlLen -= n;
165900 if( mxSqlLen<0 ){
@@ -166005,12 +166020,11 @@
166005 }
166006 if( !IN_RENAME_OBJECT ){
166007 sqlite3DeleteTrigger(db, pParse->pNewTrigger);
166008 }
166009 sqlite3DbFree(db, pParse->pVList);
166010 db->pParse = pParse->pParentParse;
166011 pParse->pParentParse = 0;
166012 assert( nErr==0 || pParse->rc!=SQLITE_OK );
166013 return nErr;
166014 }
166015
166016
@@ -178984,10 +178998,11 @@
178984 }
178985
178986 if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM;
178987 memset(pCsr->aStat, 0, sizeof(struct Fts3auxColstats) * pCsr->nStat);
178988 iCol = 0;
 
178989
178990 while( i<nDoclist ){
178991 sqlite3_int64 v = 0;
178992
178993 i += sqlite3Fts3GetVarint(&aDoclist[i], &v);
@@ -179027,19 +179042,22 @@
179027 break;
179028
179029 /* State 3. The integer just read is a column number. */
179030 default: assert( eState==3 );
179031 iCol = (int)v;
 
 
 
 
179032 if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM;
179033 pCsr->aStat[iCol+1].nDoc++;
179034 eState = 2;
179035 break;
179036 }
179037 }
179038
179039 pCsr->iCol = 0;
179040 rc = SQLITE_OK;
179041 }else{
179042 pCsr->isEof = 1;
179043 }
179044 return rc;
179045 }
@@ -195171,24 +195189,33 @@
195171 || p->op==RTREE_FALSE );
195172 assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */
195173 switch( p->op ){
195174 case RTREE_TRUE: return; /* Always satisfied */
195175 case RTREE_FALSE: break; /* Never satisfied */
195176 case RTREE_LE:
195177 case RTREE_LT:
195178 case RTREE_EQ:
195179 RTREE_DECODE_COORD(eInt, pCellData, val);
195180 /* val now holds the lower bound of the coordinate pair */
 
 
 
 
 
 
 
 
 
 
 
195181 if( p->u.rValue>=val ) return;
195182 if( p->op!=RTREE_EQ ) break; /* RTREE_LE and RTREE_LT end here */
195183 /* Fall through for the RTREE_EQ case */
195184
195185 default: /* RTREE_GT or RTREE_GE, or fallthrough of RTREE_EQ */
195186 pCellData += 4;
195187 RTREE_DECODE_COORD(eInt, pCellData, val);
195188 /* val now holds the upper bound of the coordinate pair */
195189 if( p->u.rValue<=val ) return;
 
195190 }
195191 *peWithin = NOT_WITHIN;
195192 }
195193
195194 /*
@@ -232459,11 +232486,11 @@
232459 int nArg, /* Number of args */
232460 sqlite3_value **apUnused /* Function arguments */
232461 ){
232462 assert( nArg==0 );
232463 UNUSED_PARAM2(nArg, apUnused);
232464 sqlite3_result_text(pCtx, "fts5: 2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba", -1, SQLITE_TRANSIENT);
232465 }
232466
232467 /*
232468 ** Return true if zName is the extension on one of the shadow tables used
232469 ** by this module.
232470
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.37.0"
456 #define SQLITE_VERSION_NUMBER 3037000
457 #define SQLITE_SOURCE_ID "2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -18501,11 +18501,10 @@
18501 TableLock *aTableLock; /* Required table locks for shared-cache mode */
18502 #endif
18503 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
18504 Parse *pToplevel; /* Parse structure for main program (or NULL) */
18505 Table *pTriggerTab; /* Table triggers are being coded for */
 
18506 union {
18507 int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
18508 Returning *pReturning; /* The RETURNING clause */
18509 } u1;
18510 u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
@@ -20059,11 +20058,11 @@
20058 #else
20059 # define sqlite3CteNew(P,T,E,S) ((void*)0)
20060 # define sqlite3CteDelete(D,C)
20061 # define sqlite3CteWithAdd(P,W,C) ((void*)0)
20062 # define sqlite3WithDelete(x,y)
20063 # define sqlite3WithPush(x,y,z) ((void*)0)
20064 #endif
20065 #ifndef SQLITE_OMIT_UPSERT
20066 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
20067 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20068 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -40030,40 +40029,50 @@
40029 OpenCounter(+1);
40030 verifyDbFile(pNew);
40031 }
40032 return rc;
40033 }
40034
40035 /*
40036 ** Directories to consider for temp files.
40037 */
40038 static const char *azTempDirs[] = {
40039 0,
40040 0,
40041 "/var/tmp",
40042 "/usr/tmp",
40043 "/tmp",
40044 "."
40045 };
40046
40047 /*
40048 ** Initialize first two members of azTempDirs[] array.
40049 */
40050 static void unixTempFileInit(void){
40051 azTempDirs[0] = getenv("SQLITE_TMPDIR");
40052 azTempDirs[1] = getenv("TMPDIR");
40053 }
40054
40055 /*
40056 ** Return the name of a directory in which to put temporary files.
40057 ** If no suitable temporary file directory can be found, return NULL.
40058 */
40059 static const char *unixTempFileDir(void){
 
 
 
 
 
 
 
 
40060 unsigned int i = 0;
40061 struct stat buf;
40062 const char *zDir = sqlite3_temp_directory;
40063
 
 
40064 while(1){
40065 if( zDir!=0
40066 && osStat(zDir, &buf)==0
40067 && S_ISDIR(buf.st_mode)
40068 && osAccess(zDir, 03)==0
40069 ){
40070 return zDir;
40071 }
40072 if( i>=sizeof(azTempDirs)/sizeof(azTempDirs[0]) ) break;
40073 zDir = azTempDirs[i++];
40074 }
40075 return 0;
40076 }
40077
40078 /*
@@ -42330,10 +42339,13 @@
42339 ** READ-4 UNIX_SHM_BASE+7 127
42340 ** DMS UNIX_SHM_BASE+8 128
42341 */
42342 assert( UNIX_SHM_DMS==128 ); /* Byte offset of the deadman-switch */
42343 #endif
42344
42345 /* Initialize temp file dir array. */
42346 unixTempFileInit();
42347
42348 return SQLITE_OK;
42349 }
42350
42351 /*
@@ -107083,16 +107095,13 @@
107095 if( pB->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA,pB->pLeft,iTab)<2 ){
107096 return 1;
107097 }
107098 return 2;
107099 }
107100 assert( !ExprHasProperty(pA, EP_IntValue) );
107101 assert( !ExprHasProperty(pB, EP_IntValue) );
107102 if( pA->u.zToken ){
 
 
 
107103 if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
107104 if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107105 #ifndef SQLITE_OMIT_WINDOWFUNC
107106 assert( pA->op==pB->op );
107107 if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
@@ -107106,11 +107115,16 @@
107115 #endif
107116 }else if( pA->op==TK_NULL ){
107117 return 0;
107118 }else if( pA->op==TK_COLLATE ){
107119 if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
107120 }else
107121 if( pB->u.zToken!=0
107122 && pA->op!=TK_COLUMN
107123 && pA->op!=TK_AGG_COLUMN
107124 && strcmp(pA->u.zToken,pB->u.zToken)!=0
107125 ){
107126 return 2;
107127 }
107128 }
107129 if( (pA->flags & (EP_Distinct|EP_Commuted))
107130 != (pB->flags & (EP_Distinct|EP_Commuted)) ) return 2;
@@ -165855,10 +165869,11 @@
165869 int n = 0; /* Length of the next token token */
165870 int tokenType; /* type of the next token */
165871 int lastTokenParsed = -1; /* type of the previous token */
165872 sqlite3 *db = pParse->db; /* The database connection */
165873 int mxSqlLen; /* Max length of an SQL string */
165874 Parse *pParentParse = 0; /* Outer parse context, if any */
165875 #ifdef sqlite3Parser_ENGINEALWAYSONSTACK
165876 yyParser sEngine; /* Space to hold the Lemon-generated Parser object */
165877 #endif
165878 VVA_ONLY( u8 startedWithOom = db->mallocFailed );
165879
@@ -165890,11 +165905,11 @@
165905 #endif
165906 assert( pParse->pNewTable==0 );
165907 assert( pParse->pNewTrigger==0 );
165908 assert( pParse->nVar==0 );
165909 assert( pParse->pVList==0 );
165910 pParentParse = db->pParse;
165911 db->pParse = pParse;
165912 while( 1 ){
165913 n = sqlite3GetToken((u8*)zSql, &tokenType);
165914 mxSqlLen -= n;
165915 if( mxSqlLen<0 ){
@@ -166005,12 +166020,11 @@
166020 }
166021 if( !IN_RENAME_OBJECT ){
166022 sqlite3DeleteTrigger(db, pParse->pNewTrigger);
166023 }
166024 sqlite3DbFree(db, pParse->pVList);
166025 db->pParse = pParentParse;
 
166026 assert( nErr==0 || pParse->rc!=SQLITE_OK );
166027 return nErr;
166028 }
166029
166030
@@ -178984,10 +178998,11 @@
178998 }
178999
179000 if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM;
179001 memset(pCsr->aStat, 0, sizeof(struct Fts3auxColstats) * pCsr->nStat);
179002 iCol = 0;
179003 rc = SQLITE_OK;
179004
179005 while( i<nDoclist ){
179006 sqlite3_int64 v = 0;
179007
179008 i += sqlite3Fts3GetVarint(&aDoclist[i], &v);
@@ -179027,19 +179042,22 @@
179042 break;
179043
179044 /* State 3. The integer just read is a column number. */
179045 default: assert( eState==3 );
179046 iCol = (int)v;
179047 if( iCol<1 ){
179048 rc = SQLITE_CORRUPT_VTAB;
179049 break;
179050 }
179051 if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM;
179052 pCsr->aStat[iCol+1].nDoc++;
179053 eState = 2;
179054 break;
179055 }
179056 }
179057
179058 pCsr->iCol = 0;
 
179059 }else{
179060 pCsr->isEof = 1;
179061 }
179062 return rc;
179063 }
@@ -195171,24 +195189,33 @@
195189 || p->op==RTREE_FALSE );
195190 assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */
195191 switch( p->op ){
195192 case RTREE_TRUE: return; /* Always satisfied */
195193 case RTREE_FALSE: break; /* Never satisfied */
 
 
195194 case RTREE_EQ:
195195 RTREE_DECODE_COORD(eInt, pCellData, val);
195196 /* val now holds the lower bound of the coordinate pair */
195197 if( p->u.rValue>=val ){
195198 pCellData += 4;
195199 RTREE_DECODE_COORD(eInt, pCellData, val);
195200 /* val now holds the upper bound of the coordinate pair */
195201 if( p->u.rValue<=val ) return;
195202 }
195203 break;
195204 case RTREE_LE:
195205 case RTREE_LT:
195206 RTREE_DECODE_COORD(eInt, pCellData, val);
195207 /* val now holds the lower bound of the coordinate pair */
195208 if( p->u.rValue>=val ) return;
195209 break;
 
195210
195211 default:
195212 pCellData += 4;
195213 RTREE_DECODE_COORD(eInt, pCellData, val);
195214 /* val now holds the upper bound of the coordinate pair */
195215 if( p->u.rValue<=val ) return;
195216 break;
195217 }
195218 *peWithin = NOT_WITHIN;
195219 }
195220
195221 /*
@@ -232459,11 +232486,11 @@
232486 int nArg, /* Number of args */
232487 sqlite3_value **apUnused /* Function arguments */
232488 ){
232489 assert( nArg==0 );
232490 UNUSED_PARAM2(nArg, apUnused);
232491 sqlite3_result_text(pCtx, "fts5: 2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8", -1, SQLITE_TRANSIENT);
232492 }
232493
232494 /*
232495 ** Return true if zName is the extension on one of the shadow tables used
232496 ** by this module.
232497
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.37.0"
150150
#define SQLITE_VERSION_NUMBER 3037000
151
-#define SQLITE_SOURCE_ID "2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba"
151
+#define SQLITE_SOURCE_ID "2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.37.0"
150 #define SQLITE_VERSION_NUMBER 3037000
151 #define SQLITE_SOURCE_ID "2021-11-15 19:10:13 bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.37.0"
150 #define SQLITE_VERSION_NUMBER 3037000
151 #define SQLITE_SOURCE_ID "2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

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