From eec556d3b79e8d2d375c5345a6ad62ba6cf0b818 Mon Sep 17 00:00:00 2001 From: shane Date: Sun, 12 Oct 2008 00:27:53 +0000 Subject: [PATCH] Added SQLITE_OMIT_DEPRECATED compile time option to leave out deprecated functions. Updated test scripts to skip tests of deprecated functions if they are compiled out. (CVS 5808) FossilOrigin-Name: ba3711acee6f4659bbf133a23d8f9f37e14d0f38 --- manifest | 40 +++++++++++++++--------------- manifest.uuid | 2 +- src/loadext.c | 18 +++++++++++++- src/main.c | 6 ++++- src/malloc.c | 4 ++- src/sqlite.h.in | 4 ++- src/sqlite3ext.h | 10 +++++++- src/test1.c | 16 ++++++++++-- src/test4.c | 4 ++- src/test7.c | 4 ++- src/test_config.c | 8 +++++- src/vdbeapi.c | 8 +++++- test/bindxfer.test | 58 +++++++++++++++++++++++--------------------- test/capi3c.test | 26 ++++++++++++-------- test/func.test | 16 ++++++------ test/shared_err.test | 6 +++-- 16 files changed, 151 insertions(+), 79 deletions(-) diff --git a/manifest b/manifest index 3ad74e60b6..297fe11321 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\smacros\stests\sso\sthat\sthe\scompiler\salways\srecognizes\sthat\sx86_64\sis\slittle\sendian.\s(CVS\s5807) -D 2008-10-11T18:11:21 +C Added\sSQLITE_OMIT_DEPRECATED\scompile\stime\soption\sto\sleave\sout\sdeprecated\sfunctions.\s\sUpdated\stest\sscripts\sto\sskip\stests\sof\sdeprecated\sfunctions\sif\sthey\sare\scompiled\sout.\s(CVS\s5808) +D 2008-10-12T00:27:53 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 7fc26e087207e7a4a7723583dbd7997477af3b13 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -117,9 +117,9 @@ F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb F src/insert.c 110cca7845ed5a66c08fdd413b02e706ae34455f F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3 -F src/loadext.c cadd5df14bcda5ef0c26d815eb609a755861923e -F src/main.c 479e3b64066ac58d9957795608b0950425877f5f -F src/malloc.c 08f39c0fbc85f363d153452fc926cbcaebbef951 +F src/loadext.c 3872457afdf25bb174fd383cb4e3e0d2a9e60552 +F src/main.c ff40f9f21c76d5062bc0bc06bd8853fc217dd170 +F src/malloc.c a213fb461b8df08aed7606f6a1e1d3452e089000 F src/mem1.c 5a529ff121c55ab067be14de00f86f6dcc4f4fb9 F src/mem2.c f87e681d0d1ed8436870d089332ed0d27d885b5c F src/mem3.c 1594f117fde4cf11a6c16521f3f30af8d04bbe68 @@ -150,26 +150,26 @@ F src/random.c a87afbd598aa877e23ac676ee92fd8ee5c786a51 F src/resolve.c 86a6f7e48ec58658576092b2289e780d6ec69992 F src/select.c d910d7350df0d918e22286c5bfd39d4ea68ec813 F src/shell.c d83b578a8ccdd3e0e7fef4388a0887ce9f810967 -F src/sqlite.h.in 2b8ef43244589ef2d8060b076adaafacda58acf8 -F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e +F src/sqlite.h.in c255878b950548a136375f3ecdfcc367026dc951 +F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqliteInt.h d828c17fb591d8f27280cd23a06ac7a962606d24 F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8 F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76 F src/table.c 22744786199c9195720c15a7a42cb97b2e2728d8 F src/tclsqlite.c 96049bd454f1547abff0a57c45f0dfa57701e076 -F src/test1.c 96331afde5bd2f64ed638c30cd9a4fea27e2bffa +F src/test1.c a7310348961945e656c096e5f91d4d87dee6b61d F src/test2.c 897528183edf2839c2a3c991d415905db56f1240 F src/test3.c e85b7ce5c28c3ce7fbdbf7f98e1467b19786c62b -F src/test4.c 41056378671e7b00e6305fa9ac6fa27e6f96f406 +F src/test4.c f79ab52d27ff49b784b631a42e2ccd52cfd5c84c F src/test5.c 162a1cea2105a2c460a3f39fa6919617b562a288 F src/test6.c 0a0304a69cfa4962a429d084c6d451ff9e4fb572 -F src/test7.c 475b1fa7e3275408b40a3cbdc9508cbdc41ffa02 +F src/test7.c b94e68c2236de76889d82b8d7d8e00ad6a4d80b1 F src/test8.c 3637439424d0d21ff2dcf9b015c30fcc1e7bcb24 F src/test9.c 904ebe0ed1472d6bad17a81e2ecbfc20017dc237 F src/test_async.c 45024094ed7cf780c5d5dccda645145f95cf78ef F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad F src/test_btree.c d7b8716544611c323860370ee364e897c861f1b0 -F src/test_config.c 84004386841bb4738da0d03e372baf2f999aeda8 +F src/test_config.c bc71818f468494ff95ac1fe1f5906a21b25f937b F src/test_devsym.c 802d10e65b4217208cb47059b84adf46318bcdf4 F src/test_func.c a55c4d5479ff2eb5c0a22d4d88e9528ab59c953b F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f @@ -193,7 +193,7 @@ F src/vacuum.c fd77433d0c26d3ff1eb96eab017a1787ac5aa642 F src/vdbe.c b78adf571b9abac4092c641bec148832e8f26f34 F src/vdbe.h 41c99aaad9167c1b5431993db446de74b2f71fc3 F src/vdbeInt.h a20f479ec3bf41c61b0c2bd5176a9bad6b2a07ef -F src/vdbeapi.c fd2c286cee63a146d5110c11c0aa2bf3a9ebe220 +F src/vdbeapi.c 64c32499280b05fe5ec75df63efe532e066f9ff3 F src/vdbeaux.c e007aa723a059b1e5357c15420eea84095de828a F src/vdbeblob.c b0dcebfafedcf9c0addc7901ad98f6f986c08935 F src/vdbefifo.c 20fda2a7c4c0bcee1b90eb7e545fefcdbf2e1de7 @@ -228,7 +228,7 @@ F test/between.test 16b1776c6323faadb097a52d673e8e3d8be7d070 F test/bigfile.test 9a6a8346e4042d9c781ed6cb6553ac871ae30618 F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747 F test/bind.test 1134441f1ea47abd1c740090435a6ecbe9ceb263 -F test/bindxfer.test 995d2cf8df61204d748cde6960443121c4ccd2e1 +F test/bindxfer.test d4f573750e06c34ef2309acb95ad57da1d3c983f F test/bitvec.test 62a512c3f7041d1df12558eb25990e5a19820571 F test/blob.test 2a38d867bdf08f9ce081776acec1ac8d4bca66be F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0 @@ -236,7 +236,7 @@ F test/cache.test 3ff445c445742a7b6b9ba6e1d62a25263f9424b9 F test/capi2.test 36f87803c811b5986dd31eb5492cb704552776b4 F test/capi3.test ffc1156d1f28738eb335df0b88dd294bb3c94c27 F test/capi3b.test 664eb55318132f292f2c436f90906f578cad6b97 -F test/capi3c.test 208713e5f3a63442c3574c55b83baa7cf8ac5f28 +F test/capi3c.test 440ba10acccb74c0f160d7462a93abd1dc328224 F test/capi3d.test 57d83b690d7364bde02cddbf8339a4b50d80ce23 F test/cast.test ce8f14fc80f70b30ed984480cc0d8914a459e8f9 F test/check.test 024ed399600b799160378cf9d9f436bdf5dfd184 @@ -352,7 +352,7 @@ F test/fts3c.test 4c7ef29b37aca3e8ebb6a39b57910caa6506034e F test/fts3d.test d92a47fe8ed59c9e53d2d8e6d2685bb380aadadc F test/fts3e.test 1f6c6ac9cc8b772ca256e6b22aaeed50c9350851 F test/fts3near.test e8a9b4e16c63a795918b334b74d4aec14815bf8b -F test/func.test 628dc9b321fc66dd6d055fca6525e157004744e1 +F test/func.test a50f0a4b69ac251debe1dce3ba29da7476dc8c52 F test/fuzz.test 62fc19dd36a427777fd671b569df07166548628a F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb F test/fuzz3.test 3856b9340b801671424ff0c581ef74342962aa7d @@ -490,7 +490,7 @@ F test/shared.test b9f3bbd3ba727c5f1f8c815b7d0199262aacf214 F test/shared2.test 0ee9de8964d70e451936a48c41cb161d9134ccf4 F test/shared3.test 9c880afc081d797da514ef64bccf36f3fce2f09c F test/shared4.test d0fadacb50bb6981b2fb9dc6d1da30fa1edddf83 -F test/shared_err.test ca197017cb84146a99937fc3183b4c9371bf0b4b +F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329 F test/soak.test 3c317b3e55e1160731030c8e865d1858fab66fea @@ -648,7 +648,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 311003aff85e6b6c47e854d33f46eee31da6f30c -R 73a9bcebaefbf1a7c969de4fbf89d37e -U drh -Z 624824476110295867c015cb7a9f3885 +P b201e7093c7c47b23b0f17a0890a344f3792d6d3 +R c254d73c09e9aab13a470ce7437a888c +U shane +Z 6a75c2c0b434bdddb87ff679fa44ad65 diff --git a/manifest.uuid b/manifest.uuid index fdafa3c5cd..da734fd5c0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b201e7093c7c47b23b0f17a0890a344f3792d6d3 \ No newline at end of file +ba3711acee6f4659bbf133a23d8f9f37e14d0f38 \ No newline at end of file diff --git a/src/loadext.c b/src/loadext.c index 47258c7d10..517eed005a 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -12,7 +12,7 @@ ** This file contains code used to dynamically load extensions into ** the SQLite library. ** -** $Id: loadext.c,v 1.55 2008/10/07 15:25:48 drh Exp $ +** $Id: loadext.c,v 1.56 2008/10/12 00:27:53 shane Exp $ */ #ifndef SQLITE_CORE @@ -124,7 +124,11 @@ */ static const sqlite3_api_routines sqlite3Apis = { sqlite3_aggregate_context, +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_aggregate_count, +#else + 0, +#endif sqlite3_bind_blob, sqlite3_bind_double, sqlite3_bind_int, @@ -179,7 +183,11 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_errmsg, sqlite3_errmsg16, sqlite3_exec, +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_expired, +#else + 0, +#endif sqlite3_finalize, sqlite3_free, sqlite3_free_table, @@ -219,10 +227,18 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_snprintf, sqlite3_step, sqlite3_table_column_metadata, +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_thread_cleanup, +#else + 0, +#endif sqlite3_total_changes, sqlite3_trace, +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_transfer_bindings, +#else + 0, +#endif sqlite3_update_hook, sqlite3_user_data, sqlite3_value_blob, diff --git a/src/main.c b/src/main.c index 1e6d2d5bf0..a3098579b8 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.507 2008/10/11 15:38:30 drh Exp $ +** $Id: main.c,v 1.508 2008/10/12 00:27:53 shane Exp $ */ #include "sqliteInt.h" #include @@ -1802,6 +1802,7 @@ int sqlite3_collation_needed16( #endif /* SQLITE_OMIT_UTF16 */ #ifndef SQLITE_OMIT_GLOBALRECOVER +#ifndef SQLITE_OMIT_DEPRECATED /* ** This function is now an anachronism. It used to be used to recover from a ** malloc() failure, but SQLite now does this automatically. @@ -1810,6 +1811,7 @@ int sqlite3_global_recover(void){ return SQLITE_OK; } #endif +#endif /* ** Test to see whether or not the database connection is in autocommit @@ -1834,6 +1836,7 @@ int sqlite3Corrupt(void){ } #endif +#ifndef SQLITE_OMIT_DEPRECATED /* ** This is a convenience routine that makes sure that all thread-specific ** data for this thread has been deallocated. @@ -1843,6 +1846,7 @@ int sqlite3Corrupt(void){ */ void sqlite3_thread_cleanup(void){ } +#endif /* ** Return meta information about a specific column of a database table. diff --git a/src/malloc.c b/src/malloc.c index 9497605538..58a93128cb 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.44 2008/10/11 17:35:16 drh Exp $ +** $Id: malloc.c,v 1.45 2008/10/12 00:27:53 shane Exp $ */ #include "sqliteInt.h" #include @@ -196,6 +196,7 @@ int sqlite3MemoryAlarm( return SQLITE_OK; } +#ifndef SQLITE_OMIT_DEPRECATED /* ** Deprecated external interface. Internal/core SQLite code ** should call sqlite3MemoryAlarm. @@ -207,6 +208,7 @@ int sqlite3_memory_alarm( ){ return sqlite3MemoryAlarm(xCallback, pArg, iThreshold); } +#endif /* ** Trigger the alarm diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 4b72b72112..6b60e7dd7d 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -30,7 +30,7 @@ ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** -** @(#) $Id: sqlite.h.in,v 1.403 2008/10/10 23:48:26 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.404 2008/10/12 00:27:54 shane Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -4125,12 +4125,14 @@ int sqlite3_create_function16( ** the use of these functions. To help encourage people to avoid ** using these functions, we are not going to tell you want they do. */ +#ifndef SQLITE_OMIT_DEPRECATED SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_global_recover(void); SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64); +#endif /* ** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} diff --git a/src/sqlite3ext.h b/src/sqlite3ext.h index 5071eef3be..5526646646 100644 --- a/src/sqlite3ext.h +++ b/src/sqlite3ext.h @@ -15,7 +15,7 @@ ** as extensions by SQLite should #include this file instead of ** sqlite3.h. ** -** @(#) $Id: sqlite3ext.h,v 1.24 2008/06/30 15:09:29 danielk1977 Exp $ +** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $ */ #ifndef _SQLITE3EXT_H_ #define _SQLITE3EXT_H_ @@ -208,7 +208,9 @@ struct sqlite3_api_routines { */ #ifndef SQLITE_CORE #define sqlite3_aggregate_context sqlite3_api->aggregate_context +#ifndef SQLITE_OMIT_DEPRECATED #define sqlite3_aggregate_count sqlite3_api->aggregate_count +#endif #define sqlite3_bind_blob sqlite3_api->bind_blob #define sqlite3_bind_double sqlite3_api->bind_double #define sqlite3_bind_int sqlite3_api->bind_int @@ -264,14 +266,18 @@ struct sqlite3_api_routines { #define sqlite3_errmsg sqlite3_api->errmsg #define sqlite3_errmsg16 sqlite3_api->errmsg16 #define sqlite3_exec sqlite3_api->exec +#ifndef SQLITE_OMIT_DEPRECATED #define sqlite3_expired sqlite3_api->expired +#endif #define sqlite3_finalize sqlite3_api->finalize #define sqlite3_free sqlite3_api->free #define sqlite3_free_table sqlite3_api->free_table #define sqlite3_get_autocommit sqlite3_api->get_autocommit #define sqlite3_get_auxdata sqlite3_api->get_auxdata #define sqlite3_get_table sqlite3_api->get_table +#ifndef SQLITE_OMIT_DEPRECATED #define sqlite3_global_recover sqlite3_api->global_recover +#endif #define sqlite3_interrupt sqlite3_api->interruptx #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid #define sqlite3_libversion sqlite3_api->libversion @@ -309,7 +315,9 @@ struct sqlite3_api_routines { #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup #define sqlite3_total_changes sqlite3_api->total_changes #define sqlite3_trace sqlite3_api->trace +#ifndef SQLITE_OMIT_DEPRECATED #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings +#endif #define sqlite3_update_hook sqlite3_api->update_hook #define sqlite3_user_data sqlite3_api->user_data #define sqlite3_value_blob sqlite3_api->value_blob diff --git a/src/test1.c b/src/test1.c index 378b90811c..fd6630d1f3 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.327 2008/10/07 23:46:38 drh Exp $ +** $Id: test1.c,v 1.328 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -1039,9 +1039,12 @@ static void legacyCountStep( ){ /* no-op */ } + +#ifndef SQLITE_OMIT_DEPRECATED static void legacyCountFinalize(sqlite3_context *context){ sqlite3_result_int(context, sqlite3_aggregate_count(context)); } +#endif /* ** Usage: sqlite3_create_aggregate DB @@ -1082,11 +1085,13 @@ static int test_create_aggregate( rc = sqlite3_create_function(db, "x_count", 1, SQLITE_UTF8, 0, 0, t1CountStep,t1CountFinalize); } +#ifndef SQLITE_OMIT_DEPRECATED if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "legacy_count", 0, SQLITE_ANY, 0, 0, legacyCountStep, legacyCountFinalize ); } +#endif if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; Tcl_SetResult(interp, (char *)t1ErrorName(rc), 0); return TCL_OK; @@ -2034,6 +2039,7 @@ static int test_expired( int objc, Tcl_Obj *CONST objv[] ){ +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_stmt *pStmt; if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", @@ -2042,6 +2048,7 @@ static int test_expired( } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; Tcl_SetObjResult(interp, Tcl_NewBooleanObj(sqlite3_expired(pStmt))); +#endif return TCL_OK; } @@ -2056,6 +2063,7 @@ static int test_transfer_bind( int objc, Tcl_Obj *CONST objv[] ){ +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_stmt *pStmt1, *pStmt2; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", @@ -2066,6 +2074,7 @@ static int test_transfer_bind( if( getStmtPointer(interp, Tcl_GetString(objv[2]), &pStmt2)) return TCL_ERROR; Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_transfer_bindings(pStmt1,pStmt2))); +#endif return TCL_OK; } @@ -3756,6 +3765,7 @@ static int test_global_recover( Tcl_Obj *CONST objv[] ){ #ifndef SQLITE_OMIT_GLOBALRECOVER +#ifndef SQLITE_OMIT_DEPRECATED int rc; if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); @@ -3763,6 +3773,7 @@ static int test_global_recover( } rc = sqlite3_global_recover(); Tcl_SetResult(interp, (char *)t1ErrorName(rc), TCL_STATIC); +#endif #endif return TCL_OK; } @@ -4139,11 +4150,12 @@ static int test_thread_cleanup( int objc, Tcl_Obj *CONST objv[] ){ +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_thread_cleanup(); +#endif return TCL_OK; } - /* ** Usage: sqlite3_pager_refcounts DB ** diff --git a/src/test4.c b/src/test4.c index de5d3a2e3c..c51d2a6405 100644 --- a/src/test4.c +++ b/src/test4.c @@ -11,7 +11,7 @@ ************************************************************************* ** Code for testing the the SQLite library in a multithreaded environment. ** -** $Id: test4.c,v 1.23 2008/07/28 19:34:54 drh Exp $ +** $Id: test4.c,v 1.24 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -96,7 +96,9 @@ static void *thread_main(void *pArg){ p->zErr = 0; } p->completed++; +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_thread_cleanup(); +#endif return 0; } diff --git a/src/test7.c b/src/test7.c index 78754bfa79..6eebc7c04c 100644 --- a/src/test7.c +++ b/src/test7.c @@ -12,7 +12,7 @@ ** Code for testing the client/server version of the SQLite library. ** Derived from test4.c. ** -** $Id: test7.c,v 1.12 2008/07/28 19:34:54 drh Exp $ +** $Id: test7.c,v 1.13 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -118,7 +118,9 @@ static void *client_main(void *pArg){ p->zErr = 0; } p->completed++; +#ifndef SQLITE_OMIT_DEPRECATED sqlite3_thread_cleanup(); +#endif return 0; } diff --git a/src/test_config.c b/src/test_config.c index 4780f640a5..2bbb3b6f1b 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -16,7 +16,7 @@ ** The focus of this file is providing the TCL testing layer ** access to compile-time constants. ** -** $Id: test_config.c,v 1.41 2008/10/11 17:06:04 drh Exp $ +** $Id: test_config.c,v 1.42 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteLimit.h" @@ -213,6 +213,12 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY); #endif +#ifdef SQLITE_OMIT_DEPRECATED + Tcl_SetVar2(interp, "sqlite_options", "deprecated", "0", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "deprecated", "1", TCL_GLOBAL_ONLY); +#endif + #ifdef SQLITE_OMIT_DISKIO Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY); #else diff --git a/src/vdbeapi.c b/src/vdbeapi.c index f7b989a344..ff05ba529c 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -13,7 +13,7 @@ ** This file contains code use to implement APIs that are part of the ** VDBE. ** -** $Id: vdbeapi.c,v 1.145 2008/10/07 23:46:38 drh Exp $ +** $Id: vdbeapi.c,v 1.146 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -174,6 +174,7 @@ int vdbeReprepare(Vdbe *p){ #endif +#ifndef SQLITE_OMIT_DEPRECATED /* ** Return TRUE (non-zero) of the statement supplied as an argument needs ** to be recompiled. A statement needs to be recompiled whenever the @@ -186,6 +187,7 @@ int sqlite3_expired(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe*)pStmt; return p==0 || p->expired; } +#endif /* ** The following routine destroys a virtual machine that is created by @@ -695,6 +697,7 @@ failed: } } +#ifndef SQLITE_OMIT_DEPRECATED /* ** Return the number of times the Step function of a aggregate has been ** called. @@ -708,6 +711,7 @@ int sqlite3_aggregate_count(sqlite3_context *p){ assert( p && p->pFunc && p->pFunc->xStep ); return p->pMem->n; } +#endif /* ** Return the number of columns in the result set for the statement pStmt. @@ -1250,6 +1254,7 @@ int sqlite3TransferBindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ return rc; } +#ifndef SQLITE_OMIT_DEPRECATED /* ** Deprecated external interface. Internal/core SQLite code ** should call sqlite3TransferBindings. @@ -1257,6 +1262,7 @@ int sqlite3TransferBindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ return sqlite3TransferBindings(pFromStmt, pToStmt); } +#endif /* ** Return the sqlite3* database handle to which the prepared statement given diff --git a/test/bindxfer.test b/test/bindxfer.test index 303db24eb5..266993542b 100644 --- a/test/bindxfer.test +++ b/test/bindxfer.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_transfer_bindings() API. # -# $Id: bindxfer.test,v 1.5 2008/03/17 16:23:27 drh Exp $ +# $Id: bindxfer.test,v 1.6 2008/10/12 00:27:54 shane Exp $ # set testdir [file dirname $argv0] @@ -50,33 +50,35 @@ do_test bindxfer-1.3 { do_test bindxfer-1.4 { sqlite3_bind_parameter_count $VM2 } 3 -do_test bindxfer-1.5 { - sqlite_bind $VM1 1 one normal - set sqlite_static_bind_value two - sqlite_bind $VM1 2 {} static - sqlite_bind $VM1 3 {} null - sqlite3_transfer_bindings $VM1 $VM2 - sqlite_step $VM1 VALUES COLNAMES -} SQLITE_ROW -do_test bindxfer-1.6 { - set VALUES -} {{} {} {}} -do_test bindxfer-1.7 { - sqlite_step $VM2 VALUES COLNAMES -} SQLITE_ROW -do_test bindxfer-1.8 { - set VALUES -} {one two {}} -do_test bindxfer-1.9-misuse { - catch {sqlite3_finalize $VM1} - catch {sqlite3_finalize $VM2} - sqlite3_transfer_bindings $VM1 $VM2 -} 21 ;# SQLITE_MISUSE -do_test bindxfer-1.10 { - set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL] - set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL] - sqlite3_transfer_bindings $VM1 $VM2 -} 1 ;# SQLITE_ERROR +ifcapable deprecated { + do_test bindxfer-1.5 { + sqlite_bind $VM1 1 one normal + set sqlite_static_bind_value two + sqlite_bind $VM1 2 {} static + sqlite_bind $VM1 3 {} null + sqlite3_transfer_bindings $VM1 $VM2 + sqlite_step $VM1 VALUES COLNAMES + } SQLITE_ROW + do_test bindxfer-1.6 { + set VALUES + } {{} {} {}} + do_test bindxfer-1.7 { + sqlite_step $VM2 VALUES COLNAMES + } SQLITE_ROW + do_test bindxfer-1.8 { + set VALUES + } {one two {}} + do_test bindxfer-1.9-misuse { + catch {sqlite3_finalize $VM1} + catch {sqlite3_finalize $VM2} + sqlite3_transfer_bindings $VM1 $VM2 + } 21 ;# SQLITE_MISUSE + do_test bindxfer-1.10 { + set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL] + set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL] + sqlite3_transfer_bindings $VM1 $VM2 + } 1 ;# SQLITE_ERROR +} catch {sqlite3_finalize $VM1} catch {sqlite3_finalize $VM2} diff --git a/test/capi3c.test b/test/capi3c.test index cf1a6a99a7..dcf3d68a58 100644 --- a/test/capi3c.test +++ b/test/capi3c.test @@ -13,7 +13,7 @@ # This is a copy of the capi3.test file that has been adapted to # test the new sqlite3_prepare_v2 interface. # -# $Id: capi3c.test,v 1.19 2008/05/05 16:56:35 drh Exp $ +# $Id: capi3c.test,v 1.20 2008/10/12 00:27:54 shane Exp $ # set testdir [file dirname $argv0] @@ -1168,15 +1168,19 @@ do_test capi3c-19.4 { do_test capi3c-19.4.1 { sqlite3_errmsg $DB } {no such table: t3} -do_test capi3c-19.4.2 { - sqlite3_expired $STMT -} 1 +ifcapable deprecated { + do_test capi3c-19.4.2 { + sqlite3_expired $STMT + } 1 +} do_test capi3c-19.4.3 { sqlite3_errmsg $DB } {no such table: t3} -do_test capi3c-19.4.4 { - sqlite3_expired 0 -} 1 +ifcapable deprecated { + do_test capi3c-19.4.4 { + sqlite3_expired 0 + } 1 +} do_test capi3c-19.5 { sqlite3_reset $STMT db eval { @@ -1185,9 +1189,11 @@ do_test capi3c-19.5 { } sqlite3_step $STMT } SQLITE_ROW -do_test capi3c-19.5.2 { - sqlite3_expired $STMT -} 0 +ifcapable deprecated { + do_test capi3c-19.5.2 { + sqlite3_expired $STMT + } 0 +} do_test capi3c-19.6 { sqlite3_column_int $STMT 1 } 2 diff --git a/test/func.test b/test/func.test index b61593f7fb..3aaf82bf3d 100644 --- a/test/func.test +++ b/test/func.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing built-in functions. # -# $Id: func.test,v 1.86 2008/08/04 03:51:24 danielk1977 Exp $ +# $Id: func.test,v 1.87 2008/10/12 00:27:54 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -918,12 +918,14 @@ do_test func-22.22 { # This is to test the deprecated sqlite3_aggregate_count() API. # -do_test func-23.1 { - sqlite3_create_aggregate db - execsql { - SELECT legacy_count() FROM t6; - } -} {3} +ifcapable deprecated { + do_test func-23.1 { + sqlite3_create_aggregate db + execsql { + SELECT legacy_count() FROM t6; + } + } {3} +} # The group_concat() function. # diff --git a/test/shared_err.test b/test/shared_err.test index c6f046c062..f501fc70d9 100644 --- a/test/shared_err.test +++ b/test/shared_err.test @@ -13,7 +13,7 @@ # cache context. What happens to connection B if one connection A encounters # an IO-error whilst reading or writing the file-system? # -# $Id: shared_err.test,v 1.23 2008/09/29 14:12:57 danielk1977 Exp $ +# $Id: shared_err.test,v 1.24 2008/10/12 00:27:54 shane Exp $ proc skip {args} {} @@ -362,7 +362,9 @@ do_malloc_test shared_err-5 -tclbody { do_malloc_test shared_err-6 -tclbody { catch {db close} - sqlite3_thread_cleanup + ifcapable deprecated { + sqlite3_thread_cleanup + } sqlite3_enable_shared_cache 0 } -cleanup { sqlite3_enable_shared_cache 1