Fossil SCM

Update the built-in SQLite to the second 3.32.0 beta, for testing.

drh 2020-05-17 16:33 trunk
Commit 5181332eb5bbe21c48be5dee1cdb9de574f227a8fc76e05ee2cd7fbb4bc0263f
3 files changed +5 -2 +109 -50 +2 -2
+5 -2
--- src/shell.c
+++ src/shell.c
@@ -7998,13 +7998,16 @@
79987998
while( rc==SQLITE_OK && sqlite3_step(pExplain)==SQLITE_ROW ){
79997999
/* int iId = sqlite3_column_int(pExplain, 0); */
80008000
/* int iParent = sqlite3_column_int(pExplain, 1); */
80018001
/* int iNotUsed = sqlite3_column_int(pExplain, 2); */
80028002
const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3);
8003
- int nDetail = STRLEN(zDetail);
8003
+ int nDetail;
80048004
int i;
80058005
8006
+ if( !zDetail ) continue;
8007
+ nDetail = STRLEN(zDetail);
8008
+
80068009
for(i=0; i<nDetail; i++){
80078010
const char *zIdx = 0;
80088011
if( memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
80098012
zIdx = &zDetail[i+13];
80108013
}else if( memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0 ){
@@ -8820,11 +8823,11 @@
88208823
sqlite3_free(p->zCandidates);
88218824
sqlite3_free(p);
88228825
}
88238826
}
88248827
8825
-#endif /* ifndef SQLITE_OMIT_VIRTUAL_TABLE */
8828
+#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
88268829
88278830
/************************* End ../ext/expert/sqlite3expert.c ********************/
88288831
88298832
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
88308833
/************************* Begin ../ext/misc/dbdata.c ******************/
88318834
--- src/shell.c
+++ src/shell.c
@@ -7998,13 +7998,16 @@
7998 while( rc==SQLITE_OK && sqlite3_step(pExplain)==SQLITE_ROW ){
7999 /* int iId = sqlite3_column_int(pExplain, 0); */
8000 /* int iParent = sqlite3_column_int(pExplain, 1); */
8001 /* int iNotUsed = sqlite3_column_int(pExplain, 2); */
8002 const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3);
8003 int nDetail = STRLEN(zDetail);
8004 int i;
8005
 
 
 
