From 19e76b2a7cf4b1b42f2d90ef27ea852603206bb2 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 30 Jul 2016 18:54:54 +0000 Subject: [PATCH 01/10] Fix harmless compiler warning seen with MSVC. FossilOrigin-Name: 390a38a142d36d2c57b3f21aab72edcde450125d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/where.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index ddf53b746a..9657203bbb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Using\sthe\sheader\sfile\s'intrin.h'\srequires\sMSVC\s2005\sor\slater. -D 2016-07-29T17:36:27.088 +C Fix\sharmless\scompiler\swarning\sseen\swith\sMSVC. +D 2016-07-30T18:54:54.989 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233 @@ -463,7 +463,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2 F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354 -F src/where.c fcaa38d19c2a7bb450cc57810bdc3d4eb36e00b0 +F src/where.c bb1444f6ae6bc3cbd086cc61cd9c6e3a6168d89b F src/whereInt.h e5b939701a7ceffc5a3a8188a37f9746416ebcd0 F src/wherecode.c 99707d11907c71d289ee9553d2d1a22f1fd8ba41 F src/whereexpr.c d7dcbf14ce1b5876c1f76496162c30fcba669563 @@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 544c990afd3b64064cc4d970ec5d7eb23eeb9914 -R ceef2b71453325469cbc16ff7674c4c9 +P 9fae75c08b7d3b3e13734193ad8398ef6971cbac +R 20430021b7d310aa0691f2edba10b981 U mistachkin -Z 0275ffb3719041525e752ce514a5292f +Z 1a5ea8a378b7c26f7d4d45026b5640de diff --git a/manifest.uuid b/manifest.uuid index 5827550e55..dedb9c60d3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9fae75c08b7d3b3e13734193ad8398ef6971cbac \ No newline at end of file +390a38a142d36d2c57b3f21aab72edcde450125d \ No newline at end of file diff --git a/src/where.c b/src/where.c index da41c142fa..9b3c281efc 100644 --- a/src/where.c +++ b/src/where.c @@ -2786,9 +2786,9 @@ static int whereLoopAddBtree( LogEst nLookup = rSize + 16; /* Base cost: N*3 */ int ii; int iCur = pSrc->iCursor; - WhereClause *pWC = &pWInfo->sWC; - for(ii=0; iinTerm; ii++){ - WhereTerm *pTerm = &pWC->a[ii]; + WhereClause *pWC2 = &pWInfo->sWC; + for(ii=0; iinTerm; ii++){ + WhereTerm *pTerm = &pWC2->a[ii]; if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){ break; } From 32c83c8b9e4fc3a5af99856ae6db15694dbe0414 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 1 Aug 2016 14:35:48 +0000 Subject: [PATCH 02/10] Avoid making unnecessary changes to the signatures of the sqlite3_auto_extension() and sqlite3_cancel_auto_extension() interfaces. FossilOrigin-Name: b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6 --- manifest | 28 ++++++++++++++-------------- manifest.uuid | 2 +- src/loadext.c | 4 ++-- src/sqlite.h.in | 23 ++++++++++++++--------- src/sqlite3ext.h | 7 ++----- src/test1.c | 1 - src/test_autoext.c | 12 ++++++------ src/test_func.c | 10 +++++----- src/test_multiplex.c | 2 +- src/test_thread.c | 2 +- 10 files changed, 46 insertions(+), 45 deletions(-) diff --git a/manifest b/manifest index 9657203bbb..76e84155ee 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarning\sseen\swith\sMSVC. -D 2016-07-30T18:54:54.989 +C Avoid\smaking\sunnecessary\schanges\sto\sthe\ssignatures\sof\sthe\nsqlite3_auto_extension()\sand\ssqlite3_cancel_auto_extension()\sinterfaces. +D 2016-08-01T14:35:48.519 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233 @@ -347,7 +347,7 @@ F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4 F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e -F src/loadext.c c3c2a37e4ce940d17c73971738754d412c79e09d +F src/loadext.c 0ac0030646e4ec3c775b5c40d1818ec9a7e1ca95 F src/main.c 16c1b2114eae8804caf3a8de8cb47bf2c6d83ad3 F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 @@ -385,15 +385,15 @@ F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4 F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5 -F src/sqlite.h.in cd10e4206b91c4bf03f121ab9209a14af0b48f14 +F src/sqlite.h.in b41cf2d1deb59db570f20e8ed7ade4716c6dc613 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 -F src/sqlite3ext.h f4206565eb5f5cef9a1544d32a076b5f47af1bdc +F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae F src/sqliteInt.h d6f221a5bd572df935140beda82f357c2185a77c F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247 F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9 F src/tclsqlite.c bdae822f21e229b6daced15938b6343ce44ef454 -F src/test1.c 906a04b649c7139e943193a3905d583e325c30c7 +F src/test1.c 0a0909cf7962d2359db329c08d15b90b4b6e724f F src/test2.c b7174313e993754303a8b33c43df7c44b46857ab F src/test3.c 1339a40be39650ae83894b6578f971dc7f96ea8a F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6 @@ -403,7 +403,7 @@ F src/test7.c 5612e9aecf934d6df7bba6ce861fdf5ba5456010 F src/test8.c 4f4904721167b32f7a4fa8c7b32a07a673d6cc86 F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5 F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a -F src/test_autoext.c cc69375c006b7bac6094ec602f52525350fd5229 +F src/test_autoext.c 915d245e736652a219a907909bb6710f0d587871 F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0 F src/test_bestindex.c d23f80d334c59662af69191854c76b8d3d0c8c96 F src/test_blob.c a0f7ad49a0c9d4b72f693fe2a71c58d7e507174d @@ -412,7 +412,7 @@ F src/test_config.c 4d3d4a886416f369771d69a6dba926866deda788 F src/test_demovfs.c a0c3bdd45ed044115c2c9f7779e56eafff18741e F src/test_devsym.c 4e58dec2602d8e139ca08659f62a62450587cb58 F src/test_fs.c ac62ce7d5c0c23aa6932891cad5746945564c91c -F src/test_func.c 6f34b19ae097e3cf0b0fe5d6904cb9900e67f2ff +F src/test_func.c a2b4993da973b0ea60dd5d51a7066238ede8c329 F src/test_hexio.c 1d4469ca61ab202a1fcec6543f584d2407205e8d F src/test_init.c 4413c211a94b62157ca4c145b3f27c497f03c664 F src/test_intarray.c 988fc61cb0ff539f4172c0d95f15287c92516f64 @@ -420,7 +420,7 @@ F src/test_intarray.h f3b7672f5d1056eac563c0d6ea8480a660b1475c F src/test_journal.c d3b83f2bcb7792c709e57abddc456a2b1818643a F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd F src/test_malloc.c c05f6c40bd6c8bfe5f1718212f81fd5687f91766 -F src/test_multiplex.c 371d3874fd6365f18468d1c131e153e5c9abe95e +F src/test_multiplex.c 7c5b218d855cd0505a43185d55283b3fc257c8da F src/test_multiplex.h 5436d03f2d0501d04f3ed50a75819e190495b635 F src/test_mutex.c 7f4337ba23ee6b1d2ec81c189653608cb069926a F src/test_onefile.c 416f87a28d6d673352d33fc4b1c7d39db878e50f @@ -435,7 +435,7 @@ F src/test_sqllog.c 0d138a8180a312bf996b37fa66da5c5799d4d57b F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e F src/test_syscall.c 1073306ba2e9bfc886771871a13d3de281ed3939 F src/test_tclvar.c df9fe1213c2634687a9ca0b0bec0d2119d359ae3 -F src/test_thread.c 89f0e47dac64e7ab15ca0a4fc87e0882c495ae21 +F src/test_thread.c 911d15fb14e19c0c542bdc8aabf981c2f10a4858 F src/test_vfs.c f0186261a24de2671d080bcd8050732f0cb64f6e F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698 F src/test_windirent.c 8f5fada630348558d5745b334702f301da1ffc61 @@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9fae75c08b7d3b3e13734193ad8398ef6971cbac -R 20430021b7d310aa0691f2edba10b981 -U mistachkin -Z 1a5ea8a378b7c26f7d4d45026b5640de +P 390a38a142d36d2c57b3f21aab72edcde450125d +R 65e7d16d0e1a0cbde00eb39308479bd3 +U drh +Z ed98f4241335140747349246aea331ad diff --git a/manifest.uuid b/manifest.uuid index dedb9c60d3..6b01792124 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -390a38a142d36d2c57b3f21aab72edcde450125d \ No newline at end of file +b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6 \ No newline at end of file diff --git a/src/loadext.c b/src/loadext.c index 163141bf73..26ba7e6491 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -676,7 +676,7 @@ static SQLITE_WSD struct sqlite3AutoExtList { ** loaded by every new database connection. */ int sqlite3_auto_extension( - int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) + void (*xInit)(void) ){ int rc = SQLITE_OK; #ifndef SQLITE_OMIT_AUTOINIT @@ -723,7 +723,7 @@ int sqlite3_auto_extension( ** was not on the list. */ int sqlite3_cancel_auto_extension( - int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) + void (*xInit)(void) ){ #if SQLITE_THREADSAFE sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 9d28cdc05a..27ca6ef4ad 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1045,6 +1045,16 @@ struct sqlite3_io_methods { */ typedef struct sqlite3_mutex sqlite3_mutex; +/* +** CAPI3REF: Loadable Extension Thunk +** +** A pointer to the opaque sqlite3_api_routines structure is passed as +** the third parameter to entry points of [loadable extensions]. This +** structure must be typedefed in order to work around compiler warnings +** on some platforms. +*/ +typedef struct sqlite3_api_routines sqlite3_api_routines; + /* ** CAPI3REF: OS Interface Object ** @@ -2242,7 +2252,7 @@ int sqlite3_complete16(const void *sql); ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ -int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); +int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); /* ** CAPI3REF: Set A Busy Timeout @@ -5681,7 +5691,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff); ** ** ^(Even though the function prototype shows that xEntryPoint() takes ** no arguments and returns void, SQLite invokes xEntryPoint() with three -** arguments and expects and integer result as if the signature of the +** arguments and expects an integer result as if the signature of the ** entry point where as follows: ** **
@@ -5707,10 +5717,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
 ** See also: [sqlite3_reset_auto_extension()]
 ** and [sqlite3_cancel_auto_extension()]
 */
-typedef struct sqlite3_api_routines sqlite3_api_routines;
-int sqlite3_auto_extension(
-  int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
-);
+int sqlite3_auto_extension(void(*xEntryPoint)(void));
 
 /*
 ** CAPI3REF: Cancel Automatic Extension Loading
@@ -5722,9 +5729,7 @@ int sqlite3_auto_extension(
 ** unregistered and it returns 0 if X was not on the list of initialization
 ** routines.
 */
-int sqlite3_cancel_auto_extension(
-  int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
-);
+int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
 
 /*
 ** CAPI3REF: Reset Automatic Extension Loading
diff --git a/src/sqlite3ext.h b/src/sqlite3ext.h
index 689a5c4856..ce87e74690 100644
--- a/src/sqlite3ext.h
+++ b/src/sqlite3ext.h
@@ -19,8 +19,6 @@
 #define SQLITE3EXT_H
 #include "sqlite3.h"
 
-typedef struct sqlite3_api_routines sqlite3_api_routines;
-
 /*
 ** The following structure holds pointers to all of the SQLite API
 ** routines.
@@ -251,13 +249,12 @@ struct sqlite3_api_routines {
   char *(*vsnprintf)(int,char*,const char*,va_list);
   int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
   /* Version 3.8.7 and later */
-  int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*));
+  int (*auto_extension)(void(*)(void));
   int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
                      void(*)(void*));
   int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
                       void(*)(void*),unsigned char);
