Fossil SCM

Update the built-in SQLite to the 3rd 3.20.0 release candidate.

drh 2017-07-28 00:49 trunk
Commit 8ffba76b7342556ee76774af3d98209729ca034a93f6c00fd168a60fabeafb95
2 files changed +109 -80 +19 -16
+109 -80
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1150,11 +1150,11 @@
11501150
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11511151
** [sqlite_version()] and [sqlite_source_id()].
11521152
*/
11531153
#define SQLITE_VERSION "3.20.0"
11541154
#define SQLITE_VERSION_NUMBER 3020000
1155
-#define SQLITE_SOURCE_ID "2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51"
1155
+#define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9"
11561156
11571157
/*
11581158
** CAPI3REF: Run-Time Library Version Numbers
11591159
** KEYWORDS: sqlite3_version sqlite3_sourceid
11601160
**
@@ -4910,18 +4910,18 @@
49104910
** Zeroblobs are intended to serve as placeholders for BLOBs whose
49114911
** content is later written using
49124912
** [sqlite3_blob_open | incremental BLOB I/O] routines.
49134913
** ^A negative value for the zeroblob results in a zero-length BLOB.
49144914
**
4915
-** ^The sqlite3_bind_pointer(S,I,P,T) routine causes the I-th parameter in
4915
+** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
49164916
** [prepared statement] S to have an SQL value of NULL, but to also be
4917
-** associated with the pointer P of type T.
4918
-** ^The sqlite3_bind_pointer() routine can be used to pass
4919
-** host-language pointers into [application-defined SQL functions].
4920
-** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
4921
-** to be an ordinary SQL NULL value to everything other than
4922
-** [sqlite3_value_pointer()]. The T parameter should be a static string.
4917
+** associated with the pointer P of type T. ^D is either a NULL pointer or
4918
+** a pointer to a destructor function for P. ^SQLite will invoke the
4919
+** destructor D with a single argument of P when it is finished using
4920
+** P. The T parameter should be a static string, preferably a string
4921
+** literal. The sqlite3_bind_pointer() routine is part of the
4922
+** [pointer passing interface] added for SQLite 3.20.0.
49234923
**
49244924
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
49254925
** for the [prepared statement] or with a prepared statement for which
49264926
** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
49274927
** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -4952,11 +4952,11 @@
49524952
SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
49534953
SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
49544954
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
49554955
void(*)(void*), unsigned char encoding);
49564956
SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4957
-SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*);
4957
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
49584958
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
49594959
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
49604960
49614961
/*
49624962
** CAPI3REF: Number Of SQL Parameters
@@ -5785,14 +5785,15 @@
57855785
** in the native byte-order of the host machine. ^The
57865786
** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
57875787
** extract UTF-16 strings as big-endian and little-endian respectively.
57885788
**
57895789
** ^If [sqlite3_value] object V was initialized
5790
-** using [sqlite3_bind_pointer(S,I,P,X)] or [sqlite3_result_pointer(C,P,X)]
5790
+** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
57915791
** and if X and Y are strings that compare equal according to strcmp(X,Y),
57925792
** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
5793
-** sqlite3_value_pointer(V,Y) returns a NULL.
5793
+** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer()
5794
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
57945795
**
57955796
** ^(The sqlite3_value_type(V) interface returns the
57965797
** [SQLITE_INTEGER | datatype code] for the initial datatype of the
57975798
** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
57985799
** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -6123,18 +6124,20 @@
61236124
** be deallocated after sqlite3_result_value() returns without harm.
61246125
** ^A [protected sqlite3_value] object may always be used where an
61256126
** [unprotected sqlite3_value] object is required, so either
61266127
** kind of [sqlite3_value] object can be used with this interface.
61276128
**
6128
-** ^The sqlite3_result_pointer(C,P,T) interface sets the result to an
6129
+** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
61296130
** SQL NULL value, just like [sqlite3_result_null(C)], except that it
61306131
** also associates the host-language pointer P or type T with that
61316132
** NULL value such that the pointer can be retrieved within an
61326133
** [application-defined SQL function] using [sqlite3_value_pointer()].
6133
-** The T parameter should be a static string.
6134
-** This mechanism can be used to pass non-SQL values between
6135
-** application-defined functions.
6134
+** ^If the D parameter is not NULL, then it is a pointer to a destructor
6135
+** for the P parameter. ^SQLite invokes D with P as its only argument
6136
+** when SQLite is finished with P. The T parameter should be a static
6137
+** string and preferably a string literal. The sqlite3_result_pointer()
6138
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
61366139
**
61376140
** If these routines are called from within the different thread
61386141
** than the one containing the application-defined function that received
61396142
** the [sqlite3_context] pointer, the results are undefined.
61406143
*/
@@ -6155,11 +6158,11 @@
61556158
void(*)(void*), unsigned char encoding);
61566159
SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
61576160
SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
61586161
SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
61596162
SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
6160
-SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*, const char*);
6163
+SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
61616164
SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
61626165
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
61636166
61646167
61656168
/*
@@ -15397,11 +15400,11 @@
1539715400
#define DFUNCTION(zName, nArg, iArg, bNC, xFunc) \
1539815401
{nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8, \
1539915402
0, 0, xFunc, 0, #zName, {0} }
1540015403
#define PURE_DATE(zName, nArg, iArg, bNC, xFunc) \
1540115404
{nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
15402
- (void*)xFunc, 0, xFunc, 0, #zName, {0} }
15405
+ (void*)&sqlite3Config, 0, xFunc, 0, #zName, {0} }
1540315406
#define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
1540415407
{nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
1540515408
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, #zName, {0} }
1540615409
#define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
1540715410
{nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
@@ -18645,12 +18648,12 @@
1864518648
*/
1864618649
struct sqlite3_value {
1864718650
union MemValue {
1864818651
double r; /* Real value used when MEM_Real is set in flags */
1864918652
i64 i; /* Integer value used when MEM_Int is set in flags */
18650
- int nZero; /* Used when bit MEM_Zero is set in flags */
18651
- void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
18653
+ int nZero; /* Extra zero bytes when MEM_Zero and MEM_Blob set */
18654
+ const char *zPType; /* Pointer type when MEM_Term|MEM_Subtype|MEM_Null */
1865218655
FuncDef *pDef; /* Used only when flags==MEM_Agg */
1865318656
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
1865418657
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
1865518658
} u;
1865618659
u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
@@ -18678,37 +18681,38 @@
1867818681
1867918682
/* One or more of the following flags are set to indicate the validOK
1868018683
** representations of the value stored in the Mem struct.
1868118684
**
1868218685
** If the MEM_Null flag is set, then the value is an SQL NULL value.
18683
-** No other flags may be set in this case.
18686
+** For a pointer type created using sqlite3_bind_pointer() or
18687
+** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set.
1868418688
**
1868518689
** If the MEM_Str flag is set then Mem.z points at a string representation.
1868618690
** Usually this is encoded in the same unicode encoding as the main
1868718691
** database (see below for exceptions). If the MEM_Term flag is also
1868818692
** set, then the string is nul terminated. The MEM_Int and MEM_Real
1868918693
** flags may coexist with the MEM_Str flag.
1869018694
*/
18691
-#define MEM_Null 0x0001 /* Value is NULL */
18695
+#define MEM_Null 0x0001 /* Value is NULL (or a pointer) */
1869218696
#define MEM_Str 0x0002 /* Value is a string */
1869318697
#define MEM_Int 0x0004 /* Value is an integer */
1869418698
#define MEM_Real 0x0008 /* Value is a real number */
1869518699
#define MEM_Blob 0x0010 /* Value is a BLOB */
1869618700
#define MEM_AffMask 0x001f /* Mask of affinity bits */
1869718701
#define MEM_RowSet 0x0020 /* Value is a RowSet object */
1869818702
#define MEM_Frame 0x0040 /* Value is a VdbeFrame object */
1869918703
#define MEM_Undefined 0x0080 /* Value is undefined */
1870018704
#define MEM_Cleared 0x0100 /* NULL set by OP_Null, not from data */
18701
-#define MEM_TypeMask 0x81ff /* Mask of type bits */
18705
+#define MEM_TypeMask 0xc1ff /* Mask of type bits */
1870218706
1870318707
1870418708
/* Whenever Mem contains a valid string or blob representation, one of
1870518709
** the following flags must be set to determine the memory management
1870618710
** policy for Mem.z. The MEM_Term flag tells us whether or not the
1870718711
** string is \000 or \u0000 terminated
1870818712
*/
18709
-#define MEM_Term 0x0200 /* String rep is nul terminated */
18713
+#define MEM_Term 0x0200 /* String in Mem.z is zero terminated */
1871018714
#define MEM_Dyn 0x0400 /* Need to call Mem.xDel() on Mem.z */
1871118715
#define MEM_Static 0x0800 /* Mem.z points to a static string */
1871218716
#define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
1871318717
#define MEM_Agg 0x2000 /* Mem.z points to an agg function context */
1871418718
#define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */
@@ -18932,11 +18936,11 @@
1893218936
#ifdef SQLITE_OMIT_FLOATING_POINT
1893318937
# define sqlite3VdbeMemSetDouble sqlite3VdbeMemSetInt64
1893418938
#else
1893518939
SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
1893618940
#endif
18937
-SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*);
18941
+SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*, void(*)(void*));
1893818942
SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
1893918943
SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
1894018944
SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
1894118945
SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*);
1894218946
SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
@@ -70268,11 +70272,11 @@
7026870272
** This routine is intended for use inside of assert() statements, like
7026970273
** this: assert( sqlite3VdbeCheckMemInvariants(pMem) );
7027070274
*/
7027170275
SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){
7027270276
/* If MEM_Dyn is set then Mem.xDel!=0.
70273
- ** Mem.xDel is might not be initialized if MEM_Dyn is clear.
70277
+ ** Mem.xDel might not be initialized if MEM_Dyn is clear.
7027470278
*/
7027570279
assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 );
7027670280
7027770281
/* MEM_Dyn may only be set if Mem.szMalloc==0. In this way we
7027870282
** ensure that if Mem.szMalloc>0 then it is safe to do
@@ -70281,13 +70285,38 @@
7028170285
assert( (p->flags & MEM_Dyn)==0 || p->szMalloc==0 );
7028270286
7028370287
/* Cannot be both MEM_Int and MEM_Real at the same time */
7028470288
assert( (p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) );
7028570289
70286
- /* Cannot be both MEM_Null and some other type */
70287
- assert( (p->flags & MEM_Null)==0 ||
70288
- (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0 );
70290
+ if( p->flags & MEM_Null ){
70291
+ /* Cannot be both MEM_Null and some other type */
70292
+ assert( (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob
70293
+ |MEM_RowSet|MEM_Frame|MEM_Agg|MEM_Zero))==0 );
70294
+
70295
+ /* If MEM_Null is set, then either the value is a pure NULL (the usual
70296
+ ** case) or it is a pointer set using sqlite3_bind_pointer() or
70297
+ ** sqlite3_result_pointer(). If a pointer, then MEM_Term must also be
70298
+ ** set.
70299
+ */
70300
+ if( (p->flags & (MEM_Term|MEM_Subtype))==(MEM_Term|MEM_Subtype) ){
70301
+ /* This is a pointer type. There may be a flag to indicate what to
70302
+ ** do with the pointer. */
70303
+ assert( ((p->flags&MEM_Dyn)!=0 ? 1 : 0) +
70304
+ ((p->flags&MEM_Ephem)!=0 ? 1 : 0) +
70305
+ ((p->flags&MEM_Static)!=0 ? 1 : 0) <= 1 );
70306
+
70307
+ /* No other bits set */
70308
+ assert( (p->flags & ~(MEM_Null|MEM_Term|MEM_Subtype
70309
+ |MEM_Dyn|MEM_Ephem|MEM_Static))==0 );
70310
+ }else{
70311
+ /* A pure NULL might have other flags, such as MEM_Static, MEM_Dyn,
70312
+ ** MEM_Ephem, MEM_Cleared, or MEM_Subtype */
70313
+ }
70314
+ }else{
70315
+ /* The MEM_Cleared bit is only allowed on NULLs */
70316
+ assert( (p->flags & MEM_Cleared)==0 );
70317
+ }
7028970318
7029070319
/* The szMalloc field holds the correct memory allocation size */
7029170320
assert( p->szMalloc==0
7029270321
|| p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc) );
7029370322
@@ -70946,22 +70975,29 @@
7094670975
pMem->u.i = val;
7094770976
pMem->flags = MEM_Int;
7094870977
}
7094970978
}
7095070979
70980
+/* A no-op destructor */
70981
+static void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
70982
+
7095170983
/*
7095270984
** Set the value stored in *pMem should already be a NULL.
7095370985
** Also store a pointer to go with it.
7095470986
*/
70955
-SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr, const char *zPType){
70987
+SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(
70988
+ Mem *pMem,
70989
+ void *pPtr,
70990
+ const char *zPType,
70991
+ void (*xDestructor)(void*)
70992
+){
7095670993
assert( pMem->flags==MEM_Null );
70957
- if( zPType ){
70958
- pMem->flags = MEM_Null|MEM_Subtype|MEM_Term|MEM_Static;
70959
- pMem->u.pPtr = pPtr;
70960
- pMem->eSubtype = 'p';
70961
- pMem->z = (char*)zPType;
70962
- }
70994
+ pMem->u.zPType = zPType ? zPType : "";
70995
+ pMem->z = pPtr;
70996
+ pMem->flags = MEM_Null|MEM_Dyn|MEM_Subtype|MEM_Term;
70997
+ pMem->eSubtype = 'p';
70998
+ pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor;
7096370999
}
7096471000
7096571001
#ifndef SQLITE_OMIT_FLOATING_POINT
7096671002
/*
7096771003
** Delete any previous value and set the value stored in *pMem to val,
@@ -76564,10 +76600,13 @@
7656476600
** throw an error if it is given inputs that would make it non-deterministic.
7656576601
** This routine is invoked by date/time functions that use non-deterministic
7656676602
** features such as 'now'.
7656776603
*/
7656876604
SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context *pCtx){
76605
+#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
76606
+ if( pCtx->pVdbe==0 ) return 1;
76607
+#endif
7656976608
if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
7657076609
sqlite3_result_error(pCtx,
7657176610
"non-deterministic function in index expression or CHECK constraint",
7657276611
-1);
7657376612
return 0;
@@ -76884,16 +76923,17 @@
7688476923
Mem *pMem = (Mem*)pVal;
7688576924
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
7688676925
}
7688776926
SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
7688876927
Mem *p = (Mem*)pVal;
76889
- if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)
76928
+ if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) ==
76929
+ (MEM_Null|MEM_Term|MEM_Subtype)
7689076930
&& zPType!=0
7689176931
&& p->eSubtype=='p'
76892
- && strcmp(p->z, zPType)==0
76932
+ && strcmp(p->u.zPType, zPType)==0
7689376933
){
76894
- return p->u.pPtr;
76934
+ return (void*)p->z;
7689576935
}else{
7689676936
return 0;
7689776937
}
7689876938
}
7689976939
SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
@@ -77072,15 +77112,20 @@
7707277112
}
7707377113
SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
7707477114
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7707577115
sqlite3VdbeMemSetNull(pCtx->pOut);
7707677116
}
77077
-SQLITE_API void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr, const char *zPT){
77117
+SQLITE_API void sqlite3_result_pointer(
77118
+ sqlite3_context *pCtx,
77119
+ void *pPtr,
77120
+ const char *zPType,
77121
+ void (*xDestructor)(void*)
77122
+){
7707877123
Mem *pOut = pCtx->pOut;
7707977124
assert( sqlite3_mutex_held(pOut->db->mutex) );
7708077125
sqlite3VdbeMemSetNull(pOut);
77081
- sqlite3VdbeMemSetPointer(pOut, pPtr, zPT);
77126
+ sqlite3VdbeMemSetPointer(pOut, pPtr, zPType, xDestructor);
7708277127
}
7708377128
SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
7708477129
Mem *pOut = pCtx->pOut;
7708577130
assert( sqlite3_mutex_held(pOut->db->mutex) );
7708677131
pOut->eSubtype = eSubtype & 0xff;
@@ -78081,17 +78126,25 @@
7808178126
if( rc==SQLITE_OK ){
7808278127
sqlite3_mutex_leave(p->db->mutex);
7808378128
}
7808478129
return rc;
7808578130
}
78086
-SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr,const char *zT){
78131
+SQLITE_API int sqlite3_bind_pointer(
78132
+ sqlite3_stmt *pStmt,
78133
+ int i,
78134
+ void *pPtr,
78135
+ const char *zPTtype,
78136
+ void (*xDestructor)(void*)
78137
+){
7808778138
int rc;
7808878139
Vdbe *p = (Vdbe*)pStmt;
7808978140
rc = vdbeUnbind(p, i);
7809078141
if( rc==SQLITE_OK ){
78091
- sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zT);
78142
+ sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zPTtype, xDestructor);
7809278143
sqlite3_mutex_leave(p->db->mutex);
78144
+ }else if( xDestructor ){
78145
+ xDestructor(pPtr);
7809378146
}
7809478147
return rc;
7809578148
}
7809678149
SQLITE_API int sqlite3_bind_text(
7809778150
sqlite3_stmt *pStmt,
@@ -112259,12 +112312,12 @@
112259112312
/* Version 3.20.0 and later */
112260112313
int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
112261112314
sqlite3_stmt**,const char**);
112262112315
int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
112263112316
sqlite3_stmt**,const void**);
112264
- int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*);
112265
- void (*result_pointer)(sqlite3_context*,void*,const char*);
112317
+ int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
112318
+ void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
112266112319
void *(*value_pointer)(sqlite3_value*,const char*);
112267112320
};
112268112321
112269112322
/*
112270112323
** This is the function signature used for all extension entry points. It
@@ -150347,11 +150400,11 @@
150347150400
assert( iCol>=0 && iCol<=p->nColumn+2 );
150348150401
150349150402
switch( iCol-p->nColumn ){
150350150403
case 0:
150351150404
/* The special 'table-name' column */
150352
- sqlite3_result_pointer(pCtx, pCsr, "fts3cursor");
150405
+ sqlite3_result_pointer(pCtx, pCsr, "fts3cursor", 0);
150353150406
break;
150354150407
150355150408
case 1:
150356150409
/* The docid column */
150357150410
sqlite3_result_int64(pCtx, pCsr->iPrevId);
@@ -165581,26 +165634,18 @@
165581165634
int (*xQueryFunc)(sqlite3_rtree_query_info*);
165582165635
void (*xDestructor)(void*);
165583165636
void *pContext;
165584165637
};
165585165638
165586
-
165587
-/*
165588
-** Value for the first field of every RtreeMatchArg object. The MATCH
165589
-** operator tests that the first field of a blob operand matches this
165590
-** value to avoid operating on invalid blobs (which could cause a segfault).
165591
-*/
165592
-#define RTREE_GEOMETRY_MAGIC 0x891245AB
165593
-
165594165639
/*
165595165640
** An instance of this structure (in the form of a BLOB) is returned by
165596165641
** the SQL functions that sqlite3_rtree_geometry_callback() and
165597165642
** sqlite3_rtree_query_callback() create, and is read as the right-hand
165598165643
** operand to the MATCH operator of an R-Tree.
165599165644
*/
165600165645
struct RtreeMatchArg {
165601
- u32 magic; /* Always RTREE_GEOMETRY_MAGIC */
165646
+ u32 iSize; /* Size of this object */
165602165647
RtreeGeomCallback cb; /* Info about the callback functions */
165603165648
int nParam; /* Number of parameters to the SQL function */
165604165649
sqlite3_value **apSqlParam; /* Original SQL parameter values */
165605165650
RtreeDValue aParam[1]; /* Values for parameters to the SQL function */
165606165651
};
@@ -166891,37 +166936,21 @@
166891166936
** as the second argument for a MATCH constraint. The value passed as the
166892166937
** first argument to this function is the right-hand operand to the MATCH
166893166938
** operator.
166894166939
*/
166895166940
static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
166896
- RtreeMatchArg *pBlob; /* BLOB returned by geometry function */
166941
+ RtreeMatchArg *pBlob, *pSrc; /* BLOB returned by geometry function */
166897166942
sqlite3_rtree_query_info *pInfo; /* Callback information */
166898
- int nBlob; /* Size of the geometry function blob */
166899
- int nExpected; /* Expected size of the BLOB */
166900
-
166901
- /* Check that value is actually a blob. */
166902
- if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR;
166903
-
166904
- /* Check that the blob is roughly the right size. */
166905
- nBlob = sqlite3_value_bytes(pValue);
166906
- if( nBlob<(int)sizeof(RtreeMatchArg) ){
166907
- return SQLITE_ERROR;
166908
- }
166909
-
166910
- pInfo = (sqlite3_rtree_query_info*)sqlite3_malloc( sizeof(*pInfo)+nBlob );
166943
+
166944
+ pSrc = sqlite3_value_pointer(pValue, "RtreeMatchArg");
166945
+ if( pSrc==0 ) return SQLITE_ERROR;
166946
+ pInfo = (sqlite3_rtree_query_info*)
166947
+ sqlite3_malloc64( sizeof(*pInfo)+pSrc->iSize );
166911166948
if( !pInfo ) return SQLITE_NOMEM;
166912166949
memset(pInfo, 0, sizeof(*pInfo));
166913166950
pBlob = (RtreeMatchArg*)&pInfo[1];
166914
-
166915
- memcpy(pBlob, sqlite3_value_blob(pValue), nBlob);
166916
- nExpected = (int)(sizeof(RtreeMatchArg) +
166917
- pBlob->nParam*sizeof(sqlite3_value*) +
166918
- (pBlob->nParam-1)*sizeof(RtreeDValue));
166919
- if( pBlob->magic!=RTREE_GEOMETRY_MAGIC || nBlob!=nExpected ){
166920
- sqlite3_free(pInfo);
166921
- return SQLITE_ERROR;
166922
- }
166951
+ memcpy(pBlob, pSrc, pSrc->iSize);
166923166952
pInfo->pContext = pBlob->cb.pContext;
166924166953
pInfo->nParam = pBlob->nParam;
166925166954
pInfo->aParam = pBlob->aParam;
166926166955
pInfo->apSqlParam = pBlob->apSqlParam;
166927166956
@@ -168955,11 +168984,11 @@
168955168984
pBlob = (RtreeMatchArg *)sqlite3_malloc(nBlob);
168956168985
if( !pBlob ){
168957168986
sqlite3_result_error_nomem(ctx);
168958168987
}else{
168959168988
int i;
168960
- pBlob->magic = RTREE_GEOMETRY_MAGIC;
168989
+ pBlob->iSize = nBlob;
168961168990
pBlob->cb = pGeomCtx[0];
168962168991
pBlob->apSqlParam = (sqlite3_value**)&pBlob->aParam[nArg];
168963168992
pBlob->nParam = nArg;
168964168993
for(i=0; i<nArg; i++){
168965168994
pBlob->apSqlParam[i] = sqlite3_value_dup(aArg[i]);
@@ -168972,11 +169001,11 @@
168972169001
}
168973169002
if( memErr ){
168974169003
sqlite3_result_error_nomem(ctx);
168975169004
rtreeMatchArgFree(pBlob);
168976169005
}else{
168977
- sqlite3_result_blob(ctx, pBlob, nBlob, rtreeMatchArgFree);
169006
+ sqlite3_result_pointer(ctx, pBlob, "RtreeMatchArg", rtreeMatchArgFree);
168978169007
}
168979169008
}
168980169009
}
168981169010
168982169011
/*
@@ -200285,11 +200314,11 @@
200285200314
int nArg, /* Number of args */
200286200315
sqlite3_value **apUnused /* Function arguments */
200287200316
){
200288200317
assert( nArg==0 );
200289200318
UNUSED_PARAM2(nArg, apUnused);
200290
- sqlite3_result_text(pCtx, "fts5: 2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51", -1, SQLITE_TRANSIENT);
200319
+ sqlite3_result_text(pCtx, "fts5: 2017-07-27 18:43:13 2dfcd9a8ecdf0ddd8e044d820639830c6171141c588cf0224255af85c64cf79c", -1, SQLITE_TRANSIENT);
200291200320
}
200292200321
200293200322
static int fts5Init(sqlite3 *db){
200294200323
static const sqlite3_module fts5Mod = {
200295200324
/* iVersion */ 2,
200296200325
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1150,11 +1150,11 @@
1150 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1151 ** [sqlite_version()] and [sqlite_source_id()].
1152 */
1153 #define SQLITE_VERSION "3.20.0"
1154 #define SQLITE_VERSION_NUMBER 3020000
1155 #define SQLITE_SOURCE_ID "2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51"
1156
1157 /*
1158 ** CAPI3REF: Run-Time Library Version Numbers
1159 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1160 **
@@ -4910,18 +4910,18 @@
4910 ** Zeroblobs are intended to serve as placeholders for BLOBs whose
4911 ** content is later written using
4912 ** [sqlite3_blob_open | incremental BLOB I/O] routines.
4913 ** ^A negative value for the zeroblob results in a zero-length BLOB.
4914 **
4915 ** ^The sqlite3_bind_pointer(S,I,P,T) routine causes the I-th parameter in
4916 ** [prepared statement] S to have an SQL value of NULL, but to also be
4917 ** associated with the pointer P of type T.
4918 ** ^The sqlite3_bind_pointer() routine can be used to pass
4919 ** host-language pointers into [application-defined SQL functions].
4920 ** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
4921 ** to be an ordinary SQL NULL value to everything other than
4922 ** [sqlite3_value_pointer()]. The T parameter should be a static string.
4923 **
4924 ** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
4925 ** for the [prepared statement] or with a prepared statement for which
4926 ** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
4927 ** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -4952,11 +4952,11 @@
4952 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4953 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4954 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4955 void(*)(void*), unsigned char encoding);
4956 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4957 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*);
4958 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4959 SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4960
4961 /*
4962 ** CAPI3REF: Number Of SQL Parameters
@@ -5785,14 +5785,15 @@
5785 ** in the native byte-order of the host machine. ^The
5786 ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
5787 ** extract UTF-16 strings as big-endian and little-endian respectively.
5788 **
5789 ** ^If [sqlite3_value] object V was initialized
5790 ** using [sqlite3_bind_pointer(S,I,P,X)] or [sqlite3_result_pointer(C,P,X)]
5791 ** and if X and Y are strings that compare equal according to strcmp(X,Y),
5792 ** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
5793 ** sqlite3_value_pointer(V,Y) returns a NULL.
 
5794 **
5795 ** ^(The sqlite3_value_type(V) interface returns the
5796 ** [SQLITE_INTEGER | datatype code] for the initial datatype of the
5797 ** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
5798 ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -6123,18 +6124,20 @@
6123 ** be deallocated after sqlite3_result_value() returns without harm.
6124 ** ^A [protected sqlite3_value] object may always be used where an
6125 ** [unprotected sqlite3_value] object is required, so either
6126 ** kind of [sqlite3_value] object can be used with this interface.
6127 **
6128 ** ^The sqlite3_result_pointer(C,P,T) interface sets the result to an
6129 ** SQL NULL value, just like [sqlite3_result_null(C)], except that it
6130 ** also associates the host-language pointer P or type T with that
6131 ** NULL value such that the pointer can be retrieved within an
6132 ** [application-defined SQL function] using [sqlite3_value_pointer()].
6133 ** The T parameter should be a static string.
6134 ** This mechanism can be used to pass non-SQL values between
6135 ** application-defined functions.
 
 
6136 **
6137 ** If these routines are called from within the different thread
6138 ** than the one containing the application-defined function that received
6139 ** the [sqlite3_context] pointer, the results are undefined.
6140 */
@@ -6155,11 +6158,11 @@
6155 void(*)(void*), unsigned char encoding);
6156 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
6157 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
6158 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
6159 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
6160 SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*, const char*);
6161 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
6162 SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
6163
6164
6165 /*
@@ -15397,11 +15400,11 @@
15397 #define DFUNCTION(zName, nArg, iArg, bNC, xFunc) \
15398 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8, \
15399 0, 0, xFunc, 0, #zName, {0} }
15400 #define PURE_DATE(zName, nArg, iArg, bNC, xFunc) \
15401 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
15402 (void*)xFunc, 0, xFunc, 0, #zName, {0} }
15403 #define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
15404 {nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
15405 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, #zName, {0} }
15406 #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
15407 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
@@ -18645,12 +18648,12 @@
18645 */
18646 struct sqlite3_value {
18647 union MemValue {
18648 double r; /* Real value used when MEM_Real is set in flags */
18649 i64 i; /* Integer value used when MEM_Int is set in flags */
18650 int nZero; /* Used when bit MEM_Zero is set in flags */
18651 void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
18652 FuncDef *pDef; /* Used only when flags==MEM_Agg */
18653 RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
18654 VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
18655 } u;
18656 u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
@@ -18678,37 +18681,38 @@
18678
18679 /* One or more of the following flags are set to indicate the validOK
18680 ** representations of the value stored in the Mem struct.
18681 **
18682 ** If the MEM_Null flag is set, then the value is an SQL NULL value.
18683 ** No other flags may be set in this case.
 
18684 **
18685 ** If the MEM_Str flag is set then Mem.z points at a string representation.
18686 ** Usually this is encoded in the same unicode encoding as the main
18687 ** database (see below for exceptions). If the MEM_Term flag is also
18688 ** set, then the string is nul terminated. The MEM_Int and MEM_Real
18689 ** flags may coexist with the MEM_Str flag.
18690 */
18691 #define MEM_Null 0x0001 /* Value is NULL */
18692 #define MEM_Str 0x0002 /* Value is a string */
18693 #define MEM_Int 0x0004 /* Value is an integer */
18694 #define MEM_Real 0x0008 /* Value is a real number */
18695 #define MEM_Blob 0x0010 /* Value is a BLOB */
18696 #define MEM_AffMask 0x001f /* Mask of affinity bits */
18697 #define MEM_RowSet 0x0020 /* Value is a RowSet object */
18698 #define MEM_Frame 0x0040 /* Value is a VdbeFrame object */
18699 #define MEM_Undefined 0x0080 /* Value is undefined */
18700 #define MEM_Cleared 0x0100 /* NULL set by OP_Null, not from data */
18701 #define MEM_TypeMask 0x81ff /* Mask of type bits */
18702
18703
18704 /* Whenever Mem contains a valid string or blob representation, one of
18705 ** the following flags must be set to determine the memory management
18706 ** policy for Mem.z. The MEM_Term flag tells us whether or not the
18707 ** string is \000 or \u0000 terminated
18708 */
18709 #define MEM_Term 0x0200 /* String rep is nul terminated */
18710 #define MEM_Dyn 0x0400 /* Need to call Mem.xDel() on Mem.z */
18711 #define MEM_Static 0x0800 /* Mem.z points to a static string */
18712 #define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
18713 #define MEM_Agg 0x2000 /* Mem.z points to an agg function context */
18714 #define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */
@@ -18932,11 +18936,11 @@
18932 #ifdef SQLITE_OMIT_FLOATING_POINT
18933 # define sqlite3VdbeMemSetDouble sqlite3VdbeMemSetInt64
18934 #else
18935 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
18936 #endif
18937 SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*);
18938 SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
18939 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
18940 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
18941 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*);
18942 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
@@ -70268,11 +70272,11 @@
70268 ** This routine is intended for use inside of assert() statements, like
70269 ** this: assert( sqlite3VdbeCheckMemInvariants(pMem) );
70270 */
70271 SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){
70272 /* If MEM_Dyn is set then Mem.xDel!=0.
70273 ** Mem.xDel is might not be initialized if MEM_Dyn is clear.
70274 */
70275 assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 );
70276
70277 /* MEM_Dyn may only be set if Mem.szMalloc==0. In this way we
70278 ** ensure that if Mem.szMalloc>0 then it is safe to do
@@ -70281,13 +70285,38 @@
70281 assert( (p->flags & MEM_Dyn)==0 || p->szMalloc==0 );
70282
70283 /* Cannot be both MEM_Int and MEM_Real at the same time */
70284 assert( (p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) );
70285
70286 /* Cannot be both MEM_Null and some other type */
70287 assert( (p->flags & MEM_Null)==0 ||
70288 (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70289
70290 /* The szMalloc field holds the correct memory allocation size */
70291 assert( p->szMalloc==0
70292 || p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc) );
70293
@@ -70946,22 +70975,29 @@
70946 pMem->u.i = val;
70947 pMem->flags = MEM_Int;
70948 }
70949 }
70950
 
 
 