8006 for(i=0; i<nDetail; i++){
8007 const char *zIdx = 0;
8008 if( memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
8009 zIdx = &zDetail[i+13];
8010 }else if( memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0 ){
@@ -8820,11 +8823,11 @@
8820 sqlite3_free(p->zCandidates);
8821 sqlite3_free(p);
8822 }
8823 }
8824
8825 #endif /* ifndef SQLITE_OMIT_VIRTUAL_TABLE */
8826
8827 /************************* End ../ext/expert/sqlite3expert.c ********************/
8828
8829 #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
8830 /************************* Begin ../ext/misc/dbdata.c ******************/
8831
--- src/shell.c
+++ src/shell.c
@@ -7998,13 +7998,16 @@
7998 while( rc==SQLITE_OK && sqlite3_step(pExplain)==SQLITE_ROW ){
7999 /* int iId = sqlite3_column_int(pExplain, 0); */
8000 /* int iParent = sqlite3_column_int(pExplain, 1); */
8001 /* int iNotUsed = sqlite3_column_int(pExplain, 2); */
8002 const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3);
8003 int nDetail;
8004 int i;
8005
8006 if( !zDetail ) continue;
8007 nDetail = STRLEN(zDetail);
8008
8009 for(i=0; i<nDetail; i++){
8010 const char *zIdx = 0;
8011 if( memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
8012 zIdx = &zDetail[i+13];
8013 }else if( memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0 ){
@@ -8820,11 +8823,11 @@
8823 sqlite3_free(p->zCandidates);
8824 sqlite3_free(p);
8825 }
8826 }
8827
8828 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
8829
8830 /************************* End ../ext/expert/sqlite3expert.c ********************/
8831
8832 #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
8833 /************************* Begin ../ext/misc/dbdata.c ******************/
8834
+109 -50
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
11651165
#define SQLITE_VERSION "3.32.0"
11661166
#define SQLITE_VERSION_NUMBER 3032000
1167
-#define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a"
1167
+#define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -6532,11 +6532,11 @@
65326532
** when first called if N is less than or equal to zero or if a memory
65336533
** allocate error occurs.
65346534
**
65356535
** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
65366536
** determined by the N parameter on first successful call. Changing the
6537
-** value of N in any subsequents call to sqlite3_aggregate_context() within
6537
+** value of N in any subsequent call to sqlite3_aggregate_context() within
65386538
** the same aggregate function instance will not resize the memory
65396539
** allocation.)^ Within the xFinal callback, it is customary to set
65406540
** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
65416541
** pointless memory allocations occur.
65426542
**
@@ -20065,12 +20065,14 @@
2006520065
# define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0)
2006620066
#endif
2006720067
SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db);
2006820068
#ifndef SQLITE_OMIT_VIRTUALTABLE
2006920069
SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
20070
+SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3*,Table*,const char*);
2007020071
#else
2007120072
# define sqlite3ShadowTableName(A,B) 0
20073
+# define sqlite3IsShadowTableOf(A,B,C) 0
2007220074
#endif
2007320075
SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*);
2007420076
SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*);
2007520077
SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*);
2007620078
SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int);
@@ -27925,11 +27927,11 @@
2792527927
}
2792627928
}else{
2792727929
assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
2792827930
assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
2792927931
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
27930
- pNew = sqlite3_realloc64(p, n);
27932
+ pNew = sqlite3Realloc(p, n);
2793127933
if( !pNew ){
2793227934
sqlite3OomFault(db);
2793327935
}
2793427936
sqlite3MemdebugSetType(pNew,
2793527937
(db->lookaside.bDisable==0 ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
@@ -29002,11 +29004,11 @@
2900229004
p->nAlloc = (int)szNew;
2900329005
}
2900429006
if( p->db ){
2900529007
zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
2900629008
}else{
29007
- zNew = sqlite3_realloc64(zOld, p->nAlloc);
29009
+ zNew = sqlite3Realloc(zOld, p->nAlloc);
2900829010
}
2900929011
if( zNew ){
2901029012
assert( p->zText!=0 || p->nChar==0 );
2901129013
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
2901229014
p->zText = zNew;
@@ -29344,11 +29346,11 @@
2934429346
** and segfaults if you give it a long long int.
2934529347
*/
2934629348
SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
2934729349
va_list ap;
2934829350
StrAccum acc;
29349
- char zBuf[500];
29351
+ char zBuf[SQLITE_PRINT_BUF_SIZE*10];
2935029352
sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
2935129353
va_start(ap,zFormat);
2935229354
sqlite3_str_vappendf(&acc, zFormat, ap);
2935329355
va_end(ap);
2935429356
sqlite3StrAccumFinish(&acc);
@@ -45049,10 +45051,11 @@
4504945051
}
4505045052
4505145053
/* Forward references to VFS helper methods used for temporary files */
4505245054
static int winGetTempname(sqlite3_vfs *, char **);
4505345055
static int winIsDir(const void *);
45056
+static BOOL winIsLongPathPrefix(const char *);
4505445057
static BOOL winIsDriveLetterAndColon(const char *);
4505545058
4505645059
/*
4505745060
** Control and query of the open file handle.
4505845061
*/
@@ -47027,10 +47030,21 @@
4702747030
*pResOut = rc;
4702847031
OSTRACE(("ACCESS name=%s, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n",
4702947032
zFilename, pResOut, *pResOut));
4703047033
return SQLITE_OK;
4703147034
}
47035
+
47036
+/*
47037
+** Returns non-zero if the specified path name starts with the "long path"
47038
+** prefix.
47039
+*/
47040
+static BOOL winIsLongPathPrefix(
47041
+ const char *zPathname
47042
+){
47043
+ return ( zPathname[0]=='\\' && zPathname[1]=='\\'
47044
+ && zPathname[2]=='?' && zPathname[3]=='\\' );
47045
+}
4703247046
4703347047
/*
4703447048
** Returns non-zero if the specified path name starts with a drive letter
4703547049
** followed by a colon character.
4703647050
*/
@@ -47092,14 +47106,15 @@
4709247106
DWORD nByte;
4709347107
void *zConverted;
4709447108
char *zOut;
4709547109
#endif
4709647110
47097
- /* If this path name begins with "/X:", where "X" is any alphabetic
47098
- ** character, discard the initial "/" from the pathname.
47111
+ /* If this path name begins with "/X:" or "\\?\", where "X" is any
47112
+ ** alphabetic character, discard the initial "/" from the pathname.
4709947113
*/
47100
- if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){
47114
+ if( zRelative[0]=='/' && (winIsDriveLetterAndColon(zRelative+1)
47115
+ || winIsLongPathPrefix(zRelative+1)) ){
4710147116
zRelative++;
4710247117
}
4710347118
4710447119
#if defined(__CYGWIN__)
4710547120
SimulateIOError( return SQLITE_ERROR );
@@ -47851,11 +47866,11 @@
4785147866
if( newSz>p->szMax ){
4785247867
return SQLITE_FULL;
4785347868
}
4785447869
newSz *= 2;
4785547870
if( newSz>p->szMax ) newSz = p->szMax;
47856
- pNew = sqlite3_realloc64(p->aData, newSz);
47871
+ pNew = sqlite3Realloc(p->aData, newSz);
4785747872
if( pNew==0 ) return SQLITE_NOMEM;
4785847873
p->aData = pNew;
4785947874
p->szAlloc = newSz;
4786047875
return SQLITE_OK;
4786147876
}
@@ -59821,11 +59836,11 @@
5982159836
5982259837
/* Enlarge the pWal->apWiData[] array if required */
5982359838
if( pWal->nWiData<=iPage ){
5982459839
sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
5982559840
volatile u32 **apNew;
59826
- apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte);
59841
+ apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
5982759842
if( !apNew ){
5982859843
*ppPage = 0;
5982959844
return SQLITE_NOMEM_BKPT;
5983059845
}
5983159846
memset((void*)&apNew[pWal->nWiData], 0,
@@ -79308,10 +79323,11 @@
7930879323
char *zP4;
7930979324
char *zCom;
7931079325
sqlite3 dummyDb;
7931179326
static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
7931279327
if( pOut==0 ) pOut = stdout;
79328
+ sqlite3BeginBenignMalloc();
7931379329
dummyDb.mallocFailed = 1;
7931479330
zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp);
7931579331
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
7931679332
zCom = sqlite3VdbeDisplayComment(0, pOp, zP4);
7931779333
#else
@@ -79326,10 +79342,11 @@
7932679342
zCom ? zCom : ""
7932779343
);
7932879344
fflush(pOut);
7932979345
sqlite3_free(zP4);
7933079346
sqlite3_free(zCom);
79347
+ sqlite3EndBenignMalloc();
7933179348
}
7933279349
#endif
7933379350
7933479351
/*
7933579352
** Initialize an array of N Mem element.
@@ -84067,11 +84084,11 @@
8406784084
p->db->errCode = SQLITE_OK;
8406884085
8406984086
/* If the bit corresponding to this variable in Vdbe.expmask is set, then
8407084087
** binding a new value to this variable invalidates the current query plan.
8407184088
**
84072
- ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host
84089
+ ** IMPLEMENTATION-OF: R-57496-20354 If the specific value bound to a host
8407384090
** parameter in the WHERE clause might influence the choice of query plan
8407484091
** for a statement, then the statement will be automatically recompiled,
8407584092
** as if there had been a schema change, on the first sqlite3_step() call
8407684093
** following any change to the bindings of that parameter.
8407784094
*/
@@ -96366,12 +96383,12 @@
9636696383
*************************************************************************
9636796384
**
9636896385
** This file implements virtual-tables for examining the bytecode content
9636996386
** of a prepared statement.
9637096387
*/
96371
-#ifdef SQLITE_ENABLE_BYTECODE_VTAB
9637296388
/* #include "sqliteInt.h" */
96389
+#if defined(SQLITE_ENABLE_BYTECODE_VTAB) && !defined(SQLITE_OMIT_VIRTUALTABLE)
9637396390
/* #include "vdbeInt.h" */
9637496391
9637596392
/* An instance of the bytecode() table-valued function.
9637696393
*/
9637796394
typedef struct bytecodevtab bytecodevtab;
@@ -96772,10 +96789,12 @@
9677296789
if( rc==SQLITE_OK ){
9677396790
rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db);
9677496791
}
9677596792
return rc;
9677696793
}
96794
+#elif defined(SQLITE_ENABLE_BYTECODE_VTAB)
96795
+SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; }
9677796796
#endif /* SQLITE_ENABLE_BYTECODE_VTAB */
9677896797
9677996798
/************** End of vdbevtab.c ********************************************/
9678096799
/************** Begin file memjournal.c **************************************/
9678196800
/*
@@ -105505,11 +105524,14 @@
105505105524
if( !zName ) goto exit_rename_table;
105506105525
105507105526
/* Check that a table or index named 'zName' does not already exist
105508105527
** in database iDb. If so, this is an error.
105509105528
*/
105510
- if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){
105529
+ if( sqlite3FindTable(db, zName, zDb)
105530
+ || sqlite3FindIndex(db, zName, zDb)
105531
+ || sqlite3IsShadowTableOf(db, pTab, zName)
105532
+ ){
105511105533
sqlite3ErrorMsg(pParse,
105512105534
"there is already another table or index with this name: %s", zName);
105513105535
goto exit_rename_table;
105514105536
}
105515105537
@@ -110252,26 +110274,43 @@
110252110274
** exists */
110253110275
if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
110254110276
return 0;
110255110277
}
110256110278
#endif
110257
- while(1){
110258
- for(i=OMIT_TEMPDB; i<db->nDb; i++){
110259
- int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
110260
- if( zDatabase==0 || sqlite3DbIsNamed(db, j, zDatabase) ){
110261
- assert( sqlite3SchemaMutexHeld(db, j, 0) );
110262
- p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
110263
- if( p ) return p;
110264
- }
110265
- }
110266
- /* Not found. If the name we were looking for was temp.sqlite_master
110267
- ** then change the name to sqlite_temp_master and try again. */
110268
- if( sqlite3StrICmp(zName, MASTER_NAME)!=0 ) break;
110269
- if( sqlite3_stricmp(zDatabase, db->aDb[1].zDbSName)!=0 ) break;
110270
- zName = TEMP_MASTER_NAME;
110271
- }
110272
- return 0;
110279
+ if( zDatabase ){
110280
+ for(i=0; i<db->nDb; i++){
110281
+ if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
110282
+ }
110283
+ if( i>=db->nDb ){
110284
+ /* No match against the official names. But always match "main"
110285
+ ** to schema 0 as a legacy fallback. */
110286
+ if( sqlite3StrICmp(zDatabase,"main")==0 ){
110287
+ i = 0;
110288
+ }else{
110289
+ return 0;
110290
+ }
110291
+ }
110292
+ p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110293
+ if( p==0 && i==1 && sqlite3StrICmp(zName, MASTER_NAME)==0 ){
110294
+ /* All temp.sqlite_master to be an alias for sqlite_temp_master */
110295
+ p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, TEMP_MASTER_NAME);
110296
+ }
110297
+ }else{
110298
+ /* Match against TEMP first */
110299
+ p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, zName);
110300
+ if( p ) return p;
110301
+ /* The main database is second */
110302
+ p = sqlite3HashFind(&db->aDb[0].pSchema->tblHash, zName);
110303
+ if( p ) return p;
110304
+ /* Attached databases are in order of attachment */
110305
+ for(i=2; i<db->nDb; i++){
110306
+ assert( sqlite3SchemaMutexHeld(db, i, 0) );
110307
+ p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110308
+ if( p ) break;
110309
+ }
110310
+ }
110311
+ return p;
110273110312
}
110274110313
110275110314
/*
110276110315
** Locate the in-memory structure that describes a particular database
110277110316
** table given the name of that table and (optionally) the name of the
@@ -112071,10 +112110,32 @@
112071112110
assert( pPk->nColumn==j );
112072112111
assert( pTab->nNVCol<=j );
112073112112
recomputeColumnsNotIndexed(pPk);
112074112113
}
112075112114
112115
+
112116
+#ifndef SQLITE_OMIT_VIRTUALTABLE
112117
+/*
112118
+** Return true if pTab is a virtual table and zName is a shadow table name
112119
+** for that virtual table.
112120
+*/
112121
+SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3 *db, Table *pTab, const char *zName){
112122
+ int nName; /* Length of zName */
112123
+ Module *pMod; /* Module for the virtual table */
112124
+
112125
+ if( !IsVirtual(pTab) ) return 0;
112126
+ nName = sqlite3Strlen30(pTab->zName);
112127
+ if( sqlite3_strnicmp(zName, pTab->zName, nName)!=0 ) return 0;
112128
+ if( zName[nName]!='_' ) return 0;
112129
+ pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]);
112130
+ if( pMod==0 ) return 0;
112131
+ if( pMod->pModule->iVersion<3 ) return 0;
112132
+ if( pMod->pModule->xShadowName==0 ) return 0;
112133
+ return pMod->pModule->xShadowName(zName+nName+1);
112134
+}
112135
+#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
112136
+
112076112137
#ifndef SQLITE_OMIT_VIRTUALTABLE
112077112138
/*
112078112139
** Return true if zName is a shadow table name in the current database
112079112140
** connection.
112080112141
**
@@ -112082,26 +112143,21 @@
112082112143
** restored to its original value prior to this routine returning.
112083112144
*/
112084112145
SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){
112085112146
char *zTail; /* Pointer to the last "_" in zName */
112086112147
Table *pTab; /* Table that zName is a shadow of */
112087
- Module *pMod; /* Module for the virtual table */
112088
-
112089112148
zTail = strrchr(zName, '_');
112090112149
if( zTail==0 ) return 0;
112091112150
*zTail = 0;
112092112151
pTab = sqlite3FindTable(db, zName, 0);
112093112152
*zTail = '_';
112094112153
if( pTab==0 ) return 0;
112095112154
if( !IsVirtual(pTab) ) return 0;
112096
- pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]);
112097
- if( pMod==0 ) return 0;
112098
- if( pMod->pModule->iVersion<3 ) return 0;
112099
- if( pMod->pModule->xShadowName==0 ) return 0;
112100
- return pMod->pModule->xShadowName(zTail+1);
112155
+ return sqlite3IsShadowTableOf(db, pTab, zName);
112101112156
}
112102112157
#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
112158
+
112103112159
112104112160
#ifdef SQLITE_DEBUG
112105112161
/*
112106112162
** Mark all nodes of an expression as EP_Immutable, indicating that
112107112163
** they should not be changed. Expressions attached to a table or
@@ -117788,11 +117844,11 @@
117788117844
if( (cntExpand&(cntExpand-1))==0 ){
117789117845
/* Grow the size of the output buffer only on substitutions
117790117846
** whose index is a power of two: 1, 2, 4, 8, 16, 32, ... */
117791117847
u8 *zOld;
117792117848
zOld = zOut;
117793
- zOut = sqlite3_realloc64(zOut, (int)nOut + (nOut - nStr - 1));
117849
+ zOut = sqlite3Realloc(zOut, (int)nOut + (nOut - nStr - 1));
117794117850
if( zOut==0 ){
117795117851
sqlite3_result_error_nomem(context);
117796117852
sqlite3_free(zOld);
117797117853
return;
117798117854
}
@@ -135579,11 +135635,11 @@
135579135635
need = nCol;
135580135636
}
135581135637
if( p->nData + need > p->nAlloc ){
135582135638
char **azNew;
135583135639
p->nAlloc = p->nAlloc*2 + need;
135584
- azNew = sqlite3_realloc64( p->azResult, sizeof(char*)*p->nAlloc );
135640
+ azNew = sqlite3Realloc( p->azResult, sizeof(char*)*p->nAlloc );
135585135641
if( azNew==0 ) goto malloc_failed;
135586135642
p->azResult = azNew;
135587135643
}
135588135644
135589135645
/* If this is the first row, then generate an extra row containing
@@ -135688,11 +135744,11 @@
135688135744
sqlite3_free_table(&res.azResult[1]);
135689135745
return rc;
135690135746
}
135691135747
if( res.nAlloc>res.nData ){
135692135748
char **azNew;
135693
- azNew = sqlite3_realloc64( res.azResult, sizeof(char*)*res.nData );
135749
+ azNew = sqlite3Realloc( res.azResult, sizeof(char*)*res.nData );
135694135750
if( azNew==0 ){
135695135751
sqlite3_free_table(&res.azResult[1]);
135696135752
db->errCode = SQLITE_NOMEM;
135697135753
return SQLITE_NOMEM_BKPT;
135698135754
}
@@ -136978,14 +137034,14 @@
136978137034
** Therefore, the P4 parameter is only required if the default value for
136979137035
** the column is a literal number, string or null. The sqlite3ValueFromExpr()
136980137036
** function is capable of transforming these types of expressions into
136981137037
** sqlite3_value objects.
136982137038
**
136983
-** If parameter iReg is not negative, code an OP_RealAffinity instruction
136984
-** on register iReg. This is used when an equivalent integer value is
136985
-** stored in place of an 8-byte floating point value in order to save
136986
-** space.
137039
+** If column as REAL affinity and the table is an ordinary b-tree table
137040
+** (not a virtual table) then the value might have been stored as an
137041
+** integer. In that case, add an OP_RealAffinity opcode to make sure
137042
+** it has been converted into REAL.
136987137043
*/
136988137044
SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){
136989137045
assert( pTab!=0 );
136990137046
if( !pTab->pSelect ){
136991137047
sqlite3_value *pValue = 0;
@@ -136998,11 +137054,11 @@
136998137054
if( pValue ){
136999137055
sqlite3VdbeAppendP4(v, pValue, P4_MEM);
137000137056
}
137001137057
}
137002137058
#ifndef SQLITE_OMIT_FLOATING_POINT
137003
- if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
137059
+ if( pTab->aCol[i].affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){
137004137060
sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg);
137005137061
}
137006137062
#endif
137007137063
}
137008137064
@@ -139847,11 +139903,11 @@
139847139903
assert( IsVirtual(pTab) );
139848139904
for(i=0; i<pToplevel->nVtabLock; i++){
139849139905
if( pTab==pToplevel->apVtabLock[i] ) return;
139850139906
}
139851139907
n = (pToplevel->nVtabLock+1)*sizeof(pToplevel->apVtabLock[0]);
139852
- apVtabLock = sqlite3_realloc64(pToplevel->apVtabLock, n);
139908
+ apVtabLock = sqlite3Realloc(pToplevel->apVtabLock, n);
139853139909
if( apVtabLock ){
139854139910
pToplevel->apVtabLock = apVtabLock;
139855139911
pToplevel->apVtabLock[pToplevel->nVtabLock++] = pTab;
139856139912
}else{
139857139913
sqlite3OomFault(pToplevel->db);
@@ -160337,10 +160393,11 @@
160337160393
}
160338160394
#endif
160339160395
if( rc==SQLITE_OK ){
160340160396
sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
160341160397
sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
160398
+ sqlite3MemoryBarrier();
160342160399
sqlite3GlobalConfig.isInit = 1;
160343160400
#ifdef SQLITE_EXTRA_INIT
160344160401
bRunExtraInit = 1;
160345160402
#endif
160346160403
}
@@ -163285,11 +163342,11 @@
163285163342
assert( SQLITE_OPEN_CREATE == 0x04 );
163286163343
testcase( (1<<(flags&7))==0x02 ); /* READONLY */
163287163344
testcase( (1<<(flags&7))==0x04 ); /* READWRITE */
163288163345
testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */
163289163346
if( ((1<<(flags&7)) & 0x46)==0 ){
163290
- rc = SQLITE_MISUSE_BKPT; /* IMP: R-65497-44594 */
163347
+ rc = SQLITE_MISUSE_BKPT; /* IMP: R-18321-05872 */
163291163348
}else{
163292163349
rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
163293163350
}
163294163351
if( rc!=SQLITE_OK ){
163295163352
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
@@ -171209,10 +171266,11 @@
171209171266
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){
171210171267
memset(pDl->pList, 0, pDl->nList);
171211171268
fts3EvalNextRow(pCsr, pLeft, pRc);
171212171269
}
171213171270
}
171271
+ pRight->bEof = pLeft->bEof = 1;
171214171272
}
171215171273
}
171216171274
break;
171217171275
}
171218171276
@@ -182754,11 +182812,11 @@
182754182812
iStart = pExpr->iPhrase * p->nCol;
182755182813
}else{
182756182814
iStart = pExpr->iPhrase * ((p->nCol + 31) / 32);
182757182815
}
182758182816
182759
- while( 1 ){
182817
+ if( pIter ) while( 1 ){
182760182818
int nHit = fts3ColumnlistCount(&pIter);
182761182819
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){
182762182820
if( p->flag==FTS3_MATCHINFO_LHITS ){
182763182821
p->aMatchinfo[iStart + iCol] = (u32)nHit;
182764182822
}else if( nHit ){
@@ -184668,10 +184726,11 @@
184668184726
}
184669184727
184670184728
/* Append N bytes from zIn onto the end of the JsonString string.
184671184729
*/
184672184730
static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){
184731
+ if( N==0 ) return;
184673184732
if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return;
184674184733
memcpy(p->zBuf+p->nUsed, zIn, N);
184675184734
p->nUsed += N;
184676184735
}
184677184736
@@ -224679,11 +224738,11 @@
224679224738
int nArg, /* Number of args */
224680224739
sqlite3_value **apUnused /* Function arguments */
224681224740
){
224682224741
assert( nArg==0 );
224683224742
UNUSED_PARAM2(nArg, apUnused);
224684
- sqlite3_result_text(pCtx, "fts5: 2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a", -1, SQLITE_TRANSIENT);
224743
+ sqlite3_result_text(pCtx, "fts5: 2020-05-17 00:26:44 1313557b512297e7b75ed748894379b2022aecf696d5a58318e46a668321c1ff", -1, SQLITE_TRANSIENT);
224685224744
}
224686224745
224687224746
/*
224688224747
** Return true if zName is the extension on one of the shadow tables used
224689224748
** by this module.
@@ -229462,12 +229521,12 @@
229462229521
}
229463229522
#endif /* SQLITE_CORE */
229464229523
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229465229524
229466229525
/************** End of stmt.c ************************************************/
229467
-#if __LINE__!=229467
229526
+#if __LINE__!=229526
229468229527
#undef SQLITE_SOURCE_ID
229469
-#define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88alt2"
229528
+#define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469falt2"
229470229529
#endif
229471229530
/* Return the source-id for this library */
229472229531
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229473229532
/************************** End of sqlite3.c ******************************/
229474229533
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.32.0"
1166 #define SQLITE_VERSION_NUMBER 3032000
1167 #define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -6532,11 +6532,11 @@
6532 ** when first called if N is less than or equal to zero or if a memory
6533 ** allocate error occurs.
6534 **
6535 ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
6536 ** determined by the N parameter on first successful call. Changing the
6537 ** value of N in any subsequents call to sqlite3_aggregate_context() within
6538 ** the same aggregate function instance will not resize the memory
6539 ** allocation.)^ Within the xFinal callback, it is customary to set
6540 ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
6541 ** pointless memory allocations occur.
6542 **
@@ -20065,12 +20065,14 @@
20065 # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0)
20066 #endif
20067 SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db);
20068 #ifndef SQLITE_OMIT_VIRTUALTABLE
20069 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
 