-  int (*cancel_auto_extension)(int(*)(sqlite3*,char**,
-                                       const sqlite3_api_routines*));
+  int (*cancel_auto_extension)(void(*)(void));
   int (*load_extension)(sqlite3*,const char*,const char*,char**);
   void *(*malloc64)(sqlite3_uint64);
   sqlite3_uint64 (*msize)(void*);
diff --git a/src/test1.c b/src/test1.c
index ec6d8ecff3..aced552173 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -6742,7 +6742,6 @@ static int SQLITE_TCLAPI optimization_control(
   return TCL_OK;
 }
 
-typedef struct sqlite3_api_routines sqlite3_api_routines;
 /*
 **     load_static_extension DB NAME ...
 **
diff --git a/src/test_autoext.c b/src/test_autoext.c
index f962a51d6b..e23e41a08a 100644
--- a/src/test_autoext.c
+++ b/src/test_autoext.c
@@ -100,7 +100,7 @@ static int SQLITE_TCLAPI autoExtSqrObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_auto_extension(sqr_init);
+  int rc = sqlite3_auto_extension((void(*)(void))sqr_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
@@ -116,7 +116,7 @@ static int SQLITE_TCLAPI cancelAutoExtSqrObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_cancel_auto_extension(sqr_init);
+  int rc = sqlite3_cancel_auto_extension((void(*)(void))sqr_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
@@ -132,7 +132,7 @@ static int SQLITE_TCLAPI autoExtCubeObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_auto_extension(cube_init);
+  int rc = sqlite3_auto_extension((void(*)(void))cube_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
@@ -148,7 +148,7 @@ static int SQLITE_TCLAPI cancelAutoExtCubeObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_cancel_auto_extension(cube_init);
+  int rc = sqlite3_cancel_auto_extension((void(*)(void))cube_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
@@ -164,7 +164,7 @@ static int SQLITE_TCLAPI autoExtBrokenObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_auto_extension(broken_init);
+  int rc = sqlite3_auto_extension((void(*)(void))broken_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
@@ -180,7 +180,7 @@ static int SQLITE_TCLAPI cancelAutoExtBrokenObjCmd(
   int objc,
   Tcl_Obj *CONST objv[]
 ){
-  int rc = sqlite3_cancel_auto_extension(broken_init);
+  int rc = sqlite3_cancel_auto_extension((void(*)(void))broken_init);
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return SQLITE_OK;
 }
diff --git a/src/test_func.c b/src/test_func.c
index 6bfa862464..26f0d369ef 100644
--- a/src/test_func.c
+++ b/src/test_func.c
@@ -25,7 +25,6 @@
 #include "sqliteInt.h"
 #include "vdbeInt.h"
 
-
 /*
 ** Allocate nByte bytes of space using sqlite3_malloc(). If the
 ** allocation fails, call sqlite3_result_error_nomem() to notify
@@ -704,9 +703,9 @@ static int SQLITE_TCLAPI autoinstall_test_funcs(
   Tcl_Obj *CONST objv[]
 ){
   extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
-  int rc = sqlite3_auto_extension(registerTestFunctions);
+  int rc = sqlite3_auto_extension((void(*)(void))registerTestFunctions);
   if( rc==SQLITE_OK ){
-    rc = sqlite3_auto_extension(Md5_Register);
+    rc = sqlite3_auto_extension((void(*)(void))Md5_Register);
   }
   Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
   return TCL_OK;
@@ -791,6 +790,7 @@ abuse_err:
   return TCL_ERROR;
 }
 
+
 /*
 ** Register commands with the TCL interpreter.
 */