70951 /*
70952 ** Set the value stored in *pMem should already be a NULL.
70953 ** Also store a pointer to go with it.
70954 */
70955 SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr, const char *zPType){
 
 
 
 
 
70956 assert( pMem->flags==MEM_Null );
70957 if( zPType ){
70958 pMem->flags = MEM_Null|MEM_Subtype|MEM_Term|MEM_Static;
70959 pMem->u.pPtr = pPtr;
70960 pMem->eSubtype = 'p';
70961 pMem->z = (char*)zPType;
70962 }
70963 }
70964
70965 #ifndef SQLITE_OMIT_FLOATING_POINT
70966 /*
70967 ** Delete any previous value and set the value stored in *pMem to val,
@@ -76564,10 +76600,13 @@
76564 ** throw an error if it is given inputs that would make it non-deterministic.
76565 ** This routine is invoked by date/time functions that use non-deterministic
76566 ** features such as 'now'.
76567 */
76568 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context *pCtx){
 
 
 
76569 if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
76570 sqlite3_result_error(pCtx,
76571 "non-deterministic function in index expression or CHECK constraint",
76572 -1);
76573 return 0;
@@ -76884,16 +76923,17 @@
76884 Mem *pMem = (Mem*)pVal;
76885 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
76886 }
76887 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
76888 Mem *p = (Mem*)pVal;
76889 if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)
 