20070 #else
20071 # define sqlite3ShadowTableName(A,B) 0
 
20072 #endif
20073 SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*);
20074 SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*);
20075 SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*);
20076 SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int);
@@ -27925,11 +27927,11 @@
27925 }
27926 }else{
27927 assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
27928 assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
27929 sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
27930 pNew = sqlite3_realloc64(p, n);
27931 if( !pNew ){
27932 sqlite3OomFault(db);
27933 }
27934 sqlite3MemdebugSetType(pNew,
27935 (db->lookaside.bDisable==0 ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
@@ -29002,11 +29004,11 @@
29002 p->nAlloc = (int)szNew;
29003 }
29004 if( p->db ){
29005 zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
29006 }else{
29007 zNew = sqlite3_realloc64(zOld, p->nAlloc);
29008 }
29009 if( zNew ){
29010 assert( p->zText!=0 || p->nChar==0 );
29011 if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
29012 p->zText = zNew;
@@ -29344,11 +29346,11 @@
29344 ** and segfaults if you give it a long long int.
29345 */
29346 SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
29347 va_list ap;
29348 StrAccum acc;
29349 char zBuf[500];
29350 sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
29351 va_start(ap,zFormat);
29352 sqlite3_str_vappendf(&acc, zFormat, ap);
29353 va_end(ap);
29354 sqlite3StrAccumFinish(&acc);
@@ -45049,10 +45051,11 @@
45049 }
45050
45051 /* Forward references to VFS helper methods used for temporary files */
45052 static int winGetTempname(sqlite3_vfs *, char **);
45053 static int winIsDir(const void *);
 
45054 static BOOL winIsDriveLetterAndColon(const char *);
45055
45056 /*
45057 ** Control and query of the open file handle.
45058 */
@@ -47027,10 +47030,21 @@
47027 *pResOut = rc;
47028 OSTRACE(("ACCESS name=%s, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n",
47029 zFilename, pResOut, *pResOut));
47030 return SQLITE_OK;
47031 }
 
 
 
 
 
 
 
 
 
 
 
47032
47033 /*
47034 ** Returns non-zero if the specified path name starts with a drive letter
47035 ** followed by a colon character.
47036 */
@@ -47092,14 +47106,15 @@
47092 DWORD nByte;
47093 void *zConverted;
47094 char *zOut;
47095 #endif
47096
47097 /* If this path name begins with "/X:", where "X" is any alphabetic
47098 ** character, discard the initial "/" from the pathname.
47099 */
47100 if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){
 
47101 zRelative++;
47102 }
47103
47104 #if defined(__CYGWIN__)
47105 SimulateIOError( return SQLITE_ERROR );
@@ -47851,11 +47866,11 @@
47851 if( newSz>p->szMax ){
47852 return SQLITE_FULL;
47853 }
47854 newSz *= 2;
47855 if( newSz>p->szMax ) newSz = p->szMax;
47856 pNew = sqlite3_realloc64(p->aData, newSz);
47857 if( pNew==0 ) return SQLITE_NOMEM;
47858 p->aData = pNew;
47859 p->szAlloc = newSz;
47860 return SQLITE_OK;
47861 }
@@ -59821,11 +59836,11 @@
59821
59822 /* Enlarge the pWal->apWiData[] array if required */
59823 if( pWal->nWiData<=iPage ){
59824 sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
59825 volatile u32 **apNew;
59826 apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte);
59827 if( !apNew ){
59828 *ppPage = 0;
59829 return SQLITE_NOMEM_BKPT;
59830 }
59831 memset((void*)&apNew[pWal->nWiData], 0,
@@ -79308,10 +79323,11 @@
79308 char *zP4;
79309 char *zCom;
79310 sqlite3 dummyDb;
79311 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
79312 if( pOut==0 ) pOut = stdout;
 
79313 dummyDb.mallocFailed = 1;
79314 zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp);
79315 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79316 zCom = sqlite3VdbeDisplayComment(0, pOp, zP4);
79317 #else
@@ -79326,10 +79342,11 @@
79326 zCom ? zCom : ""
79327 );
79328 fflush(pOut);
79329 sqlite3_free(zP4);
79330 sqlite3_free(zCom);
 