@@ -809,7 +809,7 @@ int Sqlitetest_func_Init(Tcl_Interp *interp){
     Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, 0, 0);
   }
   sqlite3_initialize();
-  sqlite3_auto_extension(registerTestFunctions);
-  sqlite3_auto_extension(Md5_Register);
+  sqlite3_auto_extension((void(*)(void))registerTestFunctions);
+  sqlite3_auto_extension((void(*)(void))Md5_Register);
   return TCL_OK;
 }
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index a7820975d6..1027aa1326 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -1197,7 +1197,7 @@ int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){
   gMultiplex.sIoMethodsV2.xShmUnmap = multiplexShmUnmap;
   sqlite3_vfs_register(&gMultiplex.sThisVfs, makeDefault);
 
-  sqlite3_auto_extension(multiplexFuncInit);
+  sqlite3_auto_extension((void(*)(void))multiplexFuncInit);
 
   return SQLITE_OK;
 }
diff --git a/src/test_thread.c b/src/test_thread.c
index 927fee1f56..20b4cf148b 100644
--- a/src/test_thread.c
+++ b/src/test_thread.c
@@ -280,7 +280,7 @@ static int SQLITE_TCLAPI sqlthread_open(
   const char *zFilename;
   sqlite3 *db;
   char zBuf[100];
-  extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
+  extern int Md5_Register(sqlite3*,char**,const sqlite3_api_routines*);
 
   UNUSED_PARAMETER(clientData);
   UNUSED_PARAMETER(objc);

From 8ef24b8debb430e0f22d65ffeba018e576be4ee6 Mon Sep 17 00:00:00 2001
From: drh 
Date: Mon, 1 Aug 2016 15:00:00 +0000
Subject: [PATCH 03/10] Update releasetest.tcl to automatically do one round of
 tests with USE_STDCALL=1 when running on Windows with MSVC.

FossilOrigin-Name: a6a112de485eb9d15f6fa75568dcb876f00abb64
---
 manifest             | 12 ++++++------
 manifest.uuid        |  2 +-
 test/releasetest.tcl |  9 +++++++++
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/manifest b/manifest
index 76e84155ee..67dc23aac2 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\smaking\sunnecessary\schanges\sto\sthe\ssignatures\sof\sthe\nsqlite3_auto_extension()\sand\ssqlite3_cancel_auto_extension()\sinterfaces.
-D 2016-08-01T14:35:48.519
+C Update\sreleasetest.tcl\sto\sautomatically\sdo\sone\sround\sof\stests\swith\nUSE_STDCALL=1\swhen\srunning\son\sWindows\swith\sMSVC.
+D 2016-08-01T15:00:00.879
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -1010,7 +1010,7 @@ F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
 F test/regexp2.test aa7ffcc21350007a78361b82bcf3b74d12227144
 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
-F test/releasetest.tcl 3a66c7b8fbe55bcd97c907217c3d812d1d3c6b93
+F test/releasetest.tcl 53560b838b79c468ec9973e0dfa3d8892628887f
 F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
 F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
 F test/rollback2.test 8435d6ff0f13f51d2a4181c232e706005fa90fc5
@@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 390a38a142d36d2c57b3f21aab72edcde450125d
-R 65e7d16d0e1a0cbde00eb39308479bd3
+P b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6
+R 8c53f29684f1c5a6b809ef407293ad87
 U drh
-Z ed98f4241335140747349246aea331ad
+Z efd5176c6b70600d1d70a952504ac1b9
diff --git a/manifest.uuid b/manifest.uuid
index 6b01792124..45a5d2cc7d 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6
\ No newline at end of file
+a6a112de485eb9d15f6fa75568dcb876f00abb64
\ No newline at end of file
diff --git a/test/releasetest.tcl b/test/releasetest.tcl
index e13a3d7340..f670c8bef4 100644
--- a/test/releasetest.tcl
+++ b/test/releasetest.tcl
@@ -58,6 +58,10 @@ array set ::Configs [strip_comments {
     -DSQLITE_ENABLE_STAT4
     --enable-session
   }
+  "Stdcall" {
+    -DUSE_STDCALL=1
+    -O2
+  }
   "Have-Not" {
     # The "Have-Not" configuration sets all possible -UHAVE_feature options
     # in order to verify that the code works even on platforms that lack
@@ -298,10 +302,12 @@ array set ::Platforms [strip_comments {
     "Apple"                   "threadtest fulltest"
   }
   "Windows NT-intel" {
+    "Stdcall"                 test
     "Have-Not"                test
     "Default"                 "mptest fulltestonly"
   }
   "Windows NT-amd64" {
+    "Stdcall"                 test
     "Have-Not"                test
     "Default"                 "mptest fulltestonly"
   }
@@ -725,6 +731,9 @@ proc makeCommand { targets makeOpts cflags opts } {
     set nmakeDir [file nativename $::SRCDIR]
     set nmakeFile [file nativename [file join $nmakeDir Makefile.msc]]
     lappend result nmake /f $nmakeFile TOP=$nmakeDir
+    if {[regexp {USE_STDCALL=1} $cflags]} {
+      lappend result USE_STDCALL=1
+    }
   } else {
     lappend result make
   }

From d7d19b7137b659537dc4bc0622f6cc88384e008f Mon Sep 17 00:00:00 2001
From: dan 
Date: Mon, 1 Aug 2016 16:50:50 +0000
Subject: [PATCH 04/10] Add an extra compiler switch to loadext.test to ensure
 that it picks up the correct version of sqlite3.h when building a test
 extension.

FossilOrigin-Name: e57fa6af32a1d1bf7be64b26850730f7e714b6c6
---
 manifest          | 14 +++++++-------
 manifest.uuid     |  2 +-
 test/loadext.test |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/manifest b/manifest
index 67dc23aac2..ad8c64f8c0 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\sreleasetest.tcl\sto\sautomatically\sdo\sone\sround\sof\stests\swith\nUSE_STDCALL=1\swhen\srunning\son\sWindows\swith\sMSVC.
-D 2016-08-01T15:00:00.879
+C Add\san\sextra\scompiler\sswitch\sto\sloadext.test\sto\sensure\sthat\sit\spicks\sup\sthe\scorrect\sversion\sof\ssqlite3.h\swhen\sbuilding\sa\stest\sextension.
+D 2016-08-01T16:50:50.941
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -889,7 +889,7 @@ F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
 F test/like3.test 3608a2042b6f922f900fbfd5d3ce4e7eca57f7c4
 F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
 F test/limit2.test 55c9f4d08c89311e00afd75045ee1a2aca205cb4
-F test/loadext.test 42a3b8166dfcadcb0e0c8710dc520d97c31a8b98
+F test/loadext.test d077450695ddb5c1ea3ad7d48e5f5850fe732ad9
 F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
 F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db
 F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
@@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6
-R 8c53f29684f1c5a6b809ef407293ad87
-U drh
-Z efd5176c6b70600d1d70a952504ac1b9
+P a6a112de485eb9d15f6fa75568dcb876f00abb64
+R b52843774fa6a1a75de37b3a2fbcc9cb
+U dan
+Z 4c7b22bb74a34454d19b7a6d615357b5
diff --git a/manifest.uuid b/manifest.uuid
index 45a5d2cc7d..309a3154e8 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-a6a112de485eb9d15f6fa75568dcb876f00abb64
\ No newline at end of file
+e57fa6af32a1d1bf7be64b26850730f7e714b6c6
\ No newline at end of file
diff --git a/test/loadext.test b/test/loadext.test
index e6ba21e187..24ee7a6802 100644
--- a/test/loadext.test
+++ b/test/loadext.test
@@ -81,7 +81,7 @@ if {![file exists $testextension]} {
   set testextsrc $srcdir/test_loadext.c
 
   set cmdline [concat exec gcc $gcc_shared]
-  lappend cmdline -Wall -I$srcdir -I. -g $testextsrc -o $testextension
+  lappend cmdline -Wall -I$srcdir -I. -I.. -g $testextsrc -o $testextension
   
   if {[catch $cmdline msg]} {
     puts "Skipping loadext tests: Test extension not built..."

From 4df049faec84a2287f9ec3b556da4da3f703b23d Mon Sep 17 00:00:00 2001
From: dan 
Date: Mon, 1 Aug 2016 16:57:30 +0000
Subject: [PATCH 05/10] Remove a duplicate typedef from loadext.c (remaining
 copy is in sqlite3ext.h).

FossilOrigin-Name: fd184e5a8f4577aa9a817eb55e771d8d1021b946
---
 manifest      | 12 ++++++------
 manifest.uuid |  2 +-
 src/loadext.c |  9 ---------
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/manifest b/manifest
index ad8c64f8c0..12abe5c148 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\san\sextra\scompiler\sswitch\sto\sloadext.test\sto\sensure\sthat\sit\spicks\sup\sthe\scorrect\sversion\sof\ssqlite3.h\swhen\sbuilding\sa\stest\sextension.
-D 2016-08-01T16:50:50.941
+C Remove\sa\sduplicate\stypedef\sfrom\sloadext.c\s(remaining\scopy\sis\sin\ssqlite3ext.h).
+D 2016-08-01T16:57:30.301
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -347,7 +347,7 @@ F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
 F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
 F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b
 F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
-F src/loadext.c 0ac0030646e4ec3c775b5c40d1818ec9a7e1ca95
+F src/loadext.c ab2870487f4313a69816f15cb66d6c116051d895
 F src/main.c 16c1b2114eae8804caf3a8de8cb47bf2c6d83ad3
 F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
@@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P a6a112de485eb9d15f6fa75568dcb876f00abb64
-R b52843774fa6a1a75de37b3a2fbcc9cb
+P e57fa6af32a1d1bf7be64b26850730f7e714b6c6
+R 95d57e7a20ef51e72dadff0e39b4eac0
 U dan
-Z 4c7b22bb74a34454d19b7a6d615357b5
+Z dd3eec4e4b9fe5243b233856e0e2f91d
diff --git a/manifest.uuid b/manifest.uuid
index 309a3154e8..564b2f8413 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-e57fa6af32a1d1bf7be64b26850730f7e714b6c6
\ No newline at end of file
+fd184e5a8f4577aa9a817eb55e771d8d1021b946
\ No newline at end of file
diff --git a/src/loadext.c b/src/loadext.c
index 26ba7e6491..c2125f35e2 100644
--- a/src/loadext.c
+++ b/src/loadext.c
@@ -21,15 +21,6 @@
 #include 
 
 #ifndef SQLITE_OMIT_LOAD_EXTENSION
-/*
-** This is the function signature used for all extension entry points.
-*/
-typedef int (*sqlite3_loadext_entry)(
-  sqlite3 *db,                       /* Handle to the database. */
-  char **pzErrMsg,                   /* Used to set error string on failure. */
-  const sqlite3_api_routines *pThunk /* Extension API function pointers. */
-);
-
 /*
 ** Some API routines are omitted when various features are
 ** excluded from a build of SQLite.  Substitute a NULL pointer

From b0df540d7a5537ba239d00911444096474f28ed0 Mon Sep 17 00:00:00 2001
From: drh 
Date: Mon, 1 Aug 2016 17:06:44 +0000
Subject: [PATCH 06/10] Fix other harmless compiler warnings.

FossilOrigin-Name: 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
---
 ext/misc/json1.c |  1 +
 manifest         | 18 +++++++++---------
 manifest.uuid    |  2 +-
 src/loadext.c    |  6 +++---
 src/shell.c      |  2 ++
 5 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/ext/misc/json1.c b/ext/misc/json1.c
index a9452b0191..61c52ebe61 100644
--- a/ext/misc/json1.c
+++ b/ext/misc/json1.c
@@ -1223,6 +1223,7 @@ static void jsonQuoteFunc(
   sqlite3_value **argv
 ){
   JsonString jx;
+  UNUSED_PARAM(argc);
 
   jsonInit(&jx, ctx);
   jsonAppendValue(&jx, argv[0]);
diff --git a/manifest b/manifest
index 12abe5c148..fc5ee826f4 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sa\sduplicate\stypedef\sfrom\sloadext.c\s(remaining\scopy\sis\sin\ssqlite3ext.h).
-D 2016-08-01T16:57:30.301
+C Fix\sother\sharmless\scompiler\swarnings.
+D 2016-08-01T17:06:44.553
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -212,7 +212,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
 F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25
 F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
-F ext/misc/json1.c d51a764ba43a49e191bc3536238bfab3def258ca
+F ext/misc/json1.c 9799e4252b305edcbe659329eec3ca80ed85f968
 F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
 F ext/misc/percentile.c 92699c8cd7d517ff610e6037e56506f8904dae2e
 F ext/misc/regexp.c a68d25c659bd2d893cd1215667bbf75ecb9dc7d4
@@ -347,7 +347,7 @@ F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
 F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
 F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b
 F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
-F src/loadext.c ab2870487f4313a69816f15cb66d6c116051d895
+F src/loadext.c dd7a2b77902cc66c22555aef02e1a682554b7aec
 F src/main.c 16c1b2114eae8804caf3a8de8cb47bf2c6d83ad3
 F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
@@ -384,7 +384,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
 F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598
 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
 F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4
-F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5
+F src/shell.c 79dda477be6c96eba6e952a934957ad36f87acc7
 F src/sqlite.h.in b41cf2d1deb59db570f20e8ed7ade4716c6dc613
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae
@@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P e57fa6af32a1d1bf7be64b26850730f7e714b6c6
-R 95d57e7a20ef51e72dadff0e39b4eac0
-U dan
-Z dd3eec4e4b9fe5243b233856e0e2f91d
+P fd184e5a8f4577aa9a817eb55e771d8d1021b946
+R ee6ea998e955e1020bf52b2850224f49
+U drh
+Z 082f7342c6c06c2add554ab4b05f638a
diff --git a/manifest.uuid b/manifest.uuid
index 564b2f8413..0a3df4be92 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-fd184e5a8f4577aa9a817eb55e771d8d1021b946
\ No newline at end of file
+90d2c490fc2ed4e073711b84f989ca4d496dcfb5
\ No newline at end of file
diff --git a/src/loadext.c b/src/loadext.c
index c2125f35e2..9feabbd045 100644
--- a/src/loadext.c
+++ b/src/loadext.c
@@ -684,7 +684,7 @@ int sqlite3_auto_extension(
     wsdAutoextInit;
     sqlite3_mutex_enter(mutex);
     for(i=0; i=0; i--){
-    if( wsdAutoext.aExt[i]==(void*)xInit ){
+    if( wsdAutoext.aExt[i]==xInit ){
       wsdAutoext.nExt--;
       wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
       n++;
diff --git a/src/shell.c b/src/shell.c
index e8d215b95a..18c6ef7197 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2550,6 +2550,8 @@ static int sql_trace_callback(
   void *pX
 ){
   FILE *f = (FILE*)pArg;
+  UNUSED_PARAMETER(mType);
+  UNUSED_PARAMETER(pP);
   if( f ){
     const char *z = (const char*)pX;
     int i = (int)strlen(z);

From 19eb77bbe044fec2f74ec411b745ed83598b7551 Mon Sep 17 00:00:00 2001
From: drh 
Date: Mon, 1 Aug 2016 21:17:53 +0000
Subject: [PATCH 07/10] Update the wordcount.c test program and add a new
 script "time-wordcount.sh" for additional performance testing.

FossilOrigin-Name: d8ef9f58643f13dd3d16dcde0d829ae08324f04b
---
 manifest               | 13 +++++-----
 manifest.uuid          |  2 +-
 test/time-wordcount.sh | 34 ++++++++++++++++++++++++++
 test/wordcount.c       | 54 ++++++++++++++++++++++++------------------
 4 files changed, 73 insertions(+), 30 deletions(-)
 create mode 100644 test/time-wordcount.sh

diff --git a/manifest b/manifest
index fc5ee826f4..15cc8e1381 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sother\sharmless\scompiler\swarnings.
-D 2016-08-01T17:06:44.553
+C Update\sthe\swordcount.c\stest\sprogram\sand\sadd\sa\snew\sscript\s"time-wordcount.sh"\nfor\sadditional\sperformance\stesting.
+D 2016-08-01T21:17:53.023
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -1142,6 +1142,7 @@ F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
 F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
 F test/threadtest3.c 38a612ea62854349ed66372f330a40d73c5cf956
 F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
+F test/time-wordcount.sh 8e0b0f8109367827ad5d58f5cc849705731e4b90
 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
 F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
 F test/tkt-2a5629202f.test 0521bd25658428baa26665aa53ffed9367d33af2
@@ -1416,7 +1417,7 @@ F test/without_rowid3.test aad4f9d383e199349b6c7e508a778f7dff5dff79
 F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a
 F test/without_rowid5.test 89b1c587bd92a0590e440da33e7666bf4891572a
 F test/without_rowid6.test 1f99644e6508447fb050f73697350c7ceca3392e
-F test/wordcount.c 2a0a6c0d0e8e8bbbac1f06d72a6791828c37c0cf
+F test/wordcount.c 97856eec21fd00d77da720007b1888c383f63dcf
 F test/zeroblob.test 3857870fe681b8185654414a9bccfde80b62a0fa
 F test/zerodamage.test e59a56443d6298ecf7435f618f0b27654f0c849e
 F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
@@ -1508,7 +1509,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P fd184e5a8f4577aa9a817eb55e771d8d1021b946
-R ee6ea998e955e1020bf52b2850224f49
+P 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
+R 785c152fa91bad6599d646e4e2f00927
 U drh
-Z 082f7342c6c06c2add554ab4b05f638a
+Z e82d6de7fe92cf55ce862dce0d383efb
diff --git a/manifest.uuid b/manifest.uuid
index 0a3df4be92..a4b3d0224f 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-90d2c490fc2ed4e073711b84f989ca4d496dcfb5
\ No newline at end of file
+d8ef9f58643f13dd3d16dcde0d829ae08324f04b
\ No newline at end of file
diff --git a/test/time-wordcount.sh b/test/time-wordcount.sh
new file mode 100644
index 0000000000..df9edc6f2c
--- /dev/null
+++ b/test/time-wordcount.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# This script runs the wordcount program in different ways and generates
+# an output useful for performance comparisons.
+#
+
+# Select the source text to be analyzed.
+#
+if test "x$1" = "x";
+then echo "Usage: $0 FILENAME [ARGS...]"; exit 1;
+fi
+
+# Do test runs
+#
+rm -f wcdb1.db
+./wordcount --tag A: --timer --summary wcdb1.db $* --insert
+rm -f wcdb2.db
+./wordcount --tag B: --timer --summary wcdb2.db $* --insert --without-rowid
+rm -f wcdb1.db
+./wordcount --tag C: --timer --summary wcdb1.db $* --replace
+rm -f wcdb2.db
+./wordcount --tag D: --timer --summary wcdb2.db $* --replace --without-rowid
+rm -f wcdb1.db
+./wordcount --tag E: --timer --summary wcdb1.db $* --select
+rm -f wcdb2.db
+./wordcount --tag F: --timer --summary wcdb2.db $* --select --without-rowid
+./wordcount --tag G: --timer --summary wcdb1.db $* --query
+./wordcount --tag H: --timer --summary wcdb1.db $* --query --without-rowid
+./wordcount --tag I: --timer --summary wcdb1.db $* --delete
+./wordcount --tag J: --timer --summary wcdb2.db $* --delete --without-rowid
+
+# Clean up temporary files created.
+#
+rm -f wcdb1.db wcdb2.db
diff --git a/test/wordcount.c b/test/wordcount.c
index 72aa6b2f0b..5002918c5e 100644
--- a/test/wordcount.c
+++ b/test/wordcount.c
@@ -30,6 +30,7 @@
 **     --nosync             Use PRAGMA synchronous=OFF
 **     --journal MMMM       Use PRAGMA journal_mode=MMMM
 **     --timer              Time the operation of this program
+**     --tag NAME           Tag all output using NAME.  Use only stdout.
 **
 ** Modes:
 **
@@ -82,6 +83,9 @@
 #include "sqlite3.h"
 #define ISALPHA(X) isalpha((unsigned char)(X))
 
+/* Output tag */
+char *zTag = "--";
+
 /* Return the current wall-clock time */
 static sqlite3_int64 realTime(void){
   static sqlite3_vfs *clockVfs = 0;
@@ -115,7 +119,7 @@ static void traceCallback(void *NotUsed, const char *zSql){
 ** each column separated by a single space. */
 static int printResult(void *NotUsed, int nArg, char **azArg, char **azNm){
   int i;
-  printf("--");
+  printf("%s", zTag);
   for(i=0; i
Date: Tue, 2 Aug 2016 08:45:26 +0000
Subject: [PATCH 08/10] Fix harmless compiler warnings in sqlite3_status().

FossilOrigin-Name: 7c38a79cdd42aaa45715aea330d10ca859098837
---
 manifest      | 12 ++++++------
 manifest.uuid |  2 +-
 src/status.c  |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/manifest b/manifest
index 15cc8e1381..02f0e10029 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\sthe\swordcount.c\stest\sprogram\sand\sadd\sa\snew\sscript\s"time-wordcount.sh"\nfor\sadditional\sperformance\stesting.
-D 2016-08-01T21:17:53.023
+C Fix\sharmless\scompiler\swarnings\sin\ssqlite3_status().
+D 2016-08-02T08:45:26.626
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -390,7 +390,7 @@ F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae
 F src/sqliteInt.h d6f221a5bd572df935140beda82f357c2185a77c
 F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
-F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab
+F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1
 F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
 F src/tclsqlite.c bdae822f21e229b6daced15938b6343ce44ef454
 F src/test1.c 0a0909cf7962d2359db329c08d15b90b4b6e724f
@@ -1509,7 +1509,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
-R 785c152fa91bad6599d646e4e2f00927
+P d8ef9f58643f13dd3d16dcde0d829ae08324f04b
+R 043c924e3262ae632c6a04160549d94d
 U drh
-Z e82d6de7fe92cf55ce862dce0d383efb
+Z c53a56bb9efce70acc3af43de2ff893c
diff --git a/manifest.uuid b/manifest.uuid
index a4b3d0224f..a43f3794d8 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-d8ef9f58643f13dd3d16dcde0d829ae08324f04b
\ No newline at end of file
+7c38a79cdd42aaa45715aea330d10ca859098837
\ No newline at end of file
diff --git a/src/status.c b/src/status.c
index 949908ed23..24dcad4572 100644
--- a/src/status.c
+++ b/src/status.c
@@ -158,7 +158,7 @@ int sqlite3_status64(
   return SQLITE_OK;
 }
 int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
-  sqlite3_int64 iCur, iHwtr;
+  sqlite3_int64 iCur = 0, iHwtr = 0;
   int rc;
 #ifdef SQLITE_ENABLE_API_ARMOR
   if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;

From 914b7e4238a6d777c54d26e6b75a6893dd1b95fc Mon Sep 17 00:00:00 2001
From: dan 
Date: Tue, 2 Aug 2016 11:29:16 +0000
Subject: [PATCH 09/10] Fix a problem introduced by [77948b5eceab92a7] causing
 duplicate calls to be made to the xSavepoint() method of virtual tables under
 some circumstances.

FossilOrigin-Name: e64a4173d2899acf13b73e6e28f2e164fd638a75
---
 manifest           | 16 ++++++++--------
 manifest.uuid      |  2 +-
 src/vtab.c         |  5 ++++-
 test/fts3conf.test | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 10 deletions(-)

diff --git a/manifest b/manifest
index 02f0e10029..79a50d4114 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sharmless\scompiler\swarnings\sin\ssqlite3_status().
-D 2016-08-02T08:45:26.626
+C Fix\sa\sproblem\sintroduced\sby\s[77948b5eceab92a7]\scausing\sduplicate\scalls\sto\sbe\smade\sto\sthe\sxSavepoint()\smethod\sof\svirtual\stables\sunder\ssome\scircumstances.
+D 2016-08-02T11:29:16.818
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -458,7 +458,7 @@ F src/vdbeblob.c 83d2d266383157b02e2b809350bb197e89d7895b
 F src/vdbemem.c 1ecaa5ee0caff07255f25d04e8dc88befb6f88d1
 F src/vdbesort.c 91fda3909326860382b0ca8aa251e609c6a9d62c
 F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834
-F src/vtab.c 948d2d4984219eee37a7bf427d6667e21e6eb92e
+F src/vtab.c 6fece06fdd50eb2b0673e37e627ce6710e4af5be
 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
 F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a
 F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2
@@ -746,7 +746,7 @@ F test/fts3aux2.test 7ae2b2c13aefdf4169279a27a5f51780ce57f6ba
 F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
 F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
 F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c
-F test/fts3conf.test 1c8b8adb0ab28a41b68d1514df44380bd7353402
+F test/fts3conf.test 60317efd562080e198b5bdc9fcd222ce32cf01d7
 F test/fts3corrupt.test 2710b77983cc7789295ddbffea52c1d3b7506dbb
 F test/fts3corrupt2.test 6d96efae2f8a6af3eeaf283aba437e6d0e5447ba
 F test/fts3cov.test e0fb00d8b715ddae4a94c305992dfc3ef70353d7
@@ -1509,7 +1509,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P d8ef9f58643f13dd3d16dcde0d829ae08324f04b
-R 043c924e3262ae632c6a04160549d94d
-U drh
-Z c53a56bb9efce70acc3af43de2ff893c
+P 7c38a79cdd42aaa45715aea330d10ca859098837
+R dce642e9ffc5d2b7ba510a82ce70adfa
+U dan
+Z 723af27ecacb58bb0a83305d88f4583f
diff --git a/manifest.uuid b/manifest.uuid
index a43f3794d8..003f16e3e2 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-7c38a79cdd42aaa45715aea330d10ca859098837
\ No newline at end of file
+e64a4173d2899acf13b73e6e28f2e164fd638a75
\ No newline at end of file
diff --git a/src/vtab.c b/src/vtab.c
index e81079a050..f37eb261aa 100644
--- a/src/vtab.c
+++ b/src/vtab.c
@@ -947,7 +947,10 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){
       if( rc==SQLITE_OK ){
         int iSvpt = db->nStatement + db->nSavepoint;
         addToVTrans(db, pVTab);
-        if( iSvpt ) rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, iSvpt-1);
+        if( iSvpt && pModule->xSavepoint ){
+          pVTab->iSavepoint = iSvpt;
+          rc = pModule->xSavepoint(pVTab->pVtab, iSvpt-1);
+        }
       }
     }
   }
diff --git a/test/fts3conf.test b/test/fts3conf.test
index f9698770cc..6766a95408 100644
--- a/test/fts3conf.test
+++ b/test/fts3conf.test
@@ -211,4 +211,42 @@ do_execsql_test 4.2.2 {
   INSERT INTO t01(t01) VALUES('integrity-check');
 } {}
 
+do_execsql_test 4.3.1 {
+  CREATE VIRTUAL TABLE t02 USING fts4;
+  INSERT INTO t01 VALUES('1 1 1');
+  INSERT INTO t02 VALUES('2 2 2');
+  BEGIN;
+    SAVEPOINT abc;
+      INSERT INTO t01 VALUES('a b c');
+      INSERT INTO t02 VALUES('a b c');
+    ROLLBACK TO abc;
+  COMMIT;
+}
+do_execsql_test 4.3.2 {
+  SELECT * FROM t01 WHERE t01 MATCH 'b';
+  INSERT INTO t01(t01) VALUES('integrity-check');
+} {}
+
+do_execsql_test 4.4.1 {
+  CREATE TABLE A(ID INTEGER PRIMARY KEY, AnotherID INTEGER, Notes TEXT);
+  CREATE VIRTUAL TABLE AFTS USING FTS4 (Notes);
+  CREATE TRIGGER A_DeleteTrigger AFTER DELETE ON A FOR EACH ROW BEGIN 
+    DELETE FROM AFTS WHERE rowid=OLD.ID; 
+  END;
+  CREATE TABLE B(ID INTEGER PRIMARY KEY,Notes TEXT);
+  CREATE VIRTUAL TABLE BFTS USING FTS3 (Notes);
+  CREATE TRIGGER B_DeleteTrigger AFTER DELETE ON B FOR EACH ROW BEGIN 
+    DELETE FROM BFTS WHERE rowid=OLD.ID; 
+  END;
+}
+		
+do_execsql_test 4.4.2 {
+  BEGIN TRANSACTION;
+    DELETE FROM A WHERE AnotherID=1;
+    DELETE FROM B WHERE ID=1;
+  COMMIT;
+}
+		
+
+
 finish_test

From b7203cde291ec15324bf0150484df81ba7b8bced Mon Sep 17 00:00:00 2001
From: drh 
Date: Tue, 2 Aug 2016 13:26:34 +0000
Subject: [PATCH 10/10] Updates to requirements marks.  No changes to code.

FossilOrigin-Name: b23c10ac8f65bc88a6c7d88e140217222eb4cbe5
---
 manifest        | 14 +++++++-------
 manifest.uuid   |  2 +-
 src/sqlite.h.in | 17 +++++++++--------
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/manifest b/manifest
index 79a50d4114..dcecb8eb96 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sproblem\sintroduced\sby\s[77948b5eceab92a7]\scausing\sduplicate\scalls\sto\sbe\smade\sto\sthe\sxSavepoint()\smethod\sof\svirtual\stables\sunder\ssome\scircumstances.
-D 2016-08-02T11:29:16.818
+C Updates\sto\srequirements\smarks.\s\sNo\schanges\sto\scode.
+D 2016-08-02T13:26:34.987
 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 3340e479e5221f06c3d61726f8f7efff885e4233
@@ -385,7 +385,7 @@ F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598
 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
 F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4
 F src/shell.c 79dda477be6c96eba6e952a934957ad36f87acc7
-F src/sqlite.h.in b41cf2d1deb59db570f20e8ed7ade4716c6dc613
+F src/sqlite.h.in e011dcc3942e6ddc8dd7b894e9e6702e4269161e
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae
 F src/sqliteInt.h d6f221a5bd572df935140beda82f357c2185a77c
@@ -1509,7 +1509,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 7c38a79cdd42aaa45715aea330d10ca859098837
-R dce642e9ffc5d2b7ba510a82ce70adfa
-U dan
-Z 723af27ecacb58bb0a83305d88f4583f
+P e64a4173d2899acf13b73e6e28f2e164fd638a75
+R 2f7c4e993e0eb7bb61a5a37266251c67
+U drh
+Z 9edc5e5cd5ca93c7d8faa216313b72e1
diff --git a/manifest.uuid b/manifest.uuid
index 003f16e3e2..ac57330bc6 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-e64a4173d2899acf13b73e6e28f2e164fd638a75
\ No newline at end of file
+b23c10ac8f65bc88a6c7d88e140217222eb4cbe5
\ No newline at end of file
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 27ca6ef4ad..f60ccaf55c 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -4704,12 +4704,13 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
 ** SQLite will invoke the destructor function X with parameter P exactly
 ** once, when the metadata is discarded.
 ** SQLite is free to discard the metadata at any time, including: 
    -**
  • when the corresponding function parameter changes, or -**
  • when [sqlite3_reset()] or [sqlite3_finalize()] is called for the -** SQL statement, or -**
  • when sqlite3_set_auxdata() is invoked again on the same parameter, or -**
  • during the original sqlite3_set_auxdata() call when a memory -** allocation error occurs.
)^ +**
  • ^(when the corresponding function parameter changes)^, or +**
  • ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the +** SQL statement)^, or +**
  • ^(when sqlite3_set_auxdata() is invoked again on the same +** parameter)^, or +**
  • ^(during the original sqlite3_set_auxdata() call when a memory +** allocation error occurs.)^ ** ** Note the last bullet in particular. The destructor X in ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the @@ -5670,8 +5671,8 @@ int sqlite3_load_extension( ** ** ^This interface enables or disables both the C-API ** [sqlite3_load_extension()] and the SQL function [load_extension()]. -** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..) -** to enable or disable only the C-API. +** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..) +** to enable or disable only the C-API.)^ ** ** Security warning: It is recommended that extension loading ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method