From: drh Date: Thu, 8 Aug 2013 14:38:45 +0000 (+0000) Subject: If the SQLITE_EXTRA_INIT function is defined, make sure it is called only X-Git-Tag: version-3.8.0~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab80be99e3c96e03982056e33853ec52a34222eb;p=thirdparty%2Fsqlite.git If the SQLITE_EXTRA_INIT function is defined, make sure it is called only once by the effective sqlite3_initialize() call. FossilOrigin-Name: e2b597cafe7c8a8313b051d6a302fed54f235727 --- diff --git a/manifest b/manifest index c9e8d0b682..6cc104b469 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C If\sthe\sSQLITE_ALLOW_URI_AUTHORITY\scompile-time\soption\sis\sset,\sthen\sallow\nnon-localhost\sauthorities\son\sURI\sfilenames\sand\spass\sthem\sthrough\sas\sa\sUNC\nto\sthe\sunderlying\sVFS. -D 2013-08-07T23:15:52.266 +C If\sthe\sSQLITE_EXTRA_INIT\sfunction\sis\sdefined,\smake\ssure\sit\sis\scalled\sonly\nonce\sby\sthe\seffective\ssqlite3_initialize()\scall. +D 2013-08-08T14:38:45.404 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -185,7 +185,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c 0df0b1550b9cc1f58229644735e317ac89131f12 F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b F src/loadext.c 867c7b330b740c6c917af9956b13b81d0a048303 -F src/main.c 482135b0bf855d621ef10c5bb56c63df23b2ddec +F src/main.c f6eb795f17eb88205b55e5116fb37e6593707d82 F src/malloc.c fe085aa851b666b7c375c1ff957643dc20a04bf6 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 437c7c4af964895d4650f29881df63535caaa1fa @@ -1105,7 +1105,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 0ad83ceb79767738bd06a28840cf84da0464ab4f -R a230045986289598d392f4ac16d8f85f +P 3adb6c1bfda897859dc9cf9ae7f1e6719855ee68 +R f58cae922c11c825e7cdfcd2f4c52823 U drh -Z 3dff46ea9ed1198b77cd17bced6ea4de +Z 6adac74ecb750c6ba6eb610c8156f9d8 diff --git a/manifest.uuid b/manifest.uuid index bb59190386..cb24e03baa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3adb6c1bfda897859dc9cf9ae7f1e6719855ee68 \ No newline at end of file +e2b597cafe7c8a8313b051d6a302fed54f235727 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 9e8a6ed063..217221d238 100644 --- a/src/main.c +++ b/src/main.c @@ -117,6 +117,9 @@ char *sqlite3_data_directory = 0; int sqlite3_initialize(void){ MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ int rc; /* Result code */ +#ifdef SQLITE_EXTRA_INIT + int bRunExtraInit = 0; /* Extra initialization needed */ +#endif #ifdef SQLITE_OMIT_WSD rc = sqlite3_wsd_init(4096, 24); @@ -214,6 +217,9 @@ int sqlite3_initialize(void){ sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); sqlite3GlobalConfig.isInit = 1; +#ifdef SQLITE_EXTRA_INIT + bRunExtraInit = 1; +#endif } sqlite3GlobalConfig.inProgress = 0; } @@ -254,7 +260,7 @@ int sqlite3_initialize(void){ ** compile-time option. */ #ifdef SQLITE_EXTRA_INIT - if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){ + if( bRunExtraInit ){ int SQLITE_EXTRA_INIT(const char*); rc = SQLITE_EXTRA_INIT(0); }