diff --git a/Makefile.in b/Makefile.in index f3e04a9b9d..3428df3f6c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -186,11 +186,16 @@ gdbmdump: $(TOP)/tool/gdbmdump.c $(TCC) $(GDBM_FLAGS) -o gdbmdump $(TOP)/tool/gdbmdump.c $(LIBGDBM) tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.a - $(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \ + $(TCC) $(TCL_FLAGS) -DTCLSH=1 -o sqlite_tester \ $(TOP)/src/tclsqlite.c libsqlite.a $(LIBGDBM) $(LIBTCL) -test: tclsqlite sqlite - ./tclsqlite $(TOP)/test/all.test +sqlite_tester: $(TOP)/src/tclsqlite.c libsqlite.a $(TOP)/src/test1.c + $(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST1=1 -o sqlite_tester \ + $(TOP)/src/test1.c $(TOP)/src/tclsqlite.c \ + libsqlite.a $(LIBGDBM) $(LIBTCL) + +test: sqlite_tester sqlite + ./sqlite_tester $(TOP)/test/all.test sqlite.tar.gz: pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite diff --git a/VERSION b/VERSION index 475bda9cf5..94956151c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.30 +1.0.31 diff --git a/manifest b/manifest index 2fdcd473be..ca68d1c0eb 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Version\s1.0.30\s(CVS\s473) -D 2001-04-06T16:20:00 +C Added\snew\stests\s(CVS\s206) +D 2001-04-07T15:24:33 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 -F Makefile.in 25791375ce9f4f5b57d4cab67f0d58d772c96451 +F Makefile.in 4775f7fd1ed543606bb24fa3fada1bc90a23a6b9 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 -F VERSION 2670c932365e633f8552540db172fac18bd09b3a +F VERSION 71874cb7e2a53c2bd22bb6affa7d223dd94a7a13 F configure 260d3be664b6d9b4d2d985e66b6dae1ef723c86e x F configure.in 6940e3f88bf3d28a10c73b06ab99fd3a7e039a61 F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47 @@ -33,10 +33,11 @@ F src/random.c b36c3f57dc80c8f354e6bfbf39cf1e1de021d54a F src/select.c a6bfdaa92d4614e79bf18129283c5163faa291fc F src/shell.c c1785b4af18192056adbe894f8626a7e7bdf47aa F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e -F src/sqlite.h.in 182336b2763d15d31ffd9ac1112e6ddd190c02e4 -F src/sqliteInt.h 97e2dd488ab433e27eda6e26f4c84a9a2684785c +F src/sqlite.h.in 3e5906f72608f0fd4394dfbb1d7e8d35b8353677 +F src/sqliteInt.h 054c00c2b3deaedf4034b85d69287abeb4c15c96 F src/table.c 5be76051a8ed6f6bfa641f4adc52529efa34fbf9 -F src/tclsqlite.c 8b30b01d9fb814a5a358dafd697de16d968cb73e +F src/tclsqlite.c 83dcbf015ea0319c2a97514b8b812a12d621e40a +F src/test1.c 7d88c76725ce5b881cff2a283662fe068d792002 F src/tokenize.c 8fc3936eefad84f1fff19e0892ed0542eb9ac7b3 F src/update.c 8365b3922ea098330d1e20862d6e64911e4e03d0 F src/util.c aec315b834bad444c9e0e90efd9d2eaeeb37c90c @@ -55,6 +56,7 @@ F test/insert.test dbd3bd189edb61fddbe66c236694ef23352429f1 F test/insert2.test 732405e30331635af8d159fccabe835eea5cd0c6 F test/lock.test bca7d53de73138b1f670a2fbdb1f481ff7eaa45a F test/main.test da635f9e078cd21ddf074e727381a715064489ff +F test/printf.test 18e44e4e154e13cba74d67b85202172d37ddb5ed F test/rowid.test 128453599def7435e988216f7fe89c7450b8a9a3 F test/select1.test 824d9d5007dffd6a45edde79e89c0a04c36e3ebe F test/select2.test 04ac3bd69298f58c7d0883159bab42ab9ad6021c @@ -64,6 +66,7 @@ F test/select5.test e2b9d51d88cbd6c307c2c05b0ef55fe7ba811ac2 F test/sort.test 838cd862642ed9a2c47e1a17b5c33da452b4552e F test/subselect.test bf8b251a92fb091973c1c469ce499dc9648a41d5 F test/table.test c1704fead1af27d67850a934d531848ce5bee4a7 +F test/tableapi.test 9ecb98590d1b6ebcb4b791697bd5275e73bba530 F test/tclsqlite.test d2aa55926874783b2401f0146e839f773c6796e1 F test/tester.tcl dba25c97cc89f109a9350f12792f17b24202d65f F test/trans.test 82556605d48f56ad4679e95478d70546a763f26a @@ -83,7 +86,7 @@ F www/arch.fig 4f246003b7da23bd63b8b0af0618afb4ee3055c8 F www/arch.png 8dae0766d42ed3de9ed013c1341a5792bcf633e6 F www/arch.tcl a40380c1fe0080c43e6cc5c20ed70731511b06be F www/c_interface.tcl ddca19005c47dd5a15882addc02fff5de83d8ed9 -F www/changes.tcl a522ee29c7e66205e76a2c34f3dc1363e251bfda +F www/changes.tcl 64e5779a681bda4b34d0403c33aaf8902d8cf056 F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c F www/fileformat.tcl cfb7fba80b7275555281ba2f256c00734bcdd1c9 @@ -94,7 +97,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2 F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad -P 5b65746383c509048c80b7aff536d1204fd1d127 -R f07b6ba51358f496162e586514c5cd88 +P 8f0d98193e4ba913fa31d5f8d5adc46ad9d346a1 +R b4947cdaa9daf5e442bdf2c2d5dbb11c U drh -Z ad8ecefbe3c2d25277befbe640696a09 +Z 46e79499f1b58c1b58c6255886d7f82a diff --git a/manifest.uuid b/manifest.uuid index 99c8bd5c04..153fed2cfe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8f0d98193e4ba913fa31d5f8d5adc46ad9d346a1 \ No newline at end of file +2507ec40610d8034ccf9dcb58a16934065e6f120 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 425c293c83..b606dae830 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -24,7 +24,7 @@ ** This header file defines the interface that the sqlite library ** presents to client programs. ** -** @(#) $Id: sqlite.h.in,v 1.12 2001/04/06 16:13:43 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.13 2001/04/07 15:24:33 drh Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ @@ -342,5 +342,4 @@ int sqlite_get_table_vprintf( va_list ap /* Arguments to the format string */ ); - #endif /* _SQLITE_H_ */ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 04de020795..c78ba21746 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -23,7 +23,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.39 2001/04/04 21:10:19 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.40 2001/04/07 15:24:33 drh Exp $ */ #include "sqlite.h" #include "dbbe.h" @@ -432,3 +432,4 @@ char *sqliteDbbeNameToFile(const char*,const char*,const char*); void sqliteBeginTransaction(Parse*); void sqliteCommitTransaction(Parse*); void sqliteRollbackTransaction(Parse*); +char *sqlite_mprintf(const char *, ...); diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 57df83b86d..42c8eada55 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -23,7 +23,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.16 2001/04/06 16:13:43 drh Exp $ +** $Id: tclsqlite.c,v 1.17 2001/04/07 15:24:33 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -507,6 +507,12 @@ int TCLSH_MAIN(int argc, char **argv){ Tcl_FindExecutable(argv[0]); interp = Tcl_CreateInterp(); Sqlite_Init(interp); +#ifdef SQLITE_TEST1 + { + extern int Sqlitetest1_Init(Tcl_Interp*); + Sqlitetest1_Init(interp); + } +#endif if( argc>=2 ){ int i; Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY); diff --git a/src/test1.c b/src/test1.c new file mode 100644 index 0000000000..e976da0d86 --- /dev/null +++ b/src/test1.c @@ -0,0 +1,283 @@ +/* +** Copyright (c) 2001 D. Richard Hipp +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public +** License as published by the Free Software Foundation; either +** version 2 of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. +** +** You should have received a copy of the GNU General Public +** License along with this library; if not, write to the +** Free Software Foundation, Inc., 59 Temple Place - Suite 330, +** Boston, MA 02111-1307, USA. +** +** Author contact information: +** drh@hwaci.com +** http://www.hwaci.com/drh/ +** +************************************************************************* +** Code for testing the printf() interface to SQLite. This code +** is not included in the SQLite library. It is used for automated +** testing of the SQLite library. +** +** $Id: test1.c,v 1.1 2001/04/07 15:24:33 drh Exp $ +*/ +#include "sqliteInt.h" +#include "tcl.h" +#include +#include + +/* +** Usage: sqlite_open filename +** +** Returns: The name of an open database. +*/ +static int sqlite_test_open( + void *NotUsed, + Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ + int argc, /* Number of arguments */ + char **argv /* Text of each argument */ +){ + sqlite *db; + char *zErr = 0; + char zBuf[100]; + if( argc!=2 ){ + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " FILENAME\"", 0); + return TCL_ERROR; + } + db = sqlite_open(argv[1], 0666, &zErr); + if( db==0 ){ + Tcl_AppendResult(interp, zErr, 0); + free(zErr); + return TCL_ERROR; + } + sprintf(zBuf,"%d",(int)db); + Tcl_AppendResult(interp, zBuf, 0); + return TCL_OK; +} + +/* +** The callback routine for sqlite_exec_printf(). +*/ +static int exec_printf_cb(void *pArg, int argc, char **argv, char **name){ + Tcl_DString *str = (Tcl_DString*)pArg; + int i; + + if( Tcl_DStringLength(str)==0 ){ + for(i=0; i

    $desc

" } +chng {2001 Apr 6 (1.0.31)} { +
  • New tests added to the test suite.
  • +} + chng {2001 Apr 6 (1.0.30)} {
  • Remove the sqlite_encoding TCL variable that was introduced in the previous version.