79331 }
79332 #endif
79333
79334 /*
79335 ** Initialize an array of N Mem element.
@@ -84067,11 +84084,11 @@
84067 p->db->errCode = SQLITE_OK;
84068
84069 /* If the bit corresponding to this variable in Vdbe.expmask is set, then
84070 ** binding a new value to this variable invalidates the current query plan.
84071 **
84072 ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host
84073 ** parameter in the WHERE clause might influence the choice of query plan
84074 ** for a statement, then the statement will be automatically recompiled,
84075 ** as if there had been a schema change, on the first sqlite3_step() call
84076 ** following any change to the bindings of that parameter.
84077 */
@@ -96366,12 +96383,12 @@
96366 *************************************************************************
96367 **
96368 ** This file implements virtual-tables for examining the bytecode content
96369 ** of a prepared statement.
96370 */
96371 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
96372 /* #include "sqliteInt.h" */
 
96373 /* #include "vdbeInt.h" */
96374
96375 /* An instance of the bytecode() table-valued function.
96376 */
96377 typedef struct bytecodevtab bytecodevtab;
@@ -96772,10 +96789,12 @@
96772 if( rc==SQLITE_OK ){
96773 rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db);
96774 }
96775 return rc;
96776 }
 
 
96777 #endif /* SQLITE_ENABLE_BYTECODE_VTAB */
96778
96779 /************** End of vdbevtab.c ********************************************/
96780 /************** Begin file memjournal.c **************************************/
96781 /*
@@ -105505,11 +105524,14 @@
105505 if( !zName ) goto exit_rename_table;
105506
105507 /* Check that a table or index named 'zName' does not already exist
105508 ** in database iDb. If so, this is an error.
105509 */
105510 if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){
 
 
 
105511 sqlite3ErrorMsg(pParse,
105512 "there is already another table or index with this name: %s", zName);
105513 goto exit_rename_table;
105514 }
105515
@@ -110252,26 +110274,43 @@
110252 ** exists */
110253 if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
110254 return 0;
110255 }
110256 #endif
110257 while(1){
110258 for(i=OMIT_TEMPDB; i<db->nDb; i++){
110259 int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
110260 if( zDatabase==0 || sqlite3DbIsNamed(db, j, zDatabase) ){
110261 assert( sqlite3SchemaMutexHeld(db, j, 0) );
110262 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
110263 if( p ) return p;
110264 }
110265 }
110266 /* Not found. If the name we were looking for was temp.sqlite_master
110267 ** then change the name to sqlite_temp_master and try again. */
110268 if( sqlite3StrICmp(zName, MASTER_NAME)!=0 ) break;
110269 if( sqlite3_stricmp(zDatabase, db->aDb[1].zDbSName)!=0 ) break;
110270 zName = TEMP_MASTER_NAME;
110271 }
110272 return 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110273 }
110274
110275 /*
110276 ** Locate the in-memory structure that describes a particular database
110277 ** table given the name of that table and (optionally) the name of the
@@ -112071,10 +112110,32 @@
112071 assert( pPk->nColumn==j );
112072 assert( pTab->nNVCol<=j );
112073 recomputeColumnsNotIndexed(pPk);
112074 }
112075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112076 #ifndef SQLITE_OMIT_VIRTUALTABLE
112077 /*
112078 ** Return true if zName is a shadow table name in the current database
112079 ** connection.
112080 **
@@ -112082,26 +112143,21 @@
112082 ** restored to its original value prior to this routine returning.
112083 */
112084 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){
112085 char *zTail; /* Pointer to the last "_" in zName */
112086 Table *pTab; /* Table that zName is a shadow of */
112087 Module *pMod; /* Module for the virtual table */
112088
112089 zTail = strrchr(zName, '_');
112090 if( zTail==0 ) return 0;
112091 *zTail = 0;
112092 pTab = sqlite3FindTable(db, zName, 0);
112093 *zTail = '_';
112094 if( pTab==0 ) return 0;
112095 if( !IsVirtual(pTab) ) return 0;
112096 pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]);
112097 if( pMod==0 ) return 0;
112098 if( pMod->pModule->iVersion<3 ) return 0;
112099 if( pMod->pModule->xShadowName==0 ) return 0;
112100 return pMod->pModule->xShadowName(zTail+1);
112101 }
112102 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
 
