| | @@ -380,11 +380,11 @@ |
| 380 | 380 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 381 | 381 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 382 | 382 | */ |
| 383 | 383 | #define SQLITE_VERSION "3.14.0" |
| 384 | 384 | #define SQLITE_VERSION_NUMBER 3014000 |
| 385 | | -#define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914" |
| 385 | +#define SQLITE_SOURCE_ID "2016-08-01 17:06:44 90d2c490fc2ed4e073711b84f989ca4d496dcfb5" |
| 386 | 386 | |
| 387 | 387 | /* |
| 388 | 388 | ** CAPI3REF: Run-Time Library Version Numbers |
| 389 | 389 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 390 | 390 | ** |
| | @@ -1303,10 +1303,20 @@ |
| 1303 | 1303 | ** |
| 1304 | 1304 | ** Mutexes are created using [sqlite3_mutex_alloc()]. |
| 1305 | 1305 | */ |
| 1306 | 1306 | typedef struct sqlite3_mutex sqlite3_mutex; |
| 1307 | 1307 | |
| 1308 | +/* |
| 1309 | +** CAPI3REF: Loadable Extension Thunk |
| 1310 | +** |
| 1311 | +** A pointer to the opaque sqlite3_api_routines structure is passed as |
| 1312 | +** the third parameter to entry points of [loadable extensions]. This |
| 1313 | +** structure must be typedefed in order to work around compiler warnings |
| 1314 | +** on some platforms. |
| 1315 | +*/ |
| 1316 | +typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 1317 | + |
| 1308 | 1318 | /* |
| 1309 | 1319 | ** CAPI3REF: OS Interface Object |
| 1310 | 1320 | ** |
| 1311 | 1321 | ** An instance of the sqlite3_vfs object defines the interface between |
| 1312 | 1322 | ** the SQLite core and the underlying operating system. The "vfs" |
| | @@ -2500,11 +2510,11 @@ |
| 2500 | 2510 | ** result in undefined behavior. |
| 2501 | 2511 | ** |
| 2502 | 2512 | ** A busy handler must not close the database connection |
| 2503 | 2513 | ** or [prepared statement] that invoked the busy handler. |
| 2504 | 2514 | */ |
| 2505 | | -SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); |
| 2515 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*); |
| 2506 | 2516 | |
| 2507 | 2517 | /* |
| 2508 | 2518 | ** CAPI3REF: Set A Busy Timeout |
| 2509 | 2519 | ** METHOD: sqlite3 |
| 2510 | 2520 | ** |
| | @@ -5939,11 +5949,11 @@ |
| 5939 | 5949 | ** xEntryPoint() is the entry point for a statically linked [SQLite extension] |
| 5940 | 5950 | ** that is to be automatically loaded into all new database connections. |
| 5941 | 5951 | ** |
| 5942 | 5952 | ** ^(Even though the function prototype shows that xEntryPoint() takes |
| 5943 | 5953 | ** no arguments and returns void, SQLite invokes xEntryPoint() with three |
| 5944 | | -** arguments and expects and integer result as if the signature of the |
| 5954 | +** arguments and expects an integer result as if the signature of the |
| 5945 | 5955 | ** entry point where as follows: |
| 5946 | 5956 | ** |
| 5947 | 5957 | ** <blockquote><pre> |
| 5948 | 5958 | ** int xEntryPoint( |
| 5949 | 5959 | ** sqlite3 *db, |
| | @@ -5965,14 +5975,11 @@ |
| 5965 | 5975 | ** will be called more than once for each database connection that is opened. |
| 5966 | 5976 | ** |
| 5967 | 5977 | ** See also: [sqlite3_reset_auto_extension()] |
| 5968 | 5978 | ** and [sqlite3_cancel_auto_extension()] |
| 5969 | 5979 | */ |
| 5970 | | -typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 5971 | | -SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( |
| 5972 | | - int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5973 | | -); |
| 5980 | +SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void)); |
| 5974 | 5981 | |
| 5975 | 5982 | /* |
| 5976 | 5983 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5977 | 5984 | ** |
| 5978 | 5985 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| | @@ -5980,13 +5987,11 @@ |
| 5980 | 5987 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5981 | 5988 | ** routine returns 1 if initialization routine X was successfully |
| 5982 | 5989 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5983 | 5990 | ** routines. |
| 5984 | 5991 | */ |
| 5985 | | -SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( |
| 5986 | | - int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5987 | | -); |
| 5992 | +SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void)); |
| 5988 | 5993 | |
| 5989 | 5994 | /* |
| 5990 | 5995 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5991 | 5996 | ** |
| 5992 | 5997 | ** ^This interface disables all automatic extensions previously |
| | @@ -10889,11 +10894,11 @@ |
| 10889 | 10894 | ** Make sure that the compiler intrinsics we desire are enabled when |
| 10890 | 10895 | ** compiling with an appropriate version of MSVC unless prevented by |
| 10891 | 10896 | ** the SQLITE_DISABLE_INTRINSIC define. |
| 10892 | 10897 | */ |
| 10893 | 10898 | #if !defined(SQLITE_DISABLE_INTRINSIC) |
| 10894 | | -# if defined(_MSC_VER) && _MSC_VER>=1300 |
| 10899 | +# if defined(_MSC_VER) && _MSC_VER>=1400 |
| 10895 | 10900 | # if !defined(_WIN32_WCE) |
| 10896 | 10901 | # include <intrin.h> |
| 10897 | 10902 | # pragma intrinsic(_byteswap_ushort) |
| 10898 | 10903 | # pragma intrinsic(_byteswap_ulong) |
| 10899 | 10904 | # pragma intrinsic(_ReadWriteBarrier) |
| | @@ -108767,12 +108772,10 @@ |
| 108767 | 108772 | */ |
| 108768 | 108773 | #ifndef SQLITE3EXT_H |
| 108769 | 108774 | #define SQLITE3EXT_H |
| 108770 | 108775 | /* #include "sqlite3.h" */ |
| 108771 | 108776 | |
| 108772 | | -typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 108773 | | - |
| 108774 | 108777 | /* |
| 108775 | 108778 | ** The following structure holds pointers to all of the SQLite API |
| 108776 | 108779 | ** routines. |
| 108777 | 108780 | ** |
| 108778 | 108781 | ** WARNING: In order to maintain backwards compatibility, add new |
| | @@ -108999,17 +109002,16 @@ |
| 108999 | 109002 | sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64); |
| 109000 | 109003 | const char *(*uri_parameter)(const char*,const char*); |
| 109001 | 109004 | char *(*vsnprintf)(int,char*,const char*,va_list); |
| 109002 | 109005 | int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*); |
| 109003 | 109006 | /* Version 3.8.7 and later */ |
| 109004 | | - int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*)); |
| 109007 | + int (*auto_extension)(void(*)(void)); |
| 109005 | 109008 | int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64, |
| 109006 | 109009 | void(*)(void*)); |
| 109007 | 109010 | int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64, |
| 109008 | 109011 | void(*)(void*),unsigned char); |
| 109009 | | - int (*cancel_auto_extension)(int(*)(sqlite3*,char**, |
| 109010 | | - const sqlite3_api_routines*)); |
| 109012 | + int (*cancel_auto_extension)(void(*)(void)); |
| 109011 | 109013 | int (*load_extension)(sqlite3*,const char*,const char*,char**); |
| 109012 | 109014 | void *(*malloc64)(sqlite3_uint64); |
| 109013 | 109015 | sqlite3_uint64 (*msize)(void*); |
| 109014 | 109016 | void *(*realloc64)(void*,sqlite3_uint64); |
| 109015 | 109017 | void (*reset_auto_extension)(void); |
| | @@ -109316,19 +109318,10 @@ |
| 109316 | 109318 | /************** Continuing where we left off in loadext.c ********************/ |
| 109317 | 109319 | /* #include "sqliteInt.h" */ |
| 109318 | 109320 | /* #include <string.h> */ |
| 109319 | 109321 | |
| 109320 | 109322 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 109321 | | -/* |
| 109322 | | -** This is the function signature used for all extension entry points. |
| 109323 | | -*/ |
| 109324 | | -typedef int (*sqlite3_loadext_entry)( |
| 109325 | | - sqlite3 *db, /* Handle to the database. */ |
| 109326 | | - char **pzErrMsg, /* Used to set error string on failure. */ |
| 109327 | | - const sqlite3_api_routines *pThunk /* Extension API function pointers. */ |
| 109328 | | -); |
| 109329 | | - |
| 109330 | 109323 | /* |
| 109331 | 109324 | ** Some API routines are omitted when various features are |
| 109332 | 109325 | ** excluded from a build of SQLite. Substitute a NULL pointer |
| 109333 | 109326 | ** for any missing APIs. |
| 109334 | 109327 | */ |
| | @@ -109971,11 +109964,11 @@ |
| 109971 | 109964 | /* |
| 109972 | 109965 | ** Register a statically linked extension that is automatically |
| 109973 | 109966 | ** loaded by every new database connection. |
| 109974 | 109967 | */ |
| 109975 | 109968 | SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( |
| 109976 | | - int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 109969 | + void (*xInit)(void) |
| 109977 | 109970 | ){ |
| 109978 | 109971 | int rc = SQLITE_OK; |
| 109979 | 109972 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109980 | 109973 | rc = sqlite3_initialize(); |
| 109981 | 109974 | if( rc ){ |
| | @@ -109988,21 +109981,21 @@ |
| 109988 | 109981 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109989 | 109982 | #endif |
| 109990 | 109983 | wsdAutoextInit; |
| 109991 | 109984 | sqlite3_mutex_enter(mutex); |
| 109992 | 109985 | for(i=0; i<wsdAutoext.nExt; i++){ |
| 109993 | | - if( wsdAutoext.aExt[i]==(void*)xInit ) break; |
| 109986 | + if( wsdAutoext.aExt[i]==xInit ) break; |
| 109994 | 109987 | } |
| 109995 | 109988 | if( i==wsdAutoext.nExt ){ |
| 109996 | 109989 | u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
| 109997 | 109990 | void (**aNew)(void); |
| 109998 | 109991 | aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte); |
| 109999 | 109992 | if( aNew==0 ){ |
| 110000 | 109993 | rc = SQLITE_NOMEM_BKPT; |
| 110001 | 109994 | }else{ |
| 110002 | 109995 | wsdAutoext.aExt = aNew; |
| 110003 | | - wsdAutoext.aExt[wsdAutoext.nExt] = (void*)xInit; |
| 109996 | + wsdAutoext.aExt[wsdAutoext.nExt] = xInit; |
| 110004 | 109997 | wsdAutoext.nExt++; |
| 110005 | 109998 | } |
| 110006 | 109999 | } |
| 110007 | 110000 | sqlite3_mutex_leave(mutex); |
| 110008 | 110001 | assert( (rc&0xff)==rc ); |
| | @@ -110018,21 +110011,21 @@ |
| 110018 | 110011 | ** |
| 110019 | 110012 | ** Return 1 if xInit was found on the list and removed. Return 0 if xInit |
| 110020 | 110013 | ** was not on the list. |
| 110021 | 110014 | */ |
| 110022 | 110015 | SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( |
| 110023 | | - int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 110016 | + void (*xInit)(void) |
| 110024 | 110017 | ){ |
| 110025 | 110018 | #if SQLITE_THREADSAFE |
| 110026 | 110019 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 110027 | 110020 | #endif |
| 110028 | 110021 | int i; |
| 110029 | 110022 | int n = 0; |
| 110030 | 110023 | wsdAutoextInit; |
| 110031 | 110024 | sqlite3_mutex_enter(mutex); |
| 110032 | 110025 | for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
| 110033 | | - if( wsdAutoext.aExt[i]==(void*)xInit ){ |
| 110026 | + if( wsdAutoext.aExt[i]==xInit ){ |
| 110034 | 110027 | wsdAutoext.nExt--; |
| 110035 | 110028 | wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; |
| 110036 | 110029 | n++; |
| 110037 | 110030 | break; |
| 110038 | 110031 | } |
| | @@ -129423,13 +129416,13 @@ |
| 129423 | 129416 | ** satisfied using just the index, and that do not require a |
| 129424 | 129417 | ** table lookup. */ |
| 129425 | 129418 | LogEst nLookup = rSize + 16; /* Base cost: N*3 */ |
| 129426 | 129419 | int ii; |
| 129427 | 129420 | int iCur = pSrc->iCursor; |
| 129428 | | - WhereClause *pWC = &pWInfo->sWC; |
| 129429 | | - for(ii=0; ii<pWC->nTerm; ii++){ |
| 129430 | | - WhereTerm *pTerm = &pWC->a[ii]; |
| 129421 | + WhereClause *pWC2 = &pWInfo->sWC; |
| 129422 | + for(ii=0; ii<pWC2->nTerm; ii++){ |
| 129423 | + WhereTerm *pTerm = &pWC2->a[ii]; |
| 129431 | 129424 | if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){ |
| 129432 | 129425 | break; |
| 129433 | 129426 | } |
| 129434 | 129427 | /* pTerm can be evaluated using just the index. So reduce |
| 129435 | 129428 | ** the expected number of table lookups accordingly */ |
| | @@ -176142,10 +176135,11 @@ |
| 176142 | 176135 | sqlite3_context *ctx, |
| 176143 | 176136 | int argc, |
| 176144 | 176137 | sqlite3_value **argv |
| 176145 | 176138 | ){ |
| 176146 | 176139 | JsonString jx; |
| 176140 | + UNUSED_PARAM(argc); |
| 176147 | 176141 | |
| 176148 | 176142 | jsonInit(&jx, ctx); |
| 176149 | 176143 | jsonAppendValue(&jx, argv[0]); |
| 176150 | 176144 | jsonResult(&jx); |
| 176151 | 176145 | sqlite3_result_subtype(ctx, JSON_SUBTYPE); |
| | @@ -193951,11 +193945,11 @@ |
| 193951 | 193945 | int nArg, /* Number of args */ |
| 193952 | 193946 | sqlite3_value **apUnused /* Function arguments */ |
| 193953 | 193947 | ){ |
| 193954 | 193948 | assert( nArg==0 ); |
| 193955 | 193949 | UNUSED_PARAM2(nArg, apUnused); |
| 193956 | | - sqlite3_result_text(pCtx, "fts5: 2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914", -1, SQLITE_TRANSIENT); |
| 193950 | + sqlite3_result_text(pCtx, "fts5: 2016-07-30 18:54:54 390a38a142d36d2c57b3f21aab72edcde450125d", -1, SQLITE_TRANSIENT); |
| 193957 | 193951 | } |
| 193958 | 193952 | |
| 193959 | 193953 | static int fts5Init(sqlite3 *db){ |
| 193960 | 193954 | static const sqlite3_module fts5Mod = { |
| 193961 | 193955 | /* iVersion */ 2, |
| 193962 | 193956 | |