Fossil SCM

Update the built-in SQLite to the 3.25.0 release.

drh 2018-09-15 12:39 trunk
Commit 048a6f80d33fd5a4aa9a218be233bf3f252cbaac4b351c30633dbda01d283d73
2 files changed +67 -40 +11 -10
+67 -40
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1156,11 +1156,11 @@
11561156
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11571157
** [sqlite_version()] and [sqlite_source_id()].
11581158
*/
11591159
#define SQLITE_VERSION "3.25.0"
11601160
#define SQLITE_VERSION_NUMBER 3025000
1161
-#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d"
1161
+#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760"
11621162
11631163
/*
11641164
** CAPI3REF: Run-Time Library Version Numbers
11651165
** KEYWORDS: sqlite3_version sqlite3_sourceid
11661166
**
@@ -2113,22 +2113,23 @@
21132113
** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
21142114
** a database file. The argument is a pointer to a 32-bit unsigned integer.
21152115
** The "data version" for the pager is written into the pointer. The
21162116
** "data version" changes whenever any change occurs to the corresponding
21172117
** database file, either through SQL statements on the same database
2118
-** connection, or through transactions committed by separate database
2118
+** connection or through transactions committed by separate database
21192119
** connections possibly in other processes. The [sqlite3_total_changes()]
21202120
** interface can be used to find if any database on the connection has changed,
2121
-** but that interface response to changes on TEMP as well as MAIN and does
2121
+** but that interface responds to changes on TEMP as well as MAIN and does
21222122
** not provide a mechanism to detect changes to MAIN only. Also, the
2123
-** [sqlite3_total_changes()] interface response to internal changes only and
2123
+** [sqlite3_total_changes()] interface responds to internal changes only and
21242124
** omits changes made by other database connections. The
21252125
** [PRAGMA data_version] command provide a mechanism to detect changes to
21262126
** a single attached database that occur due to other database connections,
2127
-** but omits changes implemented by the database connection for which it is
2127
+** but omits changes implemented by the database connection on which it is
21282128
** called. This file control is the only mechanism to detect changes that
2129
-** happen either internally or externally on a single database.
2129
+** happen either internally or externally and that are associated with
2130
+** a particular attached database.
21302131
** </ul>
21312132
*/
21322133
#define SQLITE_FCNTL_LOCKSTATE 1
21332134
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
21342135
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -5762,11 +5763,11 @@
57625763
** SQL function or aggregate, pass NULL pointers for all three function
57635764
** callbacks.
57645765
**
57655766
** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
57665767
** and xInverse) passed to sqlite3_create_window_function are pointers to
5767
-** C-lanugage callbacks that implement the new function. xStep and xFinal
5768
+** C-language callbacks that implement the new function. xStep and xFinal
57685769
** must both be non-NULL. xValue and xInverse may either both be NULL, in
57695770
** which case a regular aggregate function is created, or must both be
57705771
** non-NULL, in which case the new function may be used as either an aggregate
57715772
** or aggregate window function. More details regarding the implementation
57725773
** of aggregate window functions are
@@ -10288,11 +10289,11 @@
1028810289
**
1028910290
** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
1029010291
** in the P argument is held in memory obtained from [sqlite3_malloc64()]
1029110292
** and that SQLite should take ownership of this memory and automatically
1029210293
** free it when it has finished using it. Without this flag, the caller
10293
-** is resposible for freeing any dynamically allocated memory.
10294
+** is responsible for freeing any dynamically allocated memory.
1029410295
**
1029510296
** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
1029610297
** grow the size of the database using calls to [sqlite3_realloc64()]. This
1029710298
** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
1029810299
** Without this flag, the deserialized database cannot increase in size beyond
@@ -12466,11 +12467,11 @@
1246612467
** "place".
1246712468
**
1246812469
** This way, even if the tokenizer does not provide synonyms
1246912470
** when tokenizing query text (it should not - to do would be
1247012471
** inefficient), it doesn't matter if the user queries for
12471
-** 'first + place' or '1st + place', as there are entires in the
12472
+** 'first + place' or '1st + place', as there are entries in the
1247212473
** FTS index corresponding to both forms of the first token.
1247312474
** </ol>
1247412475
**
1247512476
** Whether it is parsing document or query text, any call to xToken that
1247612477
** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -12494,11 +12495,11 @@
1249412495
**
1249512496
** In many cases, method (1) above is the best approach. It does not add
1249612497
** extra data to the FTS index or require FTS5 to query for multiple terms,
1249712498
** so it is efficient in terms of disk space and query speed. However, it
1249812499
** does not support prefix queries very well. If, as suggested above, the
12499
-** token "first" is subsituted for "1st" by the tokenizer, then the query:
12500
+** token "first" is substituted for "1st" by the tokenizer, then the query:
1250012501
**
1250112502
** <codeblock>
1250212503
** ... MATCH '1s*'</codeblock>
1250312504
**
1250412505
** will not match documents that contain the token "1st" (as the tokenizer
@@ -18972,10 +18973,11 @@
1897218973
SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
1897318974
SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
1897418975
SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*);
1897518976
SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom);
1897618977
SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*);
18978
+SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*);
1897718979
SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
1897818980
SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*);
1897918981
SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
1898018982
SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*);
1898118983
SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
@@ -27606,11 +27608,16 @@
2760627608
bufpt = va_arg(ap,char*);
2760727609
}
2760827610
if( bufpt==0 ){
2760927611
bufpt = "";
2761027612
}else if( xtype==etDYNSTRING ){
27611
- if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){
27613
+ if( pAccum->nChar==0
27614
+ && pAccum->mxAlloc
27615
+ && width==0
27616
+ && precision<0
27617
+ && pAccum->accError==0
27618
+ ){
2761227619
/* Special optimization for sqlite3_mprintf("%z..."):
2761327620
** Extend an existing memory allocation rather than creating
2761427621
** a new one. */
2761527622
assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 );
2761627623
pAccum->zText = bufpt;
@@ -36968,11 +36975,13 @@
3696836975
static void unixShmBarrier(
3696936976
sqlite3_file *fd /* Database file holding the shared memory */
3697036977
){
3697136978
UNUSED_PARAMETER(fd);
3697236979
sqlite3MemoryBarrier(); /* compiler-defined memory barrier */
36973
- assert( unixFileMutexNotheld((unixFile*)fd) );
36980
+ assert( fd->pMethods->xLock==nolockLock
36981
+ || unixFileMutexNotheld((unixFile*)fd)
36982
+ );
3697436983
unixEnterMutex(); /* Also mutex, for redundancy */
3697536984
unixLeaveMutex();
3697636985
}
3697736986
3697836987
/*
@@ -46285,12 +46294,12 @@
4628546294
** block of memory.
4628646295
**
4628746296
** This file also implements interface sqlite3_serialize() and
4628846297
** sqlite3_deserialize().
4628946298
*/
46290
-#ifdef SQLITE_ENABLE_DESERIALIZE
4629146299
/* #include "sqliteInt.h" */
46300
+#ifdef SQLITE_ENABLE_DESERIALIZE
4629246301
4629346302
/*
4629446303
** Forward declaration of objects used by this utility
4629546304
*/
4629646305
typedef struct sqlite3_vfs MemVfs;
@@ -60507,11 +60516,11 @@
6050760516
** Other threads might append new content to the WAL and wal-index but
6050860517
** that extra content is ignored by the current thread.
6050960518
**
6051060519
** If the database contents have changes since the previous read
6051160520
** transaction, then *pChanged is set to 1 before returning. The
60512
-** Pager layer will use this to know that is cache is stale and
60521
+** Pager layer will use this to know that its cache is stale and
6051360522
** needs to be flushed.
6051460523
*/
6051560524
SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){
6051660525
int rc; /* Return code */
6051760526
int cnt = 0; /* Number of TryBeginRead attempts */
@@ -78538,11 +78547,11 @@
7853878547
** error, then it might not have been halted properly. So halt
7853978548
** it now.
7854078549
*/
7854178550
sqlite3VdbeHalt(p);
7854278551
78543
- /* If the VDBE has be run even partially, then transfer the error code
78552
+ /* If the VDBE has been run even partially, then transfer the error code
7854478553
** and error message from the VDBE into the main database structure. But
7854578554
** if the VDBE has just been set to run but has not actually executed any
7854678555
** instructions yet, leave the main database error information unchanged.
7854778556
*/
7854878557
if( p->pc>=0 ){
@@ -101161,11 +101170,11 @@
101161101170
** bTemp is not true, database "temp", can still be parsed. This is
101162101171
** called at the end of the generation of an ALTER TABLE ... RENAME ...
101163101172
** statement to ensure that the operation has not rendered any schema
101164101173
** objects unusable.
101165101174
*/
101166
-void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){
101175
+static void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){
101167101176
sqlite3NestedParse(pParse,
101168101177
"SELECT 1 "
101169101178
"FROM \"%w\".%s "
101170101179
"WHERE name NOT LIKE 'sqlite_%%'"
101171101180
" AND sql NOT LIKE 'create virtual%%'"
@@ -101188,11 +101197,11 @@
101188101197
101189101198
/*
101190101199
** Generate code to reload the schema for database iDb. And, if iDb!=1, for
101191101200
** the temp database as well.
101192101201
*/
101193
-void renameReloadSchema(Parse *pParse, int iDb){
101202
+static void renameReloadSchema(Parse *pParse, int iDb){
101194101203
Vdbe *v = pParse->pVdbe;
101195101204
if( v ){
101196101205
sqlite3ChangeCookie(pParse, iDb);
101197101206
sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0);
101198101207
if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0);
@@ -101768,11 +101777,11 @@
101768101777
** if( x==y ) ...
101769101778
**
101770101779
** Technically, as x no longer points into a valid object or to the byte
101771101780
** following a valid object, it may not be used in comparison operations.
101772101781
*/
101773
-void renameTokenCheckAll(Parse *pParse, void *pPtr){
101782
+static void renameTokenCheckAll(Parse *pParse, void *pPtr){
101774101783
if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){
101775101784
RenameToken *p;
101776101785
u8 i = 0;
101777101786
for(p=pParse->pRename; p; p=p->pNext){
101778101787
if( p->p ){
@@ -101840,10 +101849,28 @@
101840101849
memset(&sWalker, 0, sizeof(Walker));
101841101850
sWalker.pParse = pParse;
101842101851
sWalker.xExprCallback = renameUnmapExprCb;
101843101852
sqlite3WalkExpr(&sWalker, pExpr);
101844101853
}
101854
+
101855
+/*
101856
+** Remove all nodes that are part of expression-list pEList from the
101857
+** rename list.
101858
+*/
101859
+SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *pEList){
101860
+ if( pEList ){
101861
+ int i;
101862
+ Walker sWalker;
101863
+ memset(&sWalker, 0, sizeof(Walker));
101864
+ sWalker.pParse = pParse;
101865
+ sWalker.xExprCallback = renameUnmapExprCb;
101866
+ sqlite3WalkExprList(&sWalker, pEList);
101867
+ for(i=0; i<pEList->nExpr; i++){
101868
+ sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zName);
101869
+ }
101870
+ }
101871
+}
101845101872
101846101873
/*
101847101874
** Free the list of RenameToken objects given in the second argument
101848101875
*/
101849101876
static void renameTokenFree(sqlite3 *db, RenameToken *pToken){
@@ -107746,10 +107773,13 @@
107746107773
/* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */
107747107774
sqlite3EndTable(pParse, 0, &sEnd, 0, 0);
107748107775
107749107776
create_view_fail:
107750107777
sqlite3SelectDelete(db, pSelect);
107778
+ if( IN_RENAME_OBJECT ){
107779
+ sqlite3RenameExprlistUnmap(pParse, pCNames);
107780
+ }
107751107781
sqlite3ExprListDelete(db, pCNames);
107752107782
return;
107753107783
}
107754107784
#endif /* SQLITE_OMIT_VIEW */
107755107785
@@ -135329,15 +135359,12 @@
135329135359
static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){
135330135360
int rc = WRC_Continue;
135331135361
struct CCurHint *pHint = pWalker->u.pCCurHint;
135332135362
if( pExpr->op==TK_COLUMN ){
135333135363
if( pExpr->iTable!=pHint->iTabCur ){
135334
- Vdbe *v = pWalker->pParse->pVdbe;
135335135364
int reg = ++pWalker->pParse->nMem; /* Register for column value */
135336
- sqlite3ExprCodeGetColumnOfTable(
135337
- v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg
135338
- );
135365
+ sqlite3ExprCode(pWalker->pParse, pExpr, reg);
135339135366
pExpr->op = TK_REGISTER;
135340135367
pExpr->iTable = reg;
135341135368
}else if( pHint->pIdx!=0 ){
135342135369
pExpr->iTable = pHint->iIdxCur;
135343135370
pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn);
@@ -177353,15 +177380,15 @@
177353177380
jsonAppendChar(pStr, ']');
177354177381
if( pStr->bErr ){
177355177382
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177356177383
assert( pStr->bStatic );
177357177384
}else if( isFinal ){
177358
- sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
177385
+ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
177359177386
pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177360177387
pStr->bStatic = 1;
177361177388
}else{
177362
- sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
177389
+ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
177363177390
pStr->nUsed--;
177364177391
}
177365177392
}else{
177366177393
sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
177367177394
}
@@ -177406,11 +177433,11 @@
177406177433
}else if( z[i]=='\\' ){
177407177434
i++;
177408177435
}
177409177436
}
177410177437
pStr->nUsed -= i;
177411
- memmove(&z[1], &z[i+1], pStr->nUsed-1);
177438
+ memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1);
177412177439
}
177413177440
#else
177414177441
# define jsonGroupInverse 0
177415177442
#endif
177416177443
@@ -177452,15 +177479,15 @@
177452177479
jsonAppendChar(pStr, '}');
177453177480
if( pStr->bErr ){
177454177481
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177455177482
assert( pStr->bStatic );
177456177483
}else if( isFinal ){
177457
- sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
177484
+ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
177458177485
pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177459177486
pStr->bStatic = 1;
177460177487
}else{
177461
- sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
177488
+ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
177462177489
pStr->nUsed--;
177463177490
}
177464177491
}else{
177465177492
sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);
177466177493
}
@@ -181310,11 +181337,11 @@
181310181337
** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
181311181338
** COMMIT;
181312181339
*/
181313181340
static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){
181314181341
Rtree *pRtree = (Rtree *)pVtab;
181315
- int iwt = pRtree->inWrTrans;
181342
+ u8 iwt = pRtree->inWrTrans;
181316181343
UNUSED_PARAMETER(iSavepoint);
181317181344
pRtree->inWrTrans = 0;
181318181345
nodeBlobReset(pRtree);
181319181346
pRtree->inWrTrans = iwt;
181320181347
return SQLITE_OK;
@@ -182450,11 +182477,11 @@
182450182477
continue;
182451182478
}
182452182479
break;
182453182480
}
182454182481
if( z[j-1]<'0' ) return 0;
182455
- if( pVal ) *pVal = atof((const char*)p->z);
182482
+ if( pVal ) *pVal = (GeoCoord)atof((const char*)p->z);
182456182483
p->z += j;
182457182484
return 1;
182458182485
}
182459182486
182460182487
/*
@@ -182705,12 +182732,12 @@
182705182732
int ii;
182706182733
if( p ){
182707182734
for(ii=0; ii<p->nVertex; ii++){
182708182735
x0 = p->a[ii*2];
182709182736
y0 = p->a[ii*2+1];
182710
- x1 = A*x0 + B*y0 + E;
182711
- y1 = C*x0 + D*y0 + F;
182737
+ x1 = (GeoCoord)(A*x0 + B*y0 + E);
182738
+ y1 = (GeoCoord)(C*x0 + D*y0 + F);
182712182739
p->a[ii*2] = x1;
182713182740
p->a[ii*2+1] = y1;
182714182741
}
182715182742
sqlite3_result_blob(context, p->hdr,
182716182743
4+8*p->nVertex, SQLITE_TRANSIENT);
@@ -182781,15 +182808,15 @@
182781182808
int ii;
182782182809
mnX = mxX = p->a[0];
182783182810
mnY = mxY = p->a[1];
182784182811
for(ii=1; ii<p->nVertex; ii++){
182785182812
double r = p->a[ii*2];
182786
- if( r<mnX ) mnX = r;
182787
- else if( r>mxX ) mxX = r;
182813
+ if( r<mnX ) mnX = (float)r;
182814
+ else if( r>mxX ) mxX = (float)r;
182788182815
r = p->a[ii*2+1];
182789
- if( r<mnY ) mnY = r;
182790
- else if( r>mxY ) mxY = r;
182816
+ if( r<mnY ) mnY = (float)r;
182817
+ else if( r>mxY ) mxY = (float)r;
182791182818
}
182792182819
if( pRc ) *pRc = SQLITE_OK;
182793182820
if( aCoord==0 ){
182794182821
geopolyBboxFill:
182795182822
pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6);
@@ -197385,11 +197412,11 @@
197385197412
** "place".
197386197413
**
197387197414
** This way, even if the tokenizer does not provide synonyms
197388197415
** when tokenizing query text (it should not - to do would be
197389197416
** inefficient), it doesn't matter if the user queries for
197390
-** 'first + place' or '1st + place', as there are entires in the
197417
+** 'first + place' or '1st + place', as there are entries in the
197391197418
** FTS index corresponding to both forms of the first token.
197392197419
** </ol>
197393197420
**
197394197421
** Whether it is parsing document or query text, any call to xToken that
197395197422
** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -197413,11 +197440,11 @@
197413197440
**
197414197441
** In many cases, method (1) above is the best approach. It does not add
197415197442
** extra data to the FTS index or require FTS5 to query for multiple terms,
197416197443
** so it is efficient in terms of disk space and query speed. However, it
197417197444
** does not support prefix queries very well. If, as suggested above, the
197418
-** token "first" is subsituted for "1st" by the tokenizer, then the query:
197445
+** token "first" is substituted for "1st" by the tokenizer, then the query:
197419197446
**
197420197447
** <codeblock>
197421197448
** ... MATCH '1s*'</codeblock>
197422197449
**
197423197450
** will not match documents that contain the token "1st" (as the tokenizer
@@ -214387,11 +214414,11 @@
214387214414
int nArg, /* Number of args */
214388214415
sqlite3_value **apUnused /* Function arguments */
214389214416
){
214390214417
assert( nArg==0 );
214391214418
UNUSED_PARAM2(nArg, apUnused);
214392
- sqlite3_result_text(pCtx, "fts5: 2018-09-10 16:38:25 564fa75195c5179d0bc86431aaff06136fc65ec63aa9839cd1114b1fbfac928b", -1, SQLITE_TRANSIENT);
214419
+ sqlite3_result_text(pCtx, "fts5: 2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760", -1, SQLITE_TRANSIENT);
214393214420
}
214394214421
214395214422
static int fts5Init(sqlite3 *db){
214396214423
static const sqlite3_module fts5Mod = {
214397214424
/* iVersion */ 2,
@@ -219097,12 +219124,12 @@
219097219124
}
219098219125
#endif /* SQLITE_CORE */
219099219126
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219100219127
219101219128
/************** End of stmt.c ************************************************/
219102
-#if __LINE__!=219102
219129
+#if __LINE__!=219129
219103219130
#undef SQLITE_SOURCE_ID
219104
-#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9falt2"
219131
+#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f76alt2"
219105219132
#endif
219106219133
/* Return the source-id for this library */
219107219134
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219108219135
/************************** End of sqlite3.c ******************************/
219109219136
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1156,11 +1156,11 @@
1156 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1157 ** [sqlite_version()] and [sqlite_source_id()].
1158 */
1159 #define SQLITE_VERSION "3.25.0"
1160 #define SQLITE_VERSION_NUMBER 3025000
1161 #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d"
1162
1163 /*
1164 ** CAPI3REF: Run-Time Library Version Numbers
1165 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1166 **
@@ -2113,22 +2113,23 @@
2113 ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
2114 ** a database file. The argument is a pointer to a 32-bit unsigned integer.
2115 ** The "data version" for the pager is written into the pointer. The
2116 ** "data version" changes whenever any change occurs to the corresponding
2117 ** database file, either through SQL statements on the same database
2118 ** connection, or through transactions committed by separate database
2119 ** connections possibly in other processes. The [sqlite3_total_changes()]
2120 ** interface can be used to find if any database on the connection has changed,
2121 ** but that interface response to changes on TEMP as well as MAIN and does
2122 ** not provide a mechanism to detect changes to MAIN only. Also, the
2123 ** [sqlite3_total_changes()] interface response to internal changes only and
2124 ** omits changes made by other database connections. The
2125 ** [PRAGMA data_version] command provide a mechanism to detect changes to
2126 ** a single attached database that occur due to other database connections,
2127 ** but omits changes implemented by the database connection for which it is
2128 ** called. This file control is the only mechanism to detect changes that
2129 ** happen either internally or externally on a single database.
 
2130 ** </ul>
2131 */
2132 #define SQLITE_FCNTL_LOCKSTATE 1
2133 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
2134 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -5762,11 +5763,11 @@
5762 ** SQL function or aggregate, pass NULL pointers for all three function
5763 ** callbacks.
5764 **
5765 ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
5766 ** and xInverse) passed to sqlite3_create_window_function are pointers to
5767 ** C-lanugage callbacks that implement the new function. xStep and xFinal
5768 ** must both be non-NULL. xValue and xInverse may either both be NULL, in
5769 ** which case a regular aggregate function is created, or must both be
5770 ** non-NULL, in which case the new function may be used as either an aggregate
5771 ** or aggregate window function. More details regarding the implementation
5772 ** of aggregate window functions are
@@ -10288,11 +10289,11 @@
10288 **
10289 ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
10290 ** in the P argument is held in memory obtained from [sqlite3_malloc64()]
10291 ** and that SQLite should take ownership of this memory and automatically
10292 ** free it when it has finished using it. Without this flag, the caller
10293 ** is resposible for freeing any dynamically allocated memory.
10294 **
10295 ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
10296 ** grow the size of the database using calls to [sqlite3_realloc64()]. This
10297 ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
10298 ** Without this flag, the deserialized database cannot increase in size beyond
@@ -12466,11 +12467,11 @@
12466 ** "place".
12467 **
12468 ** This way, even if the tokenizer does not provide synonyms
12469 ** when tokenizing query text (it should not - to do would be
12470 ** inefficient), it doesn't matter if the user queries for
12471 ** 'first + place' or '1st + place', as there are entires in the
12472 ** FTS index corresponding to both forms of the first token.
12473 ** </ol>
12474 **
12475 ** Whether it is parsing document or query text, any call to xToken that
12476 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -12494,11 +12495,11 @@
12494 **
12495 ** In many cases, method (1) above is the best approach. It does not add
12496 ** extra data to the FTS index or require FTS5 to query for multiple terms,
12497 ** so it is efficient in terms of disk space and query speed. However, it
12498 ** does not support prefix queries very well. If, as suggested above, the
12499 ** token "first" is subsituted for "1st" by the tokenizer, then the query:
12500 **
12501 ** <codeblock>
12502 ** ... MATCH '1s*'</codeblock>
12503 **
12504 ** will not match documents that contain the token "1st" (as the tokenizer
@@ -18972,10 +18973,11 @@
18972 SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
18973 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
18974 SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*);
18975 SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom);
18976 SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*);
 