112103
112104 #ifdef SQLITE_DEBUG
112105 /*
112106 ** Mark all nodes of an expression as EP_Immutable, indicating that
112107 ** they should not be changed. Expressions attached to a table or
@@ -117788,11 +117844,11 @@
117788 if( (cntExpand&(cntExpand-1))==0 ){
117789 /* Grow the size of the output buffer only on substitutions
117790 ** whose index is a power of two: 1, 2, 4, 8, 16, 32, ... */
117791 u8 *zOld;
117792 zOld = zOut;
117793 zOut = sqlite3_realloc64(zOut, (int)nOut + (nOut - nStr - 1));
117794 if( zOut==0 ){
117795 sqlite3_result_error_nomem(context);
117796 sqlite3_free(zOld);
117797 return;
117798 }
@@ -135579,11 +135635,11 @@
135579 need = nCol;
135580 }
135581 if( p->nData + need > p->nAlloc ){
135582 char **azNew;
135583 p->nAlloc = p->nAlloc*2 + need;
135584 azNew = sqlite3_realloc64( p->azResult, sizeof(char*)*p->nAlloc );
135585 if( azNew==0 ) goto malloc_failed;
135586 p->azResult = azNew;
135587 }
135588
135589 /* If this is the first row, then generate an extra row containing
@@ -135688,11 +135744,11 @@
135688 sqlite3_free_table(&res.azResult[1]);
135689 return rc;
135690 }
135691 if( res.nAlloc>res.nData ){
135692 char **azNew;
135693 azNew = sqlite3_realloc64( res.azResult, sizeof(char*)*res.nData );
135694 if( azNew==0 ){
135695 sqlite3_free_table(&res.azResult[1]);
135696 db->errCode = SQLITE_NOMEM;
135697 return SQLITE_NOMEM_BKPT;
135698 }
@@ -136978,14 +137034,14 @@
136978 ** Therefore, the P4 parameter is only required if the default value for
136979 ** the column is a literal number, string or null. The sqlite3ValueFromExpr()
136980 ** function is capable of transforming these types of expressions into
136981 ** sqlite3_value objects.
136982 **
136983 ** If parameter iReg is not negative, code an OP_RealAffinity instruction
136984 ** on register iReg. This is used when an equivalent integer value is
136985 ** stored in place of an 8-byte floating point value in order to save
136986 ** space.
136987 */
136988 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){
136989 assert( pTab!=0 );
136990 if( !pTab->pSelect ){
136991 sqlite3_value *pValue = 0;
@@ -136998,11 +137054,11 @@
136998 if( pValue ){
136999 sqlite3VdbeAppendP4(v, pValue, P4_MEM);
137000 }
137001 }
137002 #ifndef SQLITE_OMIT_FLOATING_POINT
137003 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
137004 sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg);
137005 }
137006 #endif
137007 }
137008
@@ -139847,11 +139903,11 @@
139847 assert( IsVirtual(pTab) );
139848 for(i=0; i<pToplevel->nVtabLock; i++){
139849 if( pTab==pToplevel->apVtabLock[i] ) return;
139850 }
139851 n = (pToplevel->nVtabLock+1)*sizeof(pToplevel->apVtabLock[0]);
139852 apVtabLock = sqlite3_realloc64(pToplevel->apVtabLock, n);
139853 if( apVtabLock ){
139854 pToplevel->apVtabLock = apVtabLock;
139855 pToplevel->apVtabLock[pToplevel->nVtabLock++] = pTab;
139856 }else{
139857 sqlite3OomFault(pToplevel->db);
@@ -160337,10 +160393,11 @@
160337 }
160338 #endif
160339 if( rc==SQLITE_OK ){
160340 sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
160341 sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
 
160342 sqlite3GlobalConfig.isInit = 1;
160343 #ifdef SQLITE_EXTRA_INIT
160344 bRunExtraInit = 1;
160345 #endif
160346 }
@@ -163285,11 +163342,11 @@
163285 assert( SQLITE_OPEN_CREATE == 0x04 );
163286 testcase( (1<<(flags&7))==0x02 ); /* READONLY */
163287 testcase( (1<<(flags&7))==0x04 ); /* READWRITE */
163288 testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */
163289 if( ((1<<(flags&7)) & 0x46)==0 ){
163290 rc = SQLITE_MISUSE_BKPT; /* IMP: R-65497-44594 */
163291 }else{
163292 rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
163293 }
163294 if( rc!=SQLITE_OK ){
163295 if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
@@ -171209,10 +171266,11 @@
171209 while( *pRc==SQLITE_OK && pLeft->bEof==0 ){
171210 memset(pDl->pList, 0, pDl->nList);
171211 fts3EvalNextRow(pCsr, pLeft, pRc);
171212 }
171213 }
 
