From: drh Date: Fri, 31 May 2013 15:36:07 +0000 (+0000) Subject: Improved handling of errors when doing run-time loading of an SQLite X-Git-Tag: version-3.8.0~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6dc8cbe0d4f3aa39eb744f940fbdcea0ede260d1;p=thirdparty%2Fsqlite.git Improved handling of errors when doing run-time loading of an SQLite shared-library into TCL. FossilOrigin-Name: b3f23d186425d2362b756708cbaf422ba3c751f9 --- diff --git a/manifest b/manifest index ad8661af94..197b521b86 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Updates\sto\sthe\sCodec\sinterface\sto\ssupport\scodecs\son\sattached\sdatabases\sand\nto\sallow\srekeying\sin\sthe\smiddle\sof\sa\stransaction.\s\sThese\schanges\sare\sonly\s\napplicable\sif\sSQLite\sis\scompiled\swith\sSQLITE_HAS_CODEC. -D 2013-05-29T17:48:28.829 +C Improved\shandling\sof\serrors\swhen\sdoing\srun-time\sloading\sof\san\sSQLite\nshared-library\sinto\sTCL. +D 2013-05-31T15:36:07.208 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -224,7 +224,7 @@ F src/sqliteInt.h 46fb17f604ce941551fe64c342dbeb4dbed3edaa F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e -F src/tclsqlite.c 2ecec9937e69bc17560ad886da35195daa7261b8 +F src/tclsqlite.c b90c5175b080a7d511fb06da0ada0c3d65d20b3b F src/test1.c 6d2a340eea1d866bf7059894491652a69a7ee802 F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c @@ -1093,7 +1093,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 09e5a7ad85dc592fce868a2d0f8719c6915ccb47 -R 20090ed5100bc7738631061b2f74235f +P d5b084e9d8cfe9c0c339aca076d472bb50aa764c +R 2882afbdbc546836259a7beab1bfa1d4 U drh -Z caf68d1d5a539a495dd90cbaf5a54682 +Z ab4690d9d62a96dd945919f7fe2c1c88 diff --git a/manifest.uuid b/manifest.uuid index e0da117f05..74edec22a4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d5b084e9d8cfe9c0c339aca076d472bb50aa764c \ No newline at end of file +b3f23d186425d2362b756708cbaf422ba3c751f9 \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index f1bb2921da..325e809fab 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -3050,7 +3050,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ */ #ifndef USE_TCL_STUBS # undef Tcl_InitStubs -# define Tcl_InitStubs(a,b,c) +# define Tcl_InitStubs(a,b,c) TCL_OK #endif /* @@ -3074,19 +3074,18 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ ** The EXTERN macros are required by TCL in order to work on windows. */ EXTERN int Sqlite3_Init(Tcl_Interp *interp){ - Tcl_InitStubs(interp, "8.4", 0); - Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); - Tcl_PkgProvide(interp, "sqlite3", PACKAGE_VERSION); - + int rc = Tcl_InitStubs(interp, "8.4", 0); + if( rc==TCL_OK ){ + Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); #ifndef SQLITE_3_SUFFIX_ONLY - /* The "sqlite" alias is undocumented. It is here only to support - ** legacy scripts. All new scripts should use only the "sqlite3" - ** command. - */ - Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0); + /* The "sqlite" alias is undocumented. It is here only to support + ** legacy scripts. All new scripts should use only the "sqlite3" + ** command. */ + Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0); #endif - - return TCL_OK; + rc = Tcl_PkgProvide(interp, "sqlite3", PACKAGE_VERSION); + } + return rc; } EXTERN int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } EXTERN int Sqlite3_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; }