18977 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
18978 SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*);
18979 SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
18980 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*);
18981 SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
@@ -27606,11 +27608,16 @@
27606 bufpt = va_arg(ap,char*);
27607 }
27608 if( bufpt==0 ){
27609 bufpt = "";
27610 }else if( xtype==etDYNSTRING ){
27611 if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){
 
 
 
 
 
27612 /* Special optimization for sqlite3_mprintf("%z..."):
27613 ** Extend an existing memory allocation rather than creating
27614 ** a new one. */
27615 assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 );
27616 pAccum->zText = bufpt;
@@ -36968,11 +36975,13 @@
36968 static void unixShmBarrier(
36969 sqlite3_file *fd /* Database file holding the shared memory */
36970 ){
36971 UNUSED_PARAMETER(fd);
36972 sqlite3MemoryBarrier(); /* compiler-defined memory barrier */
36973 assert( unixFileMutexNotheld((unixFile*)fd) );
 
 
36974 unixEnterMutex(); /* Also mutex, for redundancy */
36975 unixLeaveMutex();
36976 }
36977
36978 /*
@@ -46285,12 +46294,12 @@
46285 ** block of memory.
46286 **
46287 ** This file also implements interface sqlite3_serialize() and
46288 ** sqlite3_deserialize().
46289 */
46290 #ifdef SQLITE_ENABLE_DESERIALIZE
46291 /* #include "sqliteInt.h" */
 
