From: drh Date: Thu, 15 Sep 2016 19:15:19 +0000 (+0000) Subject: Omit the sqlite3Apis constant object when compiling with X-Git-Tag: version-3.15.0~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98365be030d46d010361954f56ccc1fb108a2dc2;p=thirdparty%2Fsqlite.git Omit the sqlite3Apis constant object when compiling with SQLITE_OMIT_LOAD_EXTENSION, since it is not used. FossilOrigin-Name: 7b10461370828b9c57acaaaea518031d53986fa3 --- diff --git a/manifest b/manifest index c7c8aefbf6..2adb407a89 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sno-op\scode\s(adding\san\sassert()\sto\sprove\sthat\sthe\scode\swas\sno-op)\nin\sthe\stext\saffinity\slogic\sof\sthe\sbytecode\sengine\scomparison\soperators. -D 2016-09-15T14:54:51.441 +C Omit\sthe\ssqlite3Apis\sconstant\sobject\swhen\scompiling\swith\nSQLITE_OMIT_LOAD_EXTENSION,\ssince\sit\sis\snot\sused. +D 2016-09-15T19:15:19.226 F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc e1aa788e84f926e42239ee167c53f785bedacacd @@ -350,7 +350,7 @@ F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c 3edb5a1bda44df13531fedfcde5fbcc2fc04c222 F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e -F src/loadext.c dd7a2b77902cc66c22555aef02e1a682554b7aec +F src/loadext.c 5d6642d141c07d366e43d359e94ec9de47add41d F src/main.c 9821bb4d2399bc5a0b8a5dfc06bede2d1520255c F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 @@ -1525,7 +1525,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 12df7152109ffce4b3e0ee233c5ea8103edb902a -R 6b884a026aa6fc5e3121f8fd54dbd58f +P b9f5bdbf40ac6382e48f09ebcd53cc908e065527 +R 1e31cb38dfd2c7bbbb492df3fcbfb729 U drh -Z a5246499f87a7576d63b6cd54f036979 +Z 8ce374e092d6c15d6e5f3b801f1063a4 diff --git a/manifest.uuid b/manifest.uuid index 6179fb4208..7241c19155 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b9f5bdbf40ac6382e48f09ebcd53cc908e065527 \ No newline at end of file +7b10461370828b9c57acaaaea518031d53986fa3 \ No newline at end of file diff --git a/src/loadext.c b/src/loadext.c index 9feabbd045..6011fd2bf8 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -620,18 +620,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff){ return SQLITE_OK; } -#endif /* SQLITE_OMIT_LOAD_EXTENSION */ - -/* -** The auto-extension code added regardless of whether or not extension -** loading is supported. We need a dummy sqlite3Apis pointer for that -** code if regular extension loading is not available. This is that -** dummy pointer. -*/ -#ifdef SQLITE_OMIT_LOAD_EXTENSION -static const sqlite3_api_routines sqlite3Apis = { 0 }; -#endif - +#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */ /* ** The following object holds the list of automatically loaded @@ -775,6 +764,11 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){ char *zErrmsg; #if SQLITE_THREADSAFE sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); +#endif +#ifdef SQLITE_OMIT_LOAD_EXTENSION + const sqlite3_api_routines *pThunk = 0; +#else + const sqlite3_api_routines *pThunk = &sqlite3Apis; #endif sqlite3_mutex_enter(mutex); if( i>=wsdAutoext.nExt ){ @@ -785,7 +779,7 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){ } sqlite3_mutex_leave(mutex); zErrmsg = 0; - if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){ + if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ sqlite3ErrorWithMsg(db, rc, "automatic extension loading failed: %s", zErrmsg); go = 0;