76890 && zPType!=0
76891 && p->eSubtype=='p'
76892 && strcmp(p->z, zPType)==0
76893 ){
76894 return p->u.pPtr;
76895 }else{
76896 return 0;
76897 }
76898 }
76899 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
@@ -77072,15 +77112,20 @@
77072 }
77073 SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
77074 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
77075 sqlite3VdbeMemSetNull(pCtx->pOut);
77076 }
77077 SQLITE_API void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr, const char *zPT){
 
 
 
 
 
77078 Mem *pOut = pCtx->pOut;
77079 assert( sqlite3_mutex_held(pOut->db->mutex) );
77080 sqlite3VdbeMemSetNull(pOut);
77081 sqlite3VdbeMemSetPointer(pOut, pPtr, zPT);
77082 }
77083 SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
77084 Mem *pOut = pCtx->pOut;
77085 assert( sqlite3_mutex_held(pOut->db->mutex) );
77086 pOut->eSubtype = eSubtype & 0xff;
@@ -78081,17 +78126,25 @@
78081 if( rc==SQLITE_OK ){
78082 sqlite3_mutex_leave(p->db->mutex);
78083 }
78084 return rc;
78085 }
78086 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr,const char *zT){
 
 
 
 
 
 
78087 int rc;
78088 Vdbe *p = (Vdbe*)pStmt;
78089 rc = vdbeUnbind(p, i);
78090 if( rc==SQLITE_OK ){
78091 sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zT);
78092 sqlite3_mutex_leave(p->db->mutex);
 
 
78093 }
78094 return rc;
78095 }
78096 SQLITE_API int sqlite3_bind_text(
78097 sqlite3_stmt *pStmt,
@@ -112259,12 +112312,12 @@
112259 /* Version 3.20.0 and later */
112260 int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
112261 sqlite3_stmt**,const char**);
112262 int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
112263 sqlite3_stmt**,const void**);
112264 int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*);
112265 void (*result_pointer)(sqlite3_context*,void*,const char*);
112266 void *(*value_pointer)(sqlite3_value*,const char*);
112267 };
112268
112269 /*
112270 ** This is the function signature used for all extension entry points. It
@@ -150347,11 +150400,11 @@
150347 assert( iCol>=0 && iCol<=p->nColumn+2 );
150348
150349 switch( iCol-p->nColumn ){
150350 case 0:
150351 /* The special 'table-name' column */
150352 sqlite3_result_pointer(pCtx, pCsr, "fts3cursor");
150353 break;
150354
150355 case 1:
150356 /* The docid column */
150357 sqlite3_result_int64(pCtx, pCsr->iPrevId);
@@ -165581,26 +165634,18 @@
165581 int (*xQueryFunc)(sqlite3_rtree_query_info*);
165582 void (*xDestructor)(void*);
165583 void *pContext;
165584 };
165585
165586
165587 /*
165588 ** Value for the first field of every RtreeMatchArg object. The MATCH
165589 ** operator tests that the first field of a blob operand matches this
165590 ** value to avoid operating on invalid blobs (which could cause a segfault).
165591 */
165592 #define RTREE_GEOMETRY_MAGIC 0x891245AB
165593
165594 /*
165595 ** An instance of this structure (in the form of a BLOB) is returned by
165596 ** the SQL functions that sqlite3_rtree_geometry_callback() and
165597 ** sqlite3_rtree_query_callback() create, and is read as the right-hand
165598 ** operand to the MATCH operator of an R-Tree.
165599 */
165600 struct RtreeMatchArg {
165601 u32 magic; /* Always RTREE_GEOMETRY_MAGIC */
165602 RtreeGeomCallback cb; /* Info about the callback functions */
165603 int nParam; /* Number of parameters to the SQL function */
165604 sqlite3_value **apSqlParam; /* Original SQL parameter values */
165605 RtreeDValue aParam[1]; /* Values for parameters to the SQL function */
165606 };
@@ -166891,37 +166936,21 @@
166891 ** as the second argument for a MATCH constraint. The value passed as the
166892 ** first argument to this function is the right-hand operand to the MATCH
166893 ** operator.
166894 */
166895 static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
166896 RtreeMatchArg *pBlob; /* BLOB returned by geometry function */
166897 sqlite3_rtree_query_info *pInfo; /* Callback information */
166898 int nBlob; /* Size of the geometry function blob */
166899 int nExpected; /* Expected size of the BLOB */
166900
166901 /* Check that value is actually a blob. */
166902 if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR;
166903
166904 /* Check that the blob is roughly the right size. */
166905 nBlob = sqlite3_value_bytes(pValue);
166906 if( nBlob<(int)sizeof(RtreeMatchArg) ){
166907 return SQLITE_ERROR;
166908 }
166909
166910 pInfo = (sqlite3_rtree_query_info*)sqlite3_malloc( sizeof(*pInfo)+nBlob );
166911 if( !pInfo ) return SQLITE_NOMEM;
166912 memset(pInfo, 0, sizeof(*pInfo));
166913 pBlob = (RtreeMatchArg*)&pInfo[1];
166914
166915 memcpy(pBlob, sqlite3_value_blob(pValue), nBlob);
166916 nExpected = (int)(sizeof(RtreeMatchArg) +
166917 pBlob->nParam*sizeof(sqlite3_value*) +
166918 (pBlob->nParam-1)*sizeof(RtreeDValue));
166919 if( pBlob->magic!=RTREE_GEOMETRY_MAGIC || nBlob!=nExpected ){
166920 sqlite3_free(pInfo);
166921 return SQLITE_ERROR;
166922 }
166923 pInfo->pContext = pBlob->cb.pContext;
166924 pInfo->nParam = pBlob->nParam;
166925 pInfo->aParam = pBlob->aParam;
166926 pInfo->apSqlParam = pBlob->apSqlParam;
166927
@@ -168955,11 +168984,11 @@
168955 pBlob = (RtreeMatchArg *)sqlite3_malloc(nBlob);
168956 if( !pBlob ){
168957 sqlite3_result_error_nomem(ctx);
168958 }else{
168959 int i;
168960 pBlob->magic = RTREE_GEOMETRY_MAGIC;
168961 pBlob->cb = pGeomCtx[0];
168962 pBlob->apSqlParam = (sqlite3_value**)&pBlob->aParam[nArg];
168963 pBlob->nParam = nArg;
168964 for(i=0; i<nArg; i++){
168965 pBlob->apSqlParam[i] = sqlite3_value_dup(aArg[i]);
@@ -168972,11 +169001,11 @@
168972 }
168973 if( memErr ){
168974 sqlite3_result_error_nomem(ctx);
168975 rtreeMatchArgFree(pBlob);
168976 }else{
168977 sqlite3_result_blob(ctx, pBlob, nBlob, rtreeMatchArgFree);
168978 }
168979 }
168980 }
168981
168982 /*
@@ -200285,11 +200314,11 @@
200285 int nArg, /* Number of args */
200286 sqlite3_value **apUnused /* Function arguments */
200287 ){
200288 assert( nArg==0 );
200289 UNUSED_PARAM2(nArg, apUnused);
200290 sqlite3_result_text(pCtx, "fts5: 2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51", -1, SQLITE_TRANSIENT);
200291 }
200292
200293 static int fts5Init(sqlite3 *db){
200294 static const sqlite3_module fts5Mod = {
200295 /* iVersion */ 2,
200296
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1150,11 +1150,11 @@
1150 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1151 ** [sqlite_version()] and [sqlite_source_id()].
1152 */
1153 #define SQLITE_VERSION "3.20.0"
1154 #define SQLITE_VERSION_NUMBER 3020000
1155 #define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9"
1156
1157 /*
1158 ** CAPI3REF: Run-Time Library Version Numbers
1159 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1160 **
@@ -4910,18 +4910,18 @@
4910 ** Zeroblobs are intended to serve as placeholders for BLOBs whose
4911 ** content is later written using
4912 ** [sqlite3_blob_open | incremental BLOB I/O] routines.
4913 ** ^A negative value for the zeroblob results in a zero-length BLOB.
4914 **
4915 ** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
4916 ** [prepared statement] S to have an SQL value of NULL, but to also be
4917 ** associated with the pointer P of type T. ^D is either a NULL pointer or
4918 ** a pointer to a destructor function for P. ^SQLite will invoke the
4919 ** destructor D with a single argument of P when it is finished using
4920 ** P. The T parameter should be a static string, preferably a string
4921 ** literal. The sqlite3_bind_pointer() routine is part of the
4922 ** [pointer passing interface] added for SQLite 3.20.0.
4923 **
4924 ** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
4925 ** for the [prepared statement] or with a prepared statement for which
4926 ** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
4927 ** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -4952,11 +4952,11 @@
4952 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4953 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4954 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4955 void(*)(void*), unsigned char encoding);
4956 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4957 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
4958 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4959 SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4960
4961 /*
4962 ** CAPI3REF: Number Of SQL Parameters
@@ -5785,14 +5785,15 @@
5785 ** in the native byte-order of the host machine. ^The
5786 ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
5787 ** extract UTF-16 strings as big-endian and little-endian respectively.
5788 **
5789 ** ^If [sqlite3_value] object V was initialized
5790 ** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
5791 ** and if X and Y are strings that compare equal according to strcmp(X,Y),
5792 ** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
5793 ** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer()
5794 ** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
5795 **
5796 ** ^(The sqlite3_value_type(V) interface returns the
5797 ** [SQLITE_INTEGER | datatype code] for the initial datatype of the
5798 ** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
5799 ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -6123,18 +6124,20 @@
6124 ** be deallocated after sqlite3_result_value() returns without harm.
6125 ** ^A [protected sqlite3_value] object may always be used where an
6126 ** [unprotected sqlite3_value] object is required, so either
6127 ** kind of [sqlite3_value] object can be used with this interface.
6128 **
6129 ** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
6130 ** SQL NULL value, just like [sqlite3_result_null(C)], except that it
6131 ** also associates the host-language pointer P or type T with that
6132 ** NULL value such that the pointer can be retrieved within an
6133 ** [application-defined SQL function] using [sqlite3_value_pointer()].
6134 ** ^If the D parameter is not NULL, then it is a pointer to a destructor
6135 ** for the P parameter. ^SQLite invokes D with P as its only argument
6136 ** when SQLite is finished with P. The T parameter should be a static
6137 ** string and preferably a string literal. The sqlite3_result_pointer()
6138 ** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
6139 **
6140 ** If these routines are called from within the different thread
6141 ** than the one containing the application-defined function that received
6142 ** the [sqlite3_context] pointer, the results are undefined.
6143 */
@@ -6155,11 +6158,11 @@
6158 void(*)(void*), unsigned char encoding);
6159 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
6160 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
6161 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
6162 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
6163 SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
6164 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
6165 SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
6166
6167
6168 /*
@@ -15397,11 +15400,11 @@
15400 #define DFUNCTION(zName, nArg, iArg, bNC, xFunc) \
15401 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8, \
15402 0, 0, xFunc, 0, #zName, {0} }
15403 #define PURE_DATE(zName, nArg, iArg, bNC, xFunc) \
15404 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
15405 (void*)&sqlite3Config, 0, xFunc, 0, #zName, {0} }
15406 #define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
15407 {nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
15408 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, #zName, {0} }
15409 #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
15410 {nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
@@ -18645,12 +18648,12 @@
18648 */
18649 struct sqlite3_value {
18650 union MemValue {
18651 double r; /* Real value used when MEM_Real is set in flags */
18652 i64 i; /* Integer value used when MEM_Int is set in flags */
18653 int nZero; /* Extra zero bytes when MEM_Zero and MEM_Blob set */
18654 const char *zPType; /* Pointer type when MEM_Term|MEM_Subtype|MEM_Null */
18655 FuncDef *pDef; /* Used only when flags==MEM_Agg */
18656 RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
18657 VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
18658 } u;
18659 u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
@@ -18678,37 +18681,38 @@
18681
18682 /* One or more of the following flags are set to indicate the validOK
18683 ** representations of the value stored in the Mem struct.
18684 **
18685 ** If the MEM_Null flag is set, then the value is an SQL NULL value.
18686 ** For a pointer type created using sqlite3_bind_pointer() or
18687 ** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set.
18688 **
18689 ** If the MEM_Str flag is set then Mem.z points at a string representation.
18690 ** Usually this is encoded in the same unicode encoding as the main
18691 ** database (see below for exceptions). If the MEM_Term flag is also
18692 ** set, then the string is nul terminated. The MEM_Int and MEM_Real
18693 ** flags may coexist with the MEM_Str flag.
18694 */
18695 #define MEM_Null 0x0001 /* Value is NULL (or a pointer) */
18696 #define MEM_Str 0x0002 /* Value is a string */
18697 #define MEM_Int 0x0004 /* Value is an integer */
18698 #define MEM_Real 0x0008 /* Value is a real number */
18699 #define MEM_Blob 0x0010 /* Value is a BLOB */
18700 #define MEM_AffMask 0x001f /* Mask of affinity bits */
18701 #define MEM_RowSet 0x0020 /* Value is a RowSet object */
18702 #define MEM_Frame 0x0040 /* Value is a VdbeFrame object */
18703 #define MEM_Undefined 0x0080 /* Value is undefined */
18704 #define MEM_Cleared 0x0100 /* NULL set by OP_Null, not from data */
18705 #define MEM_TypeMask 0xc1ff /* Mask of type bits */
18706
18707
18708 /* Whenever Mem contains a valid string or blob representation, one of
18709 ** the following flags must be set to determine the memory management
18710 ** policy for Mem.z. The MEM_Term flag tells us whether or not the
18711 ** string is \000 or \u0000 terminated
18712 */
18713 #define MEM_Term 0x0200 /* String in Mem.z is zero terminated */
18714 #define MEM_Dyn 0x0400 /* Need to call Mem.xDel() on Mem.z */
18715 #define MEM_Static 0x0800 /* Mem.z points to a static string */
18716 #define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
18717 #define MEM_Agg 0x2000 /* Mem.z points to an agg function context */
18718 #define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */
@@ -18932,11 +18936,11 @@
18936 #ifdef SQLITE_OMIT_FLOATING_POINT
18937 # define sqlite3VdbeMemSetDouble sqlite3VdbeMemSetInt64
18938 #else
18939 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
18940 #endif
18941 SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*, void(*)(void*));
18942 SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
18943 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
18944 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
18945 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*);
18946 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
@@ -70268,11 +70272,11 @@
70272 ** This routine is intended for use inside of assert() statements, like
70273 ** this: assert( sqlite3VdbeCheckMemInvariants(pMem) );
70274 */
70275 SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){
70276 /* If MEM_Dyn is set then Mem.xDel!=0.
70277 ** Mem.xDel might not be initialized if MEM_Dyn is clear.
70278 */
70279 assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 );
70280
70281 /* MEM_Dyn may only be set if Mem.szMalloc==0. In this way we
70282 ** ensure that if Mem.szMalloc>0 then it is safe to do
@@ -70281,13 +70285,38 @@
70285 assert( (p->flags & MEM_Dyn)==0 || p->szMalloc==0 );
70286
70287 /* Cannot be both MEM_Int and MEM_Real at the same time */
70288 assert( (p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) );
70289
70290 if( p->flags & MEM_Null ){
70291 /* Cannot be both MEM_Null and some other type */
70292 assert( (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob
70293 |MEM_RowSet|MEM_Frame|MEM_Agg|MEM_Zero))==0 );
70294
70295 /* If MEM_Null is set, then either the value is a pure NULL (the usual
70296 ** case) or it is a pointer set using sqlite3_bind_pointer() or
70297 ** sqlite3_result_pointer(). If a pointer, then MEM_Term must also be
70298 ** set.
70299 */
70300 if( (p->flags & (MEM_Term|MEM_Subtype))==(MEM_Term|MEM_Subtype) ){
70301 /* This is a pointer type. There may be a flag to indicate what to
70302 ** do with the pointer. */
70303 assert( ((p->flags&MEM_Dyn)!=0 ? 1 : 0) +
70304 ((p->flags&MEM_Ephem)!=0 ? 1 : 0) +
70305 ((p->flags&MEM_Static)!=0 ? 1 : 0) <= 1 );
70306
70307 /* No other bits set */
70308 assert( (p->flags & ~(MEM_Null|MEM_Term|MEM_Subtype
70309 |MEM_Dyn|MEM_Ephem|MEM_Static))==0 );
70310 }else{
70311 /* A pure NULL might have other flags, such as MEM_Static, MEM_Dyn,
70312 ** MEM_Ephem, MEM_Cleared, or MEM_Subtype */
70313 }
70314 }else{
70315 /* The MEM_Cleared bit is only allowed on NULLs */
70316 assert( (p->flags & MEM_Cleared)==0 );
70317 }
70318
70319 /* The szMalloc field holds the correct memory allocation size */
70320 assert( p->szMalloc==0
70321 || p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc) );
70322
@@ -70946,22 +70975,29 @@
70975 pMem->u.i = val;
70976 pMem->flags = MEM_Int;
70977 }
70978 }
70979
70980 /* A no-op destructor */
70981 static void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
70982
70983 /*
70984 ** Set the value stored in *pMem should already be a NULL.
70985 ** Also store a pointer to go with it.
70986 */
70987 SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(
70988 Mem *pMem,
70989 void *pPtr,
70990 const char *zPType,
70991 void (*xDestructor)(void*)
70992 ){
70993 assert( pMem->flags==MEM_Null );
70994 pMem->u.zPType = zPType ? zPType : "";
70995 pMem->z = pPtr;
70996 pMem->flags = MEM_Null|MEM_Dyn|MEM_Subtype|MEM_Term;
70997 pMem->eSubtype = 'p';
70998 pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor;
 
70999 }
71000
71001 #ifndef SQLITE_OMIT_FLOATING_POINT
71002 /*
71003 ** Delete any previous value and set the value stored in *pMem to val,
@@ -76564,10 +76600,13 @@
76600 ** throw an error if it is given inputs that would make it non-deterministic.
76601 ** This routine is invoked by date/time functions that use non-deterministic
76602 ** features such as 'now'.
76603 */
76604 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context *pCtx){
76605 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
76606 if( pCtx->pVdbe==0 ) return 1;
76607 #endif
76608 if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
76609 sqlite3_result_error(pCtx,
76610 "non-deterministic function in index expression or CHECK constraint",
76611 -1);
76612 return 0;
@@ -76884,16 +76923,17 @@
76923 Mem *pMem = (Mem*)pVal;
76924 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
76925 }
76926 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
76927 Mem *p = (Mem*)pVal;
76928 if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) ==
76929 (MEM_Null|MEM_Term|MEM_Subtype)
76930 && zPType!=0
76931 && p->eSubtype=='p'
76932 && strcmp(p->u.zPType, zPType)==0
76933 ){
76934 return (void*)p->z;
76935 }else{
76936 return 0;
76937 }
76938 }
76939 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
@@ -77072,15 +77112,20 @@
77112 }
77113 SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
77114 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
77115 sqlite3VdbeMemSetNull(pCtx->pOut);
77116 }
77117 SQLITE_API void sqlite3_result_pointer(
77118 sqlite3_context *pCtx,
77119 void *pPtr,
77120 const char *zPType,
77121 void (*xDestructor)(void*)
77122 ){
77123 Mem *pOut = pCtx->pOut;
77124 assert( sqlite3_mutex_held(pOut->db->mutex) );
77125 sqlite3VdbeMemSetNull(pOut);
77126 sqlite3VdbeMemSetPointer(pOut, pPtr, zPType, xDestructor);
77127 }
77128 SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
77129 Mem *pOut = pCtx->pOut;
77130 assert( sqlite3_mutex_held(pOut->db->mutex) );
77131 pOut->eSubtype = eSubtype & 0xff;
@@ -78081,17 +78126,25 @@
78126 if( rc==SQLITE_OK ){
78127 sqlite3_mutex_leave(p->db->mutex);
78128 }
78129 return rc;
78130 }
78131 SQLITE_API int sqlite3_bind_pointer(
78132 sqlite3_stmt *pStmt,
78133 int i,
78134 void *pPtr,
78135 const char *zPTtype,
78136 void (*xDestructor)(void*)
78137 ){
78138 int rc;
78139 Vdbe *p = (Vdbe*)pStmt;
78140 rc = vdbeUnbind(p, i);
78141 if( rc==SQLITE_OK ){
78142 sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zPTtype, xDestructor);
78143 sqlite3_mutex_leave(p->db->mutex);
78144 }else if( xDestructor ){
78145 xDestructor(pPtr);
78146 }
78147 return rc;
78148 }
78149 SQLITE_API int sqlite3_bind_text(
78150 sqlite3_stmt *pStmt,
@@ -112259,12 +112312,12 @@
112312 /* Version 3.20.0 and later */
112313 int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
112314 sqlite3_stmt**,const char**);
112315 int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
112316 sqlite3_stmt**,const void**);
112317 int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
112318 void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
112319 void *(*value_pointer)(sqlite3_value*,const char*);
112320 };
112321
112322 /*
112323 ** This is the function signature used for all extension entry points. It
@@ -150347,11 +150400,11 @@
150400 assert( iCol>=0 && iCol<=p->nColumn+2 );
150401
150402 switch( iCol-p->nColumn ){
150403 case 0:
150404 /* The special 'table-name' column */
150405 sqlite3_result_pointer(pCtx, pCsr, "fts3cursor", 0);
150406 break;
150407
150408 case 1:
150409 /* The docid column */
150410 sqlite3_result_int64(pCtx, pCsr->iPrevId);
@@ -165581,26 +165634,18 @@
165634 int (*xQueryFunc)(sqlite3_rtree_query_info*);
165635 void (*xDestructor)(void*);
165636 void *pContext;
165637 };
165638
 
 
 
 
 
 
 
 
165639 /*
165640 ** An instance of this structure (in the form of a BLOB) is returned by
165641 ** the SQL functions that sqlite3_rtree_geometry_callback() and
165642 ** sqlite3_rtree_query_callback() create, and is read as the right-hand
165643 ** operand to the MATCH operator of an R-Tree.
165644 */
165645 struct RtreeMatchArg {
165646 u32 iSize; /* Size of this object */
165647 RtreeGeomCallback cb; /* Info about the callback functions */
165648 int nParam; /* Number of parameters to the SQL function */
165649 sqlite3_value **apSqlParam; /* Original SQL parameter values */
165650 RtreeDValue aParam[1]; /* Values for parameters to the SQL function */
165651 };
@@ -166891,37 +166936,21 @@
166936 ** as the second argument for a MATCH constraint. The value passed as the
166937 ** first argument to this function is the right-hand operand to the MATCH
166938 ** operator.
166939 */
166940 static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
166941 RtreeMatchArg *pBlob, *pSrc; /* BLOB returned by geometry function */
166942 sqlite3_rtree_query_info *pInfo; /* Callback information */
166943
166944 pSrc = sqlite3_value_pointer(pValue, "RtreeMatchArg");
166945 if( pSrc==0 ) return SQLITE_ERROR;
166946 pInfo = (sqlite3_rtree_query_info*)
166947 sqlite3_malloc64( sizeof(*pInfo)+pSrc->iSize );
 
 
 
 
 
 
 
 
166948 if( !pInfo ) return SQLITE_NOMEM;
166949 memset(pInfo, 0, sizeof(*pInfo));
166950 pBlob = (RtreeMatchArg*)&pInfo[1];
166951 memcpy(pBlob, pSrc, pSrc->iSize);
 
 
 
 
 
 
 
 
166952 pInfo->pContext = pBlob->cb.pContext;
166953 pInfo->nParam = pBlob->nParam;
166954 pInfo->aParam = pBlob->aParam;
166955 pInfo->apSqlParam = pBlob->apSqlParam;
166956
@@ -168955,11 +168984,11 @@
168984 pBlob = (RtreeMatchArg *)sqlite3_malloc(nBlob);
168985 if( !pBlob ){
168986 sqlite3_result_error_nomem(ctx);
168987 }else{
168988 int i;
168989 pBlob->iSize = nBlob;
168990 pBlob->cb = pGeomCtx[0];
168991 pBlob->apSqlParam = (sqlite3_value**)&pBlob->aParam[nArg];
168992 pBlob->nParam = nArg;
168993 for(i=0; i<nArg; i++){
168994 pBlob->apSqlParam[i] = sqlite3_value_dup(aArg[i]);
@@ -168972,11 +169001,11 @@
169001 }
169002 if( memErr ){
169003 sqlite3_result_error_nomem(ctx);
169004 rtreeMatchArgFree(pBlob);
169005 }else{
169006 sqlite3_result_pointer(ctx, pBlob, "RtreeMatchArg", rtreeMatchArgFree);
169007 }
169008 }
169009 }
169010
169011 /*
@@ -200285,11 +200314,11 @@
200314 int nArg, /* Number of args */
200315 sqlite3_value **apUnused /* Function arguments */
200316 ){
200317 assert( nArg==0 );
200318 UNUSED_PARAM2(nArg, apUnused);
200319 sqlite3_result_text(pCtx, "fts5: 2017-07-27 18:43:13 2dfcd9a8ecdf0ddd8e044d820639830c6171141c588cf0224255af85c64cf79c", -1, SQLITE_TRANSIENT);
200320 }
200321
200322 static int fts5Init(sqlite3 *db){
200323 static const sqlite3_module fts5Mod = {
200324 /* iVersion */ 2,
200325
+19 -16
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121121
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122122
** [sqlite_version()] and [sqlite_source_id()].
123123
*/
124124
#define SQLITE_VERSION "3.20.0"
125125
#define SQLITE_VERSION_NUMBER 3020000
126
-#define SQLITE_SOURCE_ID "2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51"
126
+#define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9"
127127
128128
/*
129129
** CAPI3REF: Run-Time Library Version Numbers
130130
** KEYWORDS: sqlite3_version sqlite3_sourceid
131131
**
@@ -3881,18 +3881,18 @@
38813881
** Zeroblobs are intended to serve as placeholders for BLOBs whose
38823882
** content is later written using
38833883
** [sqlite3_blob_open | incremental BLOB I/O] routines.
38843884
** ^A negative value for the zeroblob results in a zero-length BLOB.
38853885
**
3886
-** ^The sqlite3_bind_pointer(S,I,P,T) routine causes the I-th parameter in
3886
+** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
38873887
** [prepared statement] S to have an SQL value of NULL, but to also be
3888
-** associated with the pointer P of type T.
3889
-** ^The sqlite3_bind_pointer() routine can be used to pass
3890
-** host-language pointers into [application-defined SQL functions].
3891
-** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
3892
-** to be an ordinary SQL NULL value to everything other than
3893
-** [sqlite3_value_pointer()]. The T parameter should be a static string.
3888
+** associated with the pointer P of type T. ^D is either a NULL pointer or
3889
+** a pointer to a destructor function for P. ^SQLite will invoke the
3890
+** destructor D with a single argument of P when it is finished using
3891
+** P. The T parameter should be a static string, preferably a string
3892
+** literal. The sqlite3_bind_pointer() routine is part of the
3893
+** [pointer passing interface] added for SQLite 3.20.0.
38943894
**
38953895
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
38963896
** for the [prepared statement] or with a prepared statement for which
38973897
** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
38983898
** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -3923,11 +3923,11 @@
39233923
SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
39243924
SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
39253925
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
39263926
void(*)(void*), unsigned char encoding);
39273927
SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3928
-SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*);
3928
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
39293929
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
39303930
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
39313931
39323932
/*
39333933
** CAPI3REF: Number Of SQL Parameters
@@ -4756,14 +4756,15 @@
47564756
** in the native byte-order of the host machine. ^The
47574757
** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
47584758
** extract UTF-16 strings as big-endian and little-endian respectively.
47594759
**
47604760
** ^If [sqlite3_value] object V was initialized
4761
-** using [sqlite3_bind_pointer(S,I,P,X)] or [sqlite3_result_pointer(C,P,X)]
4761
+** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
47624762
** and if X and Y are strings that compare equal according to strcmp(X,Y),
47634763
** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
4764
-** sqlite3_value_pointer(V,Y) returns a NULL.
4764
+** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer()
4765
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
47654766
**
47664767
** ^(The sqlite3_value_type(V) interface returns the
47674768
** [SQLITE_INTEGER | datatype code] for the initial datatype of the
47684769
** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
47694770
** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -5094,18 +5095,20 @@
50945095
** be deallocated after sqlite3_result_value() returns without harm.
50955096
** ^A [protected sqlite3_value] object may always be used where an
50965097
** [unprotected sqlite3_value] object is required, so either
50975098
** kind of [sqlite3_value] object can be used with this interface.
50985099
**
5099
-** ^The sqlite3_result_pointer(C,P,T) interface sets the result to an
5100
+** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
51005101
** SQL NULL value, just like [sqlite3_result_null(C)], except that it
51015102
** also associates the host-language pointer P or type T with that
51025103
** NULL value such that the pointer can be retrieved within an
51035104
** [application-defined SQL function] using [sqlite3_value_pointer()].
5104
-** The T parameter should be a static string.
5105
-** This mechanism can be used to pass non-SQL values between
5106
-** application-defined functions.
5105
+** ^If the D parameter is not NULL, then it is a pointer to a destructor
5106
+** for the P parameter. ^SQLite invokes D with P as its only argument
5107
+** when SQLite is finished with P. The T parameter should be a static
5108
+** string and preferably a string literal. The sqlite3_result_pointer()
5109
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
51075110
**
51085111
** If these routines are called from within the different thread
51095112
** than the one containing the application-defined function that received
51105113
** the [sqlite3_context] pointer, the results are undefined.
51115114
*/
@@ -5126,11 +5129,11 @@
51265129
void(*)(void*), unsigned char encoding);
51275130
SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
51285131
SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
51295132
SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
51305133
SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5131
-SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*, const char*);
5134
+SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
51325135
SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
51335136
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
51345137
51355138
51365139
/*
51375140
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.20.0"
125 #define SQLITE_VERSION_NUMBER 3020000
126 #define SQLITE_SOURCE_ID "2017-07-21 20:31:31 8de20fc72a9b55fabd2444b2d73c88c65658430d6d182da9f0e2f3432373ab51"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version sqlite3_sourceid
131 **
@@ -3881,18 +3881,18 @@
3881 ** Zeroblobs are intended to serve as placeholders for BLOBs whose
3882 ** content is later written using
3883 ** [sqlite3_blob_open | incremental BLOB I/O] routines.
3884 ** ^A negative value for the zeroblob results in a zero-length BLOB.
3885 **
3886 ** ^The sqlite3_bind_pointer(S,I,P,T) routine causes the I-th parameter in
3887 ** [prepared statement] S to have an SQL value of NULL, but to also be
3888 ** associated with the pointer P of type T.
3889 ** ^The sqlite3_bind_pointer() routine can be used to pass
3890 ** host-language pointers into [application-defined SQL functions].
3891 ** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
3892 ** to be an ordinary SQL NULL value to everything other than
3893 ** [sqlite3_value_pointer()]. The T parameter should be a static string.
3894 **
3895 ** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
3896 ** for the [prepared statement] or with a prepared statement for which
3897 ** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
3898 ** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -3923,11 +3923,11 @@
3923 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3924 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3925 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3926 void(*)(void*), unsigned char encoding);
3927 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3928 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*);
3929 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3930 SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3931
3932 /*
3933 ** CAPI3REF: Number Of SQL Parameters
@@ -4756,14 +4756,15 @@
4756 ** in the native byte-order of the host machine. ^The
4757 ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
4758 ** extract UTF-16 strings as big-endian and little-endian respectively.
4759 **
4760 ** ^If [sqlite3_value] object V was initialized
4761 ** using [sqlite3_bind_pointer(S,I,P,X)] or [sqlite3_result_pointer(C,P,X)]
4762 ** and if X and Y are strings that compare equal according to strcmp(X,Y),
4763 ** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
4764 ** sqlite3_value_pointer(V,Y) returns a NULL.
 
4765 **
4766 ** ^(The sqlite3_value_type(V) interface returns the
4767 ** [SQLITE_INTEGER | datatype code] for the initial datatype of the
4768 ** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
4769 ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -5094,18 +5095,20 @@
5094 ** be deallocated after sqlite3_result_value() returns without harm.
5095 ** ^A [protected sqlite3_value] object may always be used where an
5096 ** [unprotected sqlite3_value] object is required, so either
5097 ** kind of [sqlite3_value] object can be used with this interface.
5098 **
5099 ** ^The sqlite3_result_pointer(C,P,T) interface sets the result to an
5100 ** SQL NULL value, just like [sqlite3_result_null(C)], except that it
5101 ** also associates the host-language pointer P or type T with that
5102 ** NULL value such that the pointer can be retrieved within an
5103 ** [application-defined SQL function] using [sqlite3_value_pointer()].
5104 ** The T parameter should be a static string.
5105 ** This mechanism can be used to pass non-SQL values between
5106 ** application-defined functions.
 
 
5107 **
5108 ** If these routines are called from within the different thread
5109 ** than the one containing the application-defined function that received
5110 ** the [sqlite3_context] pointer, the results are undefined.
5111 */
@@ -5126,11 +5129,11 @@
5126 void(*)(void*), unsigned char encoding);
5127 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5128 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5129 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5130 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5131 SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*, const char*);
5132 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
5133 SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5134
5135
5136 /*
5137
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.20.0"
125 #define SQLITE_VERSION_NUMBER 3020000
126 #define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version sqlite3_sourceid
131 **
@@ -3881,18 +3881,18 @@
3881 ** Zeroblobs are intended to serve as placeholders for BLOBs whose
3882 ** content is later written using
3883 ** [sqlite3_blob_open | incremental BLOB I/O] routines.
3884 ** ^A negative value for the zeroblob results in a zero-length BLOB.
3885 **
3886 ** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
3887 ** [prepared statement] S to have an SQL value of NULL, but to also be
3888 ** associated with the pointer P of type T. ^D is either a NULL pointer or
3889 ** a pointer to a destructor function for P. ^SQLite will invoke the
3890 ** destructor D with a single argument of P when it is finished using
3891 ** P. The T parameter should be a static string, preferably a string
3892 ** literal. The sqlite3_bind_pointer() routine is part of the
3893 ** [pointer passing interface] added for SQLite 3.20.0.
3894 **
3895 ** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
3896 ** for the [prepared statement] or with a prepared statement for which
3897 ** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
3898 ** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
@@ -3923,11 +3923,11 @@
3923 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3924 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3925 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3926 void(*)(void*), unsigned char encoding);
3927 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3928 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
3929 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3930 SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3931
3932 /*
3933 ** CAPI3REF: Number Of SQL Parameters
@@ -4756,14 +4756,15 @@
4756 ** in the native byte-order of the host machine. ^The
4757 ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
4758 ** extract UTF-16 strings as big-endian and little-endian respectively.
4759 **
4760 ** ^If [sqlite3_value] object V was initialized
4761 ** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
4762 ** and if X and Y are strings that compare equal according to strcmp(X,Y),
4763 ** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
4764 ** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer()
4765 ** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
4766 **
4767 ** ^(The sqlite3_value_type(V) interface returns the
4768 ** [SQLITE_INTEGER | datatype code] for the initial datatype of the
4769 ** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
4770 ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
@@ -5094,18 +5095,20 @@
5095 ** be deallocated after sqlite3_result_value() returns without harm.
5096 ** ^A [protected sqlite3_value] object may always be used where an
5097 ** [unprotected sqlite3_value] object is required, so either
5098 ** kind of [sqlite3_value] object can be used with this interface.
5099 **
5100 ** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
5101 ** SQL NULL value, just like [sqlite3_result_null(C)], except that it
5102 ** also associates the host-language pointer P or type T with that
5103 ** NULL value such that the pointer can be retrieved within an
5104 ** [application-defined SQL function] using [sqlite3_value_pointer()].
5105 ** ^If the D parameter is not NULL, then it is a pointer to a destructor
5106 ** for the P parameter. ^SQLite invokes D with P as its only argument
5107 ** when SQLite is finished with P. The T parameter should be a static
5108 ** string and preferably a string literal. The sqlite3_result_pointer()
5109 ** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
5110 **
5111 ** If these routines are called from within the different thread
5112 ** than the one containing the application-defined function that received
5113 ** the [sqlite3_context] pointer, the results are undefined.
5114 */
@@ -5126,11 +5129,11 @@
5129 void(*)(void*), unsigned char encoding);
5130 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5131 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5132 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5133 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5134 SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
5135 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
5136 SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5137
5138
5139 /*
5140

Keyboard Shortcuts

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