46292
46293 /*
46294 ** Forward declaration of objects used by this utility
46295 */
46296 typedef struct sqlite3_vfs MemVfs;
@@ -60507,11 +60516,11 @@
60507 ** Other threads might append new content to the WAL and wal-index but
60508 ** that extra content is ignored by the current thread.
60509 **
60510 ** If the database contents have changes since the previous read
60511 ** transaction, then *pChanged is set to 1 before returning. The
60512 ** Pager layer will use this to know that is cache is stale and
60513 ** needs to be flushed.
60514 */
60515 SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){
60516 int rc; /* Return code */
60517 int cnt = 0; /* Number of TryBeginRead attempts */
@@ -78538,11 +78547,11 @@
78538 ** error, then it might not have been halted properly. So halt
78539 ** it now.
78540 */
78541 sqlite3VdbeHalt(p);
78542
78543 /* If the VDBE has be run even partially, then transfer the error code
78544 ** and error message from the VDBE into the main database structure. But
78545 ** if the VDBE has just been set to run but has not actually executed any
78546 ** instructions yet, leave the main database error information unchanged.
78547 */
78548 if( p->pc>=0 ){
@@ -101161,11 +101170,11 @@
101161 ** bTemp is not true, database "temp", can still be parsed. This is
101162 ** called at the end of the generation of an ALTER TABLE ... RENAME ...
101163 ** statement to ensure that the operation has not rendered any schema
101164 ** objects unusable.
101165 */
101166 void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){
101167 sqlite3NestedParse(pParse,
101168 "SELECT 1 "
101169 "FROM \"%w\".%s "
101170 "WHERE name NOT LIKE 'sqlite_%%'"
101171 " AND sql NOT LIKE 'create virtual%%'"
@@ -101188,11 +101197,11 @@
101188
101189 /*
101190 ** Generate code to reload the schema for database iDb. And, if iDb!=1, for
101191 ** the temp database as well.
101192 */
101193 void renameReloadSchema(Parse *pParse, int iDb){
101194 Vdbe *v = pParse->pVdbe;
101195 if( v ){
101196 sqlite3ChangeCookie(pParse, iDb);
101197 sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0);
101198 if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0);
@@ -101768,11 +101777,11 @@
101768 ** if( x==y ) ...
101769 **
101770 ** Technically, as x no longer points into a valid object or to the byte
101771 ** following a valid object, it may not be used in comparison operations.
101772 */
101773 void renameTokenCheckAll(Parse *pParse, void *pPtr){
101774 if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){
101775 RenameToken *p;
101776 u8 i = 0;
101777 for(p=pParse->pRename; p; p=p->pNext){
101778 if( p->p ){
@@ -101840,10 +101849,28 @@
101840 memset(&sWalker, 0, sizeof(Walker));
101841 sWalker.pParse = pParse;
101842 sWalker.xExprCallback = renameUnmapExprCb;
101843 sqlite3WalkExpr(&sWalker, pExpr);
101844 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101845
101846 /*
101847 ** Free the list of RenameToken objects given in the second argument
101848 */
101849 static void renameTokenFree(sqlite3 *db, RenameToken *pToken){
@@ -107746,10 +107773,13 @@
107746 /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */
107747 sqlite3EndTable(pParse, 0, &sEnd, 0, 0);
107748
107749 create_view_fail:
107750 sqlite3SelectDelete(db, pSelect);
 
 
 
107751 sqlite3ExprListDelete(db, pCNames);
107752 return;
107753 }
107754 #endif /* SQLITE_OMIT_VIEW */
107755
@@ -135329,15 +135359,12 @@
135329 static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){
135330 int rc = WRC_Continue;
135331 struct CCurHint *pHint = pWalker->u.pCCurHint;
135332 if( pExpr->op==TK_COLUMN ){
135333 if( pExpr->iTable!=pHint->iTabCur ){
135334 Vdbe *v = pWalker->pParse->pVdbe;
135335 int reg = ++pWalker->pParse->nMem; /* Register for column value */
135336 sqlite3ExprCodeGetColumnOfTable(
135337 v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg
135338 );
135339 pExpr->op = TK_REGISTER;
135340 pExpr->iTable = reg;
135341 }else if( pHint->pIdx!=0 ){
135342 pExpr->iTable = pHint->iIdxCur;
135343 pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn);
@@ -177353,15 +177380,15 @@
177353 jsonAppendChar(pStr, ']');
177354 if( pStr->bErr ){
177355 if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177356 assert( pStr->bStatic );
177357 }else if( isFinal ){
177358 sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
177359 pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177360 pStr->bStatic = 1;
177361 }else{
177362 sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
177363 pStr->nUsed--;
177364 }
177365 }else{
177366 sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
177367 }
@@ -177406,11 +177433,11 @@
177406 }else if( z[i]=='\\' ){
177407 i++;
177408 }
177409 }
177410 pStr->nUsed -= i;
177411 memmove(&z[1], &z[i+1], pStr->nUsed-1);
177412 }
177413 #else
177414 # define jsonGroupInverse 0
177415 #endif
177416
@@ -177452,15 +177479,15 @@
177452 jsonAppendChar(pStr, '}');
177453 if( pStr->bErr ){
177454 if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177455 assert( pStr->bStatic );
177456 }else if( isFinal ){
177457 sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
177458 pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177459 pStr->bStatic = 1;
177460 }else{
177461 sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT);
177462 pStr->nUsed--;
177463 }
177464 }else{
177465 sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);
177466 }
@@ -181310,11 +181337,11 @@
181310 ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
181311 ** COMMIT;
181312 */
181313 static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){
181314 Rtree *pRtree = (Rtree *)pVtab;
181315 int iwt = pRtree->inWrTrans;
181316 UNUSED_PARAMETER(iSavepoint);
181317 pRtree->inWrTrans = 0;
181318 nodeBlobReset(pRtree);
181319 pRtree->inWrTrans = iwt;
181320 return SQLITE_OK;
@@ -182450,11 +182477,11 @@
182450 continue;
182451 }
182452 break;
182453 }
182454 if( z[j-1]<'0' ) return 0;
182455 if( pVal ) *pVal = atof((const char*)p->z);
182456 p->z += j;
182457 return 1;
182458 }
182459
182460 /*
@@ -182705,12 +182732,12 @@
182705 int ii;
182706 if( p ){
182707 for(ii=0; ii<p->nVertex; ii++){
182708 x0 = p->a[ii*2];
182709 y0 = p->a[ii*2+1];
182710 x1 = A*x0 + B*y0 + E;
182711 y1 = C*x0 + D*y0 + F;
182712 p->a[ii*2] = x1;
182713 p->a[ii*2+1] = y1;
182714 }
182715 sqlite3_result_blob(context, p->hdr,
182716 4+8*p->nVertex, SQLITE_TRANSIENT);
@@ -182781,15 +182808,15 @@
182781 int ii;
182782 mnX = mxX = p->a[0];
182783 mnY = mxY = p->a[1];
182784 for(ii=1; ii<p->nVertex; ii++){
182785 double r = p->a[ii*2];
182786 if( r<mnX ) mnX = r;
182787 else if( r>mxX ) mxX = r;
182788 r = p->a[ii*2+1];
182789 if( r<mnY ) mnY = r;
182790 else if( r>mxY ) mxY = r;
182791 }
182792 if( pRc ) *pRc = SQLITE_OK;
182793 if( aCoord==0 ){
182794 geopolyBboxFill:
182795 pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6);
@@ -197385,11 +197412,11 @@
197385 ** "place".
197386 **
197387 ** This way, even if the tokenizer does not provide synonyms
197388 ** when tokenizing query text (it should not - to do would be
197389 ** inefficient), it doesn't matter if the user queries for
197390 ** 'first + place' or '1st + place', as there are entires in the
197391 ** FTS index corresponding to both forms of the first token.
197392 ** </ol>
197393 **
197394 ** Whether it is parsing document or query text, any call to xToken that
197395 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -197413,11 +197440,11 @@
197413 **
197414 ** In many cases, method (1) above is the best approach. It does not add
197415 ** extra data to the FTS index or require FTS5 to query for multiple terms,
197416 ** so it is efficient in terms of disk space and query speed. However, it
197417 ** does not support prefix queries very well. If, as suggested above, the
197418 ** token "first" is subsituted for "1st" by the tokenizer, then the query:
197419 **
197420 ** <codeblock>
197421 ** ... MATCH '1s*'</codeblock>
197422 **
197423 ** will not match documents that contain the token "1st" (as the tokenizer
@@ -214387,11 +214414,11 @@
214387 int nArg, /* Number of args */
214388 sqlite3_value **apUnused /* Function arguments */
214389 ){
214390 assert( nArg==0 );
214391 UNUSED_PARAM2(nArg, apUnused);
214392 sqlite3_result_text(pCtx, "fts5: 2018-09-10 16:38:25 564fa75195c5179d0bc86431aaff06136fc65ec63aa9839cd1114b1fbfac928b", -1, SQLITE_TRANSIENT);
214393 }
214394
214395 static int fts5Init(sqlite3 *db){
214396 static const sqlite3_module fts5Mod = {
214397 /* iVersion */ 2,
@@ -219097,12 +219124,12 @@
219097 }
219098 #endif /* SQLITE_CORE */
219099 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219100
219101 /************** End of stmt.c ************************************************/
219102 #if __LINE__!=219102
219103 #undef SQLITE_SOURCE_ID
219104 #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9falt2"
219105 #endif
219106 /* Return the source-id for this library */
219107 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219108 /************************** End of sqlite3.c ******************************/
219109
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1156,11 +1156,11 @@
1156 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1157 ** [sqlite_version()] and [sqlite_source_id()].
1158 */
1159 #define SQLITE_VERSION "3.25.0"
1160 #define SQLITE_VERSION_NUMBER 3025000
1161 #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760"
1162
1163 /*
1164 ** CAPI3REF: Run-Time Library Version Numbers
1165 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1166 **
@@ -2113,22 +2113,23 @@
2113 ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
2114 ** a database file. The argument is a pointer to a 32-bit unsigned integer.
2115 ** The "data version" for the pager is written into the pointer. The
2116 ** "data version" changes whenever any change occurs to the corresponding
2117 ** database file, either through SQL statements on the same database
2118 ** connection or through transactions committed by separate database
2119 ** connections possibly in other processes. The [sqlite3_total_changes()]
2120 ** interface can be used to find if any database on the connection has changed,
2121 ** but that interface responds to changes on TEMP as well as MAIN and does
2122 ** not provide a mechanism to detect changes to MAIN only. Also, the
2123 ** [sqlite3_total_changes()] interface responds to internal changes only and
2124 ** omits changes made by other database connections. The
2125 ** [PRAGMA data_version] command provide a mechanism to detect changes to
2126 ** a single attached database that occur due to other database connections,
2127 ** but omits changes implemented by the database connection on which it is
2128 ** called. This file control is the only mechanism to detect changes that
2129 ** happen either internally or externally and that are associated with
2130 ** a particular attached database.
2131 ** </ul>
2132 */
2133 #define SQLITE_FCNTL_LOCKSTATE 1
2134 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
2135 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -5762,11 +5763,11 @@
5763 ** SQL function or aggregate, pass NULL pointers for all three function
5764 ** callbacks.
5765 **
5766 ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
5767 ** and xInverse) passed to sqlite3_create_window_function are pointers to
5768 ** C-language callbacks that implement the new function. xStep and xFinal
5769 ** must both be non-NULL. xValue and xInverse may either both be NULL, in
5770 ** which case a regular aggregate function is created, or must both be
5771 ** non-NULL, in which case the new function may be used as either an aggregate
5772 ** or aggregate window function. More details regarding the implementation
5773 ** of aggregate window functions are
@@ -10288,11 +10289,11 @@
10289 **
10290 ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
10291 ** in the P argument is held in memory obtained from [sqlite3_malloc64()]
10292 ** and that SQLite should take ownership of this memory and automatically
10293 ** free it when it has finished using it. Without this flag, the caller
10294 ** is responsible for freeing any dynamically allocated memory.
10295 **
10296 ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
10297 ** grow the size of the database using calls to [sqlite3_realloc64()]. This
10298 ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
10299 ** Without this flag, the deserialized database cannot increase in size beyond
@@ -12466,11 +12467,11 @@
12467 ** "place".
12468 **
12469 ** This way, even if the tokenizer does not provide synonyms
12470 ** when tokenizing query text (it should not - to do would be
12471 ** inefficient), it doesn't matter if the user queries for
12472 ** 'first + place' or '1st + place', as there are entries in the
12473 ** FTS index corresponding to both forms of the first token.
12474 ** </ol>
12475 **
12476 ** Whether it is parsing document or query text, any call to xToken that
12477 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -12494,11 +12495,11 @@
12495 **
12496 ** In many cases, method (1) above is the best approach. It does not add
12497 ** extra data to the FTS index or require FTS5 to query for multiple terms,
12498 ** so it is efficient in terms of disk space and query speed. However, it
12499 ** does not support prefix queries very well. If, as suggested above, the
12500 ** token "first" is substituted for "1st" by the tokenizer, then the query:
12501 **
12502 ** <codeblock>
12503 ** ... MATCH '1s*'</codeblock>
12504 **
12505 ** will not match documents that contain the token "1st" (as the tokenizer
@@ -18972,10 +18973,11 @@
18973 SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
18974 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
18975 SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*);
18976 SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom);
18977 SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*);
18978 SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*);
18979 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
18980 SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*);
18981 SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
18982 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*);
18983 SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
@@ -27606,11 +27608,16 @@
27608 bufpt = va_arg(ap,char*);
27609 }
27610 if( bufpt==0 ){
27611 bufpt = "";
27612 }else if( xtype==etDYNSTRING ){
27613 if( pAccum->nChar==0
27614 && pAccum->mxAlloc
27615 && width==0
27616 && precision<0
27617 && pAccum->accError==0
27618 ){
27619 /* Special optimization for sqlite3_mprintf("%z..."):
27620 ** Extend an existing memory allocation rather than creating
27621 ** a new one. */
27622 assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 );
27623 pAccum->zText = bufpt;
@@ -36968,11 +36975,13 @@
36975 static void unixShmBarrier(
36976 sqlite3_file *fd /* Database file holding the shared memory */
36977 ){
36978 UNUSED_PARAMETER(fd);
36979 sqlite3MemoryBarrier(); /* compiler-defined memory barrier */
36980 assert( fd->pMethods->xLock==nolockLock
36981 || unixFileMutexNotheld((unixFile*)fd)
36982 );
36983 unixEnterMutex(); /* Also mutex, for redundancy */
36984 unixLeaveMutex();
36985 }
36986
36987 /*
@@ -46285,12 +46294,12 @@
46294 ** block of memory.
46295 **
46296 ** This file also implements interface sqlite3_serialize() and
46297 ** sqlite3_deserialize().
46298 */
 
46299 /* #include "sqliteInt.h" */
46300 #ifdef SQLITE_ENABLE_DESERIALIZE
46301
46302 /*
46303 ** Forward declaration of objects used by this utility
46304 */
46305 typedef struct sqlite3_vfs MemVfs;
@@ -60507,11 +60516,11 @@
60516 ** Other threads might append new content to the WAL and wal-index but
60517 ** that extra content is ignored by the current thread.
60518 **
60519 ** If the database contents have changes since the previous read
60520 ** transaction, then *pChanged is set to 1 before returning. The
60521 ** Pager layer will use this to know that its cache is stale and
60522 ** needs to be flushed.
60523 */
60524 SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){
60525 int rc; /* Return code */
60526 int cnt = 0; /* Number of TryBeginRead attempts */
@@ -78538,11 +78547,11 @@
78547 ** error, then it might not have been halted properly. So halt
78548 ** it now.
78549 */
78550 sqlite3VdbeHalt(p);
78551
78552 /* If the VDBE has been run even partially, then transfer the error code
78553 ** and error message from the VDBE into the main database structure. But
78554 ** if the VDBE has just been set to run but has not actually executed any
78555 ** instructions yet, leave the main database error information unchanged.
78556 */
78557 if( p->pc>=0 ){
@@ -101161,11 +101170,11 @@
101170 ** bTemp is not true, database "temp", can still be parsed. This is
101171 ** called at the end of the generation of an ALTER TABLE ... RENAME ...
101172 ** statement to ensure that the operation has not rendered any schema
101173 ** objects unusable.
101174 */
101175 static void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){
101176 sqlite3NestedParse(pParse,
101177 "SELECT 1 "
101178 "FROM \"%w\".%s "
101179 "WHERE name NOT LIKE 'sqlite_%%'"
101180 " AND sql NOT LIKE 'create virtual%%'"
@@ -101188,11 +101197,11 @@
101197
101198 /*
101199 ** Generate code to reload the schema for database iDb. And, if iDb!=1, for
101200 ** the temp database as well.
101201 */
101202 static void renameReloadSchema(Parse *pParse, int iDb){
101203 Vdbe *v = pParse->pVdbe;
101204 if( v ){
101205 sqlite3ChangeCookie(pParse, iDb);
101206 sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0);
101207 if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0);
@@ -101768,11 +101777,11 @@
101777 ** if( x==y ) ...
101778 **
101779 ** Technically, as x no longer points into a valid object or to the byte
101780 ** following a valid object, it may not be used in comparison operations.
101781 */
101782 static void renameTokenCheckAll(Parse *pParse, void *pPtr){
101783 if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){
101784 RenameToken *p;
101785 u8 i = 0;
101786 for(p=pParse->pRename; p; p=p->pNext){
101787 if( p->p ){
@@ -101840,10 +101849,28 @@
101849 memset(&sWalker, 0, sizeof(Walker));
101850 sWalker.pParse = pParse;
101851 sWalker.xExprCallback = renameUnmapExprCb;
101852 sqlite3WalkExpr(&sWalker, pExpr);
101853 }
101854
101855 /*
101856 ** Remove all nodes that are part of expression-list pEList from the
101857 ** rename list.
101858 */
101859 SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *pEList){
101860 if( pEList ){
101861 int i;
101862 Walker sWalker;
101863 memset(&sWalker, 0, sizeof(Walker));
101864 sWalker.pParse = pParse;
101865 sWalker.xExprCallback = renameUnmapExprCb;
101866 sqlite3WalkExprList(&sWalker, pEList);
101867 for(i=0; i<pEList->nExpr; i++){
101868 sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zName);
101869 }
101870 }
101871 }
101872
101873 /*
101874 ** Free the list of RenameToken objects given in the second argument
101875 */
101876 static void renameTokenFree(sqlite3 *db, RenameToken *pToken){
@@ -107746,10 +107773,13 @@
107773 /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */
107774 sqlite3EndTable(pParse, 0, &sEnd, 0, 0);
107775
107776 create_view_fail:
107777 sqlite3SelectDelete(db, pSelect);
107778 if( IN_RENAME_OBJECT ){
107779 sqlite3RenameExprlistUnmap(pParse, pCNames);
107780 }
107781 sqlite3ExprListDelete(db, pCNames);
107782 return;
107783 }
107784 #endif /* SQLITE_OMIT_VIEW */
107785
@@ -135329,15 +135359,12 @@
135359 static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){
135360 int rc = WRC_Continue;
135361 struct CCurHint *pHint = pWalker->u.pCCurHint;
135362 if( pExpr->op==TK_COLUMN ){
135363 if( pExpr->iTable!=pHint->iTabCur ){
 
135364 int reg = ++pWalker->pParse->nMem; /* Register for column value */
135365 sqlite3ExprCode(pWalker->pParse, pExpr, reg);
 
 
135366 pExpr->op = TK_REGISTER;
135367 pExpr->iTable = reg;
135368 }else if( pHint->pIdx!=0 ){
135369 pExpr->iTable = pHint->iIdxCur;
135370 pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn);
@@ -177353,15 +177380,15 @@
177380 jsonAppendChar(pStr, ']');
177381 if( pStr->bErr ){
177382 if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177383 assert( pStr->bStatic );
177384 }else if( isFinal ){
177385 sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
177386 pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177387 pStr->bStatic = 1;
177388 }else{
177389 sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
177390 pStr->nUsed--;
177391 }
177392 }else{
177393 sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
177394 }
@@ -177406,11 +177433,11 @@
177433 }else if( z[i]=='\\' ){
177434 i++;
177435 }
177436 }
177437 pStr->nUsed -= i;
177438 memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1);
177439 }
177440 #else
177441 # define jsonGroupInverse 0
177442 #endif
177443
@@ -177452,15 +177479,15 @@
177479 jsonAppendChar(pStr, '}');
177480 if( pStr->bErr ){
177481 if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
177482 assert( pStr->bStatic );
177483 }else if( isFinal ){
177484 sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
177485 pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
177486 pStr->bStatic = 1;
177487 }else{
177488 sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT);
177489 pStr->nUsed--;
177490 }
177491 }else{
177492 sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);
177493 }
@@ -181310,11 +181337,11 @@
181337 ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
181338 ** COMMIT;
181339 */
181340 static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){
181341 Rtree *pRtree = (Rtree *)pVtab;
181342 u8 iwt = pRtree->inWrTrans;
181343 UNUSED_PARAMETER(iSavepoint);
181344 pRtree->inWrTrans = 0;
181345 nodeBlobReset(pRtree);
181346 pRtree->inWrTrans = iwt;
181347 return SQLITE_OK;
@@ -182450,11 +182477,11 @@
182477 continue;
182478 }
182479 break;
182480 }
182481 if( z[j-1]<'0' ) return 0;
182482 if( pVal ) *pVal = (GeoCoord)atof((const char*)p->z);
182483 p->z += j;
182484 return 1;
182485 }
182486
182487 /*
@@ -182705,12 +182732,12 @@
182732 int ii;
182733 if( p ){
182734 for(ii=0; ii<p->nVertex; ii++){
182735 x0 = p->a[ii*2];
182736 y0 = p->a[ii*2+1];
182737 x1 = (GeoCoord)(A*x0 + B*y0 + E);
182738 y1 = (GeoCoord)(C*x0 + D*y0 + F);
182739 p->a[ii*2] = x1;
182740 p->a[ii*2+1] = y1;
182741 }
182742 sqlite3_result_blob(context, p->hdr,
182743 4+8*p->nVertex, SQLITE_TRANSIENT);
@@ -182781,15 +182808,15 @@
182808 int ii;
182809 mnX = mxX = p->a[0];
182810 mnY = mxY = p->a[1];
182811 for(ii=1; ii<p->nVertex; ii++){
182812 double r = p->a[ii*2];
182813 if( r<mnX ) mnX = (float)r;
182814 else if( r>mxX ) mxX = (float)r;
182815 r = p->a[ii*2+1];
182816 if( r<mnY ) mnY = (float)r;
182817 else if( r>mxY ) mxY = (float)r;
182818 }
182819 if( pRc ) *pRc = SQLITE_OK;
182820 if( aCoord==0 ){
182821 geopolyBboxFill:
182822 pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6);
@@ -197385,11 +197412,11 @@
197412 ** "place".
197413 **
197414 ** This way, even if the tokenizer does not provide synonyms
197415 ** when tokenizing query text (it should not - to do would be
197416 ** inefficient), it doesn't matter if the user queries for
197417 ** 'first + place' or '1st + place', as there are entries in the
197418 ** FTS index corresponding to both forms of the first token.
197419 ** </ol>
197420 **
197421 ** Whether it is parsing document or query text, any call to xToken that
197422 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -197413,11 +197440,11 @@
197440 **
197441 ** In many cases, method (1) above is the best approach. It does not add
197442 ** extra data to the FTS index or require FTS5 to query for multiple terms,
197443 ** so it is efficient in terms of disk space and query speed. However, it
197444 ** does not support prefix queries very well. If, as suggested above, the
197445 ** token "first" is substituted for "1st" by the tokenizer, then the query:
197446 **
197447 ** <codeblock>
197448 ** ... MATCH '1s*'</codeblock>
197449 **
197450 ** will not match documents that contain the token "1st" (as the tokenizer
@@ -214387,11 +214414,11 @@
214414 int nArg, /* Number of args */
214415 sqlite3_value **apUnused /* Function arguments */
214416 ){
214417 assert( nArg==0 );
214418 UNUSED_PARAM2(nArg, apUnused);
214419 sqlite3_result_text(pCtx, "fts5: 2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760", -1, SQLITE_TRANSIENT);
214420 }
214421
214422 static int fts5Init(sqlite3 *db){
214423 static const sqlite3_module fts5Mod = {
214424 /* iVersion */ 2,
@@ -219097,12 +219124,12 @@
219124 }
219125 #endif /* SQLITE_CORE */
219126 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
219127
219128 /************** End of stmt.c ************************************************/
219129 #if __LINE__!=219129
219130 #undef SQLITE_SOURCE_ID
219131 #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f76alt2"
219132 #endif
219133 /* Return the source-id for this library */
219134 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
219135 /************************** End of sqlite3.c ******************************/
219136
+11 -10
--- 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.25.0"
127127
#define SQLITE_VERSION_NUMBER 3025000
128
-#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d"
128
+#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -1080,22 +1080,23 @@
10801080
** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
10811081
** a database file. The argument is a pointer to a 32-bit unsigned integer.
10821082
** The "data version" for the pager is written into the pointer. The
10831083
** "data version" changes whenever any change occurs to the corresponding
10841084
** database file, either through SQL statements on the same database
1085
-** connection, or through transactions committed by separate database
1085
+** connection or through transactions committed by separate database
10861086
** connections possibly in other processes. The [sqlite3_total_changes()]
10871087
** interface can be used to find if any database on the connection has changed,
1088
-** but that interface response to changes on TEMP as well as MAIN and does
1088
+** but that interface responds to changes on TEMP as well as MAIN and does
10891089
** not provide a mechanism to detect changes to MAIN only. Also, the
1090
-** [sqlite3_total_changes()] interface response to internal changes only and
1090
+** [sqlite3_total_changes()] interface responds to internal changes only and
10911091
** omits changes made by other database connections. The
10921092
** [PRAGMA data_version] command provide a mechanism to detect changes to
10931093
** a single attached database that occur due to other database connections,
1094
-** but omits changes implemented by the database connection for which it is
1094
+** but omits changes implemented by the database connection on which it is
10951095
** called. This file control is the only mechanism to detect changes that
1096
-** happen either internally or externally on a single database.
1096
+** happen either internally or externally and that are associated with
1097
+** a particular attached database.
10971098
** </ul>
10981099
*/
10991100
#define SQLITE_FCNTL_LOCKSTATE 1
11001101
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
11011102
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -4729,11 +4730,11 @@
47294730
** SQL function or aggregate, pass NULL pointers for all three function
47304731
** callbacks.
47314732
**
47324733
** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
47334734
** and xInverse) passed to sqlite3_create_window_function are pointers to
4734
-** C-lanugage callbacks that implement the new function. xStep and xFinal
4735
+** C-language callbacks that implement the new function. xStep and xFinal
47354736
** must both be non-NULL. xValue and xInverse may either both be NULL, in
47364737
** which case a regular aggregate function is created, or must both be
47374738
** non-NULL, in which case the new function may be used as either an aggregate
47384739
** or aggregate window function. More details regarding the implementation
47394740
** of aggregate window functions are
@@ -9255,11 +9256,11 @@
92559256
**
92569257
** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
92579258
** in the P argument is held in memory obtained from [sqlite3_malloc64()]
92589259
** and that SQLite should take ownership of this memory and automatically
92599260
** free it when it has finished using it. Without this flag, the caller
9260
-** is resposible for freeing any dynamically allocated memory.
9261
+** is responsible for freeing any dynamically allocated memory.
92619262
**
92629263
** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
92639264
** grow the size of the database using calls to [sqlite3_realloc64()]. This
92649265
** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
92659266
** Without this flag, the deserialized database cannot increase in size beyond
@@ -11433,11 +11434,11 @@
1143311434
** "place".
1143411435
**
1143511436
** This way, even if the tokenizer does not provide synonyms
1143611437
** when tokenizing query text (it should not - to do would be
1143711438
** inefficient), it doesn't matter if the user queries for
11438
-** 'first + place' or '1st + place', as there are entires in the
11439
+** 'first + place' or '1st + place', as there are entries in the
1143911440
** FTS index corresponding to both forms of the first token.
1144011441
** </ol>
1144111442
**
1144211443
** Whether it is parsing document or query text, any call to xToken that
1144311444
** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -11461,11 +11462,11 @@
1146111462
**
1146211463
** In many cases, method (1) above is the best approach. It does not add
1146311464
** extra data to the FTS index or require FTS5 to query for multiple terms,
1146411465
** so it is efficient in terms of disk space and query speed. However, it
1146511466
** does not support prefix queries very well. If, as suggested above, the
11466
-** token "first" is subsituted for "1st" by the tokenizer, then the query:
11467
+** token "first" is substituted for "1st" by the tokenizer, then the query:
1146711468
**
1146811469
** <codeblock>
1146911470
** ... MATCH '1s*'</codeblock>
1147011471
**
1147111472
** will not match documents that contain the token "1st" (as the tokenizer
1147211473
--- 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.25.0"
127 #define SQLITE_VERSION_NUMBER 3025000
128 #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1080,22 +1080,23 @@
1080 ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
1081 ** a database file. The argument is a pointer to a 32-bit unsigned integer.
1082 ** The "data version" for the pager is written into the pointer. The
1083 ** "data version" changes whenever any change occurs to the corresponding
1084 ** database file, either through SQL statements on the same database
1085 ** connection, or through transactions committed by separate database
1086 ** connections possibly in other processes. The [sqlite3_total_changes()]
1087 ** interface can be used to find if any database on the connection has changed,
1088 ** but that interface response to changes on TEMP as well as MAIN and does
1089 ** not provide a mechanism to detect changes to MAIN only. Also, the
1090 ** [sqlite3_total_changes()] interface response to internal changes only and
1091 ** omits changes made by other database connections. The
1092 ** [PRAGMA data_version] command provide a mechanism to detect changes to
1093 ** a single attached database that occur due to other database connections,
1094 ** but omits changes implemented by the database connection for which it is
1095 ** called. This file control is the only mechanism to detect changes that
1096 ** happen either internally or externally on a single database.
 
1097 ** </ul>
1098 */
1099 #define SQLITE_FCNTL_LOCKSTATE 1
1100 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1101 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -4729,11 +4730,11 @@
4729 ** SQL function or aggregate, pass NULL pointers for all three function
4730 ** callbacks.
4731 **
4732 ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
4733 ** and xInverse) passed to sqlite3_create_window_function are pointers to
4734 ** C-lanugage callbacks that implement the new function. xStep and xFinal
4735 ** must both be non-NULL. xValue and xInverse may either both be NULL, in
4736 ** which case a regular aggregate function is created, or must both be
4737 ** non-NULL, in which case the new function may be used as either an aggregate
4738 ** or aggregate window function. More details regarding the implementation
4739 ** of aggregate window functions are
@@ -9255,11 +9256,11 @@
9255 **
9256 ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
9257 ** in the P argument is held in memory obtained from [sqlite3_malloc64()]
9258 ** and that SQLite should take ownership of this memory and automatically
9259 ** free it when it has finished using it. Without this flag, the caller
9260 ** is resposible for freeing any dynamically allocated memory.
9261 **
9262 ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
9263 ** grow the size of the database using calls to [sqlite3_realloc64()]. This
9264 ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
9265 ** Without this flag, the deserialized database cannot increase in size beyond
@@ -11433,11 +11434,11 @@
11433 ** "place".
11434 **
11435 ** This way, even if the tokenizer does not provide synonyms
11436 ** when tokenizing query text (it should not - to do would be
11437 ** inefficient), it doesn't matter if the user queries for
11438 ** 'first + place' or '1st + place', as there are entires in the
11439 ** FTS index corresponding to both forms of the first token.
11440 ** </ol>
11441 **
11442 ** Whether it is parsing document or query text, any call to xToken that
11443 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -11461,11 +11462,11 @@
11461 **
11462 ** In many cases, method (1) above is the best approach. It does not add
11463 ** extra data to the FTS index or require FTS5 to query for multiple terms,
11464 ** so it is efficient in terms of disk space and query speed. However, it
11465 ** does not support prefix queries very well. If, as suggested above, the
11466 ** token "first" is subsituted for "1st" by the tokenizer, then the query:
11467 **
11468 ** <codeblock>
11469 ** ... MATCH '1s*'</codeblock>
11470 **
11471 ** will not match documents that contain the token "1st" (as the tokenizer
11472
--- 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.25.0"
127 #define SQLITE_VERSION_NUMBER 3025000
128 #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1080,22 +1080,23 @@
1080 ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
1081 ** a database file. The argument is a pointer to a 32-bit unsigned integer.
1082 ** The "data version" for the pager is written into the pointer. The
1083 ** "data version" changes whenever any change occurs to the corresponding
1084 ** database file, either through SQL statements on the same database
1085 ** connection or through transactions committed by separate database
1086 ** connections possibly in other processes. The [sqlite3_total_changes()]
1087 ** interface can be used to find if any database on the connection has changed,
1088 ** but that interface responds to changes on TEMP as well as MAIN and does
1089 ** not provide a mechanism to detect changes to MAIN only. Also, the
1090 ** [sqlite3_total_changes()] interface responds to internal changes only and
1091 ** omits changes made by other database connections. The
1092 ** [PRAGMA data_version] command provide a mechanism to detect changes to
1093 ** a single attached database that occur due to other database connections,
1094 ** but omits changes implemented by the database connection on which it is
1095 ** called. This file control is the only mechanism to detect changes that
1096 ** happen either internally or externally and that are associated with
1097 ** a particular attached database.
1098 ** </ul>
1099 */
1100 #define SQLITE_FCNTL_LOCKSTATE 1
1101 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1102 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -4729,11 +4730,11 @@
4730 ** SQL function or aggregate, pass NULL pointers for all three function
4731 ** callbacks.
4732 **
4733 ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
4734 ** and xInverse) passed to sqlite3_create_window_function are pointers to
4735 ** C-language callbacks that implement the new function. xStep and xFinal
4736 ** must both be non-NULL. xValue and xInverse may either both be NULL, in
4737 ** which case a regular aggregate function is created, or must both be
4738 ** non-NULL, in which case the new function may be used as either an aggregate
4739 ** or aggregate window function. More details regarding the implementation
4740 ** of aggregate window functions are
@@ -9255,11 +9256,11 @@
9256 **
9257 ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
9258 ** in the P argument is held in memory obtained from [sqlite3_malloc64()]
9259 ** and that SQLite should take ownership of this memory and automatically
9260 ** free it when it has finished using it. Without this flag, the caller
9261 ** is responsible for freeing any dynamically allocated memory.
9262 **
9263 ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
9264 ** grow the size of the database using calls to [sqlite3_realloc64()]. This
9265 ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
9266 ** Without this flag, the deserialized database cannot increase in size beyond
@@ -11433,11 +11434,11 @@
11434 ** "place".
11435 **
11436 ** This way, even if the tokenizer does not provide synonyms
11437 ** when tokenizing query text (it should not - to do would be
11438 ** inefficient), it doesn't matter if the user queries for
11439 ** 'first + place' or '1st + place', as there are entries in the
11440 ** FTS index corresponding to both forms of the first token.
11441 ** </ol>
11442 **
11443 ** Whether it is parsing document or query text, any call to xToken that
11444 ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit
@@ -11461,11 +11462,11 @@
11462 **
11463 ** In many cases, method (1) above is the best approach. It does not add
11464 ** extra data to the FTS index or require FTS5 to query for multiple terms,
11465 ** so it is efficient in terms of disk space and query speed. However, it
11466 ** does not support prefix queries very well. If, as suggested above, the
11467 ** token "first" is substituted for "1st" by the tokenizer, then the query:
11468 **
11469 ** <codeblock>
11470 ** ... MATCH '1s*'</codeblock>
11471 **
11472 ** will not match documents that contain the token "1st" (as the tokenizer
11473

Keyboard Shortcuts

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