171214 }
171215 }
171216 break;
171217 }
171218
@@ -182754,11 +182812,11 @@
182754 iStart = pExpr->iPhrase * p->nCol;
182755 }else{
182756 iStart = pExpr->iPhrase * ((p->nCol + 31) / 32);
182757 }
182758
182759 while( 1 ){
182760 int nHit = fts3ColumnlistCount(&pIter);
182761 if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){
182762 if( p->flag==FTS3_MATCHINFO_LHITS ){
182763 p->aMatchinfo[iStart + iCol] = (u32)nHit;
182764 }else if( nHit ){
@@ -184668,10 +184726,11 @@
184668 }
184669
184670 /* Append N bytes from zIn onto the end of the JsonString string.
184671 */
184672 static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){
 
184673 if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return;
184674 memcpy(p->zBuf+p->nUsed, zIn, N);
184675 p->nUsed += N;
184676 }
184677
@@ -224679,11 +224738,11 @@
224679 int nArg, /* Number of args */
224680 sqlite3_value **apUnused /* Function arguments */
224681 ){
224682 assert( nArg==0 );
224683 UNUSED_PARAM2(nArg, apUnused);
224684 sqlite3_result_text(pCtx, "fts5: 2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a", -1, SQLITE_TRANSIENT);
224685 }
224686
224687 /*
224688 ** Return true if zName is the extension on one of the shadow tables used
224689 ** by this module.
@@ -229462,12 +229521,12 @@
229462 }
229463 #endif /* SQLITE_CORE */
229464 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229465
229466 /************** End of stmt.c ************************************************/
229467 #if __LINE__!=229467
229468 #undef SQLITE_SOURCE_ID
229469 #define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88alt2"
229470 #endif
229471 /* Return the source-id for this library */
229472 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229473 /************************** End of sqlite3.c ******************************/
229474
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.32.0"
1166 #define SQLITE_VERSION_NUMBER 3032000
1167 #define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -6532,11 +6532,11 @@
6532 ** when first called if N is less than or equal to zero or if a memory
6533 ** allocate error occurs.
6534 **
6535 ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
6536 ** determined by the N parameter on first successful call. Changing the
6537 ** value of N in any subsequent call to sqlite3_aggregate_context() within
6538 ** the same aggregate function instance will not resize the memory
6539 ** allocation.)^ Within the xFinal callback, it is customary to set
6540 ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
6541 ** pointless memory allocations occur.
6542 **
@@ -20065,12 +20065,14 @@
20065 # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0)
20066 #endif
20067 SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db);
20068 #ifndef SQLITE_OMIT_VIRTUALTABLE
20069 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
20070 SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3*,Table*,const char*);
20071 #else
20072 # define sqlite3ShadowTableName(A,B) 0
20073 # define sqlite3IsShadowTableOf(A,B,C) 0
20074 #endif
20075 SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*);
20076 SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*);
20077 SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*);
20078 SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int);
@@ -27925,11 +27927,11 @@
27927 }
27928 }else{
27929 assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
27930 assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
27931 sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
27932 pNew = sqlite3Realloc(p, n);
27933 if( !pNew ){
27934 sqlite3OomFault(db);
27935 }
27936 sqlite3MemdebugSetType(pNew,
27937 (db->lookaside.bDisable==0 ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
@@ -29002,11 +29004,11 @@
29004 p->nAlloc = (int)szNew;
29005 }
29006 if( p->db ){
29007 zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
29008 }else{
29009 zNew = sqlite3Realloc(zOld, p->nAlloc);
29010 }
29011 if( zNew ){
29012 assert( p->zText!=0 || p->nChar==0 );
29013 if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
29014 p->zText = zNew;
@@ -29344,11 +29346,11 @@
29346 ** and segfaults if you give it a long long int.
29347 */
29348 SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
29349 va_list ap;
29350 StrAccum acc;
29351 char zBuf[SQLITE_PRINT_BUF_SIZE*10];
29352 sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
29353 va_start(ap,zFormat);
29354 sqlite3_str_vappendf(&acc, zFormat, ap);
29355 va_end(ap);
29356 sqlite3StrAccumFinish(&acc);
@@ -45049,10 +45051,11 @@
45051 }
45052
45053 /* Forward references to VFS helper methods used for temporary files */
45054 static int winGetTempname(sqlite3_vfs *, char **);
45055 static int winIsDir(const void *);
45056 static BOOL winIsLongPathPrefix(const char *);
45057 static BOOL winIsDriveLetterAndColon(const char *);
45058
45059 /*
45060 ** Control and query of the open file handle.
45061 */
@@ -47027,10 +47030,21 @@
47030 *pResOut = rc;
47031 OSTRACE(("ACCESS name=%s, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n",
47032 zFilename, pResOut, *pResOut));
47033 return SQLITE_OK;
47034 }
47035
47036 /*
47037 ** Returns non-zero if the specified path name starts with the "long path"
47038 ** prefix.
47039 */
47040 static BOOL winIsLongPathPrefix(
47041 const char *zPathname
47042 ){
47043 return ( zPathname[0]=='\\' && zPathname[1]=='\\'
47044 && zPathname[2]=='?' && zPathname[3]=='\\' );
47045 }
47046
47047 /*
47048 ** Returns non-zero if the specified path name starts with a drive letter
47049 ** followed by a colon character.
47050 */
@@ -47092,14 +47106,15 @@
47106 DWORD nByte;
47107 void *zConverted;
47108 char *zOut;
47109 #endif
47110
47111 /* If this path name begins with "/X:" or "\\?\", where "X" is any
47112 ** alphabetic character, discard the initial "/" from the pathname.
47113 */
47114 if( zRelative[0]=='/' && (winIsDriveLetterAndColon(zRelative+1)
47115 || winIsLongPathPrefix(zRelative+1)) ){
47116 zRelative++;
47117 }
47118
47119 #if defined(__CYGWIN__)
47120 SimulateIOError( return SQLITE_ERROR );
@@ -47851,11 +47866,11 @@
47866 if( newSz>p->szMax ){
47867 return SQLITE_FULL;
47868 }
47869 newSz *= 2;
47870 if( newSz>p->szMax ) newSz = p->szMax;
47871 pNew = sqlite3Realloc(p->aData, newSz);
47872 if( pNew==0 ) return SQLITE_NOMEM;
47873 p->aData = pNew;
47874 p->szAlloc = newSz;
47875 return SQLITE_OK;
47876 }
@@ -59821,11 +59836,11 @@
59836
59837 /* Enlarge the pWal->apWiData[] array if required */
59838 if( pWal->nWiData<=iPage ){
59839 sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
59840 volatile u32 **apNew;
59841 apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
59842 if( !apNew ){
59843 *ppPage = 0;
59844 return SQLITE_NOMEM_BKPT;
59845 }
59846 memset((void*)&apNew[pWal->nWiData], 0,
@@ -79308,10 +79323,11 @@
79323 char *zP4;
79324 char *zCom;
79325 sqlite3 dummyDb;
79326 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
79327 if( pOut==0 ) pOut = stdout;
79328 sqlite3BeginBenignMalloc();
79329 dummyDb.mallocFailed = 1;
79330 zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp);
79331 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79332 zCom = sqlite3VdbeDisplayComment(0, pOp, zP4);
79333 #else
@@ -79326,10 +79342,11 @@
79342 zCom ? zCom : ""
79343 );
79344 fflush(pOut);
79345 sqlite3_free(zP4);
79346 sqlite3_free(zCom);
79347 sqlite3EndBenignMalloc();
79348 }
79349 #endif
79350
79351 /*
79352 ** Initialize an array of N Mem element.
@@ -84067,11 +84084,11 @@
84084 p->db->errCode = SQLITE_OK;
84085
84086 /* If the bit corresponding to this variable in Vdbe.expmask is set, then
84087 ** binding a new value to this variable invalidates the current query plan.
84088 **
84089 ** IMPLEMENTATION-OF: R-57496-20354 If the specific value bound to a host
84090 ** parameter in the WHERE clause might influence the choice of query plan
84091 ** for a statement, then the statement will be automatically recompiled,
84092 ** as if there had been a schema change, on the first sqlite3_step() call
84093 ** following any change to the bindings of that parameter.
84094 */
@@ -96366,12 +96383,12 @@
96383 *************************************************************************
96384 **
96385 ** This file implements virtual-tables for examining the bytecode content
96386 ** of a prepared statement.
96387 */
 
96388 /* #include "sqliteInt.h" */
96389 #if defined(SQLITE_ENABLE_BYTECODE_VTAB) && !defined(SQLITE_OMIT_VIRTUALTABLE)
96390 /* #include "vdbeInt.h" */
96391
96392 /* An instance of the bytecode() table-valued function.
96393 */
96394 typedef struct bytecodevtab bytecodevtab;
@@ -96772,10 +96789,12 @@
96789 if( rc==SQLITE_OK ){
96790 rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db);
96791 }
96792 return rc;
96793 }
96794 #elif defined(SQLITE_ENABLE_BYTECODE_VTAB)
96795 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; }
96796 #endif /* SQLITE_ENABLE_BYTECODE_VTAB */
96797
96798 /************** End of vdbevtab.c ********************************************/
96799 /************** Begin file memjournal.c **************************************/
96800 /*
@@ -105505,11 +105524,14 @@
105524 if( !zName ) goto exit_rename_table;
105525
105526 /* Check that a table or index named 'zName' does not already exist
105527 ** in database iDb. If so, this is an error.
105528 */
105529 if( sqlite3FindTable(db, zName, zDb)
105530 || sqlite3FindIndex(db, zName, zDb)
105531 || sqlite3IsShadowTableOf(db, pTab, zName)
105532 ){
105533 sqlite3ErrorMsg(pParse,
105534 "there is already another table or index with this name: %s", zName);
105535 goto exit_rename_table;
105536 }
105537
@@ -110252,26 +110274,43 @@
110274 ** exists */
110275 if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
110276 return 0;
110277 }
110278 #endif
110279 if( zDatabase ){
110280 for(i=0; i<db->nDb; i++){
110281 if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
110282 }
110283 if( i>=db->nDb ){
110284 /* No match against the official names. But always match "main"
110285 ** to schema 0 as a legacy fallback. */
110286 if( sqlite3StrICmp(zDatabase,"main")==0 ){
110287 i = 0;
110288 }else{
110289 return 0;
110290 }
110291 }
110292 p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110293 if( p==0 && i==1 && sqlite3StrICmp(zName, MASTER_NAME)==0 ){
110294 /* All temp.sqlite_master to be an alias for sqlite_temp_master */
110295 p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, TEMP_MASTER_NAME);
110296 }
110297 }else{
110298 /* Match against TEMP first */
110299 p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, zName);
110300 if( p ) return p;
110301 /* The main database is second */
110302 p = sqlite3HashFind(&db->aDb[0].pSchema->tblHash, zName);
110303 if( p ) return p;
110304 /* Attached databases are in order of attachment */
110305 for(i=2; i<db->nDb; i++){
110306 assert( sqlite3SchemaMutexHeld(db, i, 0) );
110307 p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110308 if( p ) break;
110309 }
110310 }
110311 return p;
110312 }
110313
110314 /*
110315 ** Locate the in-memory structure that describes a particular database
110316 ** table given the name of that table and (optionally) the name of the
@@ -112071,10 +112110,32 @@
112110 assert( pPk->nColumn==j );
112111 assert( pTab->nNVCol<=j );
112112 recomputeColumnsNotIndexed(pPk);
112113 }
112114
112115
112116 #ifndef SQLITE_OMIT_VIRTUALTABLE
112117 /*
112118 ** Return true if pTab is a virtual table and zName is a shadow table name
112119 ** for that virtual table.
112120 */
112121 SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3 *db, Table *pTab, const char *zName){
112122 int nName; /* Length of zName */
112123 Module *pMod; /* Module for the virtual table */
112124
112125 if( !IsVirtual(pTab) ) return 0;
112126 nName = sqlite3Strlen30(pTab->zName);
112127 if( sqlite3_strnicmp(zName, pTab->zName, nName)!=0 ) return 0;
112128 if( zName[nName]!='_' ) return 0;
112129 pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]);
112130 if( pMod==0 ) return 0;
112131 if( pMod->pModule->iVersion<3 ) return 0;
112132 if( pMod->pModule->xShadowName==0 ) return 0;
112133 return pMod->pModule->xShadowName(zName+nName+1);
112134 }
112135 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
112136
112137 #ifndef SQLITE_OMIT_VIRTUALTABLE
112138 /*
112139 ** Return true if zName is a shadow table name in the current database
112140 ** connection.
112141 **
@@ -112082,26 +112143,21 @@
112143 ** restored to its original value prior to this routine returning.
112144 */
112145 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){
112146 char *zTail; /* Pointer to the last "_" in zName */
112147 Table *pTab; /* Table that zName is a shadow of */
 
 
112148 zTail = strrchr(zName, '_');
112149 if( zTail==0 ) return 0;
112150 *zTail = 0;
112151 pTab = sqlite3FindTable(db, zName, 0);
112152 *zTail = '_';
112153 if( pTab==0 ) return 0;
112154 if( !IsVirtual(pTab) ) return 0;
112155 return sqlite3IsShadowTableOf(db, pTab, zName);
 
 
 
 
112156 }
112157 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
112158
112159
112160 #ifdef SQLITE_DEBUG
112161 /*
112162 ** Mark all nodes of an expression as EP_Immutable, indicating that
112163 ** they should not be changed. Expressions attached to a table or
@@ -117788,11 +117844,11 @@
117844 if( (cntExpand&(cntExpand-1))==0 ){
117845 /* Grow the size of the output buffer only on substitutions
117846 ** whose index is a power of two: 1, 2, 4, 8, 16, 32, ... */
117847 u8 *zOld;
117848 zOld = zOut;
117849 zOut = sqlite3Realloc(zOut, (int)nOut + (nOut - nStr - 1));
117850 if( zOut==0 ){
117851 sqlite3_result_error_nomem(context);
117852 sqlite3_free(zOld);
117853 return;
117854 }
@@ -135579,11 +135635,11 @@
135635 need = nCol;
135636 }
135637 if( p->nData + need > p->nAlloc ){
135638 char **azNew;
135639 p->nAlloc = p->nAlloc*2 + need;
135640 azNew = sqlite3Realloc( p->azResult, sizeof(char*)*p->nAlloc );
135641 if( azNew==0 ) goto malloc_failed;
135642 p->azResult = azNew;
135643 }
135644
135645 /* If this is the first row, then generate an extra row containing
@@ -135688,11 +135744,11 @@
135744 sqlite3_free_table(&res.azResult[1]);
135745 return rc;
135746 }
135747 if( res.nAlloc>res.nData ){
135748 char **azNew;
135749 azNew = sqlite3Realloc( res.azResult, sizeof(char*)*res.nData );
135750 if( azNew==0 ){
135751 sqlite3_free_table(&res.azResult[1]);
135752 db->errCode = SQLITE_NOMEM;
135753 return SQLITE_NOMEM_BKPT;
135754 }
@@ -136978,14 +137034,14 @@
137034 ** Therefore, the P4 parameter is only required if the default value for
137035 ** the column is a literal number, string or null. The sqlite3ValueFromExpr()
137036 ** function is capable of transforming these types of expressions into
137037 ** sqlite3_value objects.
137038 **
137039 ** If column as REAL affinity and the table is an ordinary b-tree table
137040 ** (not a virtual table) then the value might have been stored as an
137041 ** integer. In that case, add an OP_RealAffinity opcode to make sure
137042 ** it has been converted into REAL.
137043 */
137044 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){
137045 assert( pTab!=0 );
137046 if( !pTab->pSelect ){
137047 sqlite3_value *pValue = 0;
@@ -136998,11 +137054,11 @@
137054 if( pValue ){
137055 sqlite3VdbeAppendP4(v, pValue, P4_MEM);
137056 }
137057 }
137058 #ifndef SQLITE_OMIT_FLOATING_POINT
137059 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){
137060 sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg);
137061 }
137062 #endif
137063 }
137064
@@ -139847,11 +139903,11 @@
139903 assert( IsVirtual(pTab) );
139904 for(i=0; i<pToplevel->nVtabLock; i++){
139905 if( pTab==pToplevel->apVtabLock[i] ) return;
139906 }
139907 n = (pToplevel->nVtabLock+1)*sizeof(pToplevel->apVtabLock[0]);
139908 apVtabLock = sqlite3Realloc(pToplevel->apVtabLock, n);
139909 if( apVtabLock ){
139910 pToplevel->apVtabLock = apVtabLock;
139911 pToplevel->apVtabLock[pToplevel->nVtabLock++] = pTab;
139912 }else{
139913 sqlite3OomFault(pToplevel->db);
@@ -160337,10 +160393,11 @@
160393 }
160394 #endif
160395 if( rc==SQLITE_OK ){
160396 sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
160397 sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
160398 sqlite3MemoryBarrier();
160399 sqlite3GlobalConfig.isInit = 1;
160400 #ifdef SQLITE_EXTRA_INIT
160401 bRunExtraInit = 1;
160402 #endif
160403 }
@@ -163285,11 +163342,11 @@
163342 assert( SQLITE_OPEN_CREATE == 0x04 );
163343 testcase( (1<<(flags&7))==0x02 ); /* READONLY */
163344 testcase( (1<<(flags&7))==0x04 ); /* READWRITE */
163345 testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */
163346 if( ((1<<(flags&7)) & 0x46)==0 ){
163347 rc = SQLITE_MISUSE_BKPT; /* IMP: R-18321-05872 */
163348 }else{
163349 rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
163350 }
163351 if( rc!=SQLITE_OK ){
163352 if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
@@ -171209,10 +171266,11 @@
171266 while( *pRc==SQLITE_OK && pLeft->bEof==0 ){
171267 memset(pDl->pList, 0, pDl->nList);
171268 fts3EvalNextRow(pCsr, pLeft, pRc);
171269 }
171270 }
171271 pRight->bEof = pLeft->bEof = 1;
171272 }
171273 }
171274 break;
171275 }
171276
@@ -182754,11 +182812,11 @@
182812 iStart = pExpr->iPhrase * p->nCol;
182813 }else{
182814 iStart = pExpr->iPhrase * ((p->nCol + 31) / 32);
182815 }
182816
182817 if( pIter ) while( 1 ){
182818 int nHit = fts3ColumnlistCount(&pIter);
182819 if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){
182820 if( p->flag==FTS3_MATCHINFO_LHITS ){
182821 p->aMatchinfo[iStart + iCol] = (u32)nHit;
182822 }else if( nHit ){
@@ -184668,10 +184726,11 @@
184726 }
184727
184728 /* Append N bytes from zIn onto the end of the JsonString string.
184729 */
184730 static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){
184731 if( N==0 ) return;
184732 if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return;
184733 memcpy(p->zBuf+p->nUsed, zIn, N);
184734 p->nUsed += N;
184735 }
184736
@@ -224679,11 +224738,11 @@
224738 int nArg, /* Number of args */
224739 sqlite3_value **apUnused /* Function arguments */
224740 ){
224741 assert( nArg==0 );
224742 UNUSED_PARAM2(nArg, apUnused);
224743 sqlite3_result_text(pCtx, "fts5: 2020-05-17 00:26:44 1313557b512297e7b75ed748894379b2022aecf696d5a58318e46a668321c1ff", -1, SQLITE_TRANSIENT);
224744 }
224745
224746 /*
224747 ** Return true if zName is the extension on one of the shadow tables used
224748 ** by this module.
@@ -229462,12 +229521,12 @@
229521 }
229522 #endif /* SQLITE_CORE */
229523 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229524
229525 /************** End of stmt.c ************************************************/
229526 #if __LINE__!=229526
229527 #undef SQLITE_SOURCE_ID
229528 #define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469falt2"
229529 #endif
229530 /* Return the source-id for this library */
229531 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229532 /************************** End of sqlite3.c ******************************/
229533
+2 -2
--- 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.32.0"
127127
#define SQLITE_VERSION_NUMBER 3032000
128
-#define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a"
128
+#define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -5493,11 +5493,11 @@
54935493
** when first called if N is less than or equal to zero or if a memory
54945494
** allocate error occurs.
54955495
**
54965496
** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
54975497
** determined by the N parameter on first successful call. Changing the
5498
-** value of N in any subsequents call to sqlite3_aggregate_context() within
5498
+** value of N in any subsequent call to sqlite3_aggregate_context() within
54995499
** the same aggregate function instance will not resize the memory
55005500
** allocation.)^ Within the xFinal callback, it is customary to set
55015501
** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
55025502
** pointless memory allocations occur.
55035503
**
55045504
--- 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.32.0"
127 #define SQLITE_VERSION_NUMBER 3032000
128 #define SQLITE_SOURCE_ID "2020-05-13 18:03:34 fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -5493,11 +5493,11 @@
5493 ** when first called if N is less than or equal to zero or if a memory
5494 ** allocate error occurs.
5495 **
5496 ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
5497 ** determined by the N parameter on first successful call. Changing the
5498 ** value of N in any subsequents call to sqlite3_aggregate_context() within
5499 ** the same aggregate function instance will not resize the memory
5500 ** allocation.)^ Within the xFinal callback, it is customary to set
5501 ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
5502 ** pointless memory allocations occur.
5503 **
5504
--- 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.32.0"
127 #define SQLITE_VERSION_NUMBER 3032000
128 #define SQLITE_SOURCE_ID "2020-05-17 13:47:28 69e149f76853d196c8855fedfc98848b60fb116ac36bc08824b1a122469f8ece"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -5493,11 +5493,11 @@
5493 ** when first called if N is less than or equal to zero or if a memory
5494 ** allocate error occurs.
5495 **
5496 ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
5497 ** determined by the N parameter on first successful call. Changing the
5498 ** value of N in any subsequent call to sqlite3_aggregate_context() within
5499 ** the same aggregate function instance will not resize the memory
5500 ** allocation.)^ Within the xFinal callback, it is customary to set
5501 ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
5502 ** pointless memory allocations occur.
5503 **
5504

Keyboard Shortcuts

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