diff --git a/VERSION b/VERSION index a9707166ba..8fc77d0fab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.15 +1.0.17 diff --git a/manifest b/manifest index 1f556aff01..f1888f61b3 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Version\s1.0.16\s(CVS\s487) -D 2000-11-28T21:00:00 +C speed\stweaks\sand\sdocumentation\supdates\s(CVS\s167) +D 2000-12-10T18:23:50 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F Makefile.in 0b1fdafa55e1bf4d3a4f5213544130e66ef32052 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 -F VERSION 2503ef820e425375d682c88b36228a35fcaefea4 +F VERSION 2436af0010b224c49639a6ce276551a862a08115 F configure 3dc1edb9dcf60215e31ff72b447935ab62211442 x F configure.in d892ca33db7e88a055519ce2f36dcb11020e8fff F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47 @@ -11,27 +11,27 @@ F src/build.c e2ceba852dc45ca899e68a042b29c3daab011575 F src/dbbe.c 7e01384320075bf1d3e7fb54984df73435908809 F src/dbbe.h d175a04b35ea75078274e059dcbcbf7c1262d42a F src/dbbegdbm.c 4ac7222afff0cf91014803f8791740b6da825a2b -F src/dbbemem.c 60cfc71c4d170cde66aff24ab0afc041063b1cad +F src/dbbemem.c b55faed2e4719db47ade3483e85f7cb4b5fad39a F src/delete.c 4d491eaf61b515516749c7ed68fa3b2ee8a09065 F src/expr.c 7d7646afd52d1448237e5f517454cfb2d3d394d6 F src/insert.c f146f149ad2422a1dc3bfa7a1651a25940f98958 -F src/main.c 6686df1f9e88fb72c3b3fc660d4595382555fb5c +F src/main.c 52355458131977c1ac40a006ce2fe2035f39069c F src/parse.y 5d199034de5d29ebedb42c1c51f34db4df40cbe5 F src/printf.c 1efb6b3e7f28a93be57132de3f8f400d2ac1460e F src/select.c c1de8ac34131324fa05664b06b0ae1ee9c02905d F src/shell.c 146149928c7dca23ceebd6aa53026e9b02d3b4e4 F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/sqlite.h.in fd86903777f1ee7bd0465243224a0fd2100eedc8 -F src/sqliteInt.h a24c516147e6fa072f74789d636312ac279e1f35 -F src/table.c f08189678c806d8a74a70c156d7c27083760e028 +F src/sqliteInt.h ed06214fc7054e43182ac351ebde913ede708639 +F src/table.c 5be76051a8ed6f6bfa641f4adc52529efa34fbf9 F src/tclsqlite.c 178adf318eab2ff480c288a87541d4ab1c37d985 -F src/tokenize.c 95bf7baa7d829981bed81ca89080d99d2c09d463 +F src/tokenize.c 6843f1d7a5d2ee08ceb10bdecfcc8684131ffcf7 F src/update.c 51b9ef7434b15e31096155da920302e9db0d27fc -F src/util.c 811e0ad47f842c16555aaf361b26dab7221c1a6c -F src/vdbe.c a19d5cefdd3d34fa28ddd1741363f2f3199ca56a +F src/util.c 0298100e6427a4b644f767ede12276fa7170fbb6 +F src/vdbe.c a627f1df4c1eb9194137285e3f55e77ce0506c9b F src/vdbe.h 140cdec3c56f70483e169f8ae657bd90f9fd6e98 F src/where.c 3dfad2ffd0aa994d5eceac88852f7189c8d1d3c8 -F test/all.test 71d439d4d8d5bb68ca73344ce6d2b1ebb35ab7dd +F test/all.test 15cac2f6b2d4c55bf896212aff3cc9d6597b0490 F test/copy.test b77a1214bd7756f2849d5c4fa6e715c0ff0c34eb F test/dbbe.test bd2cd9fe84c6d69b6ae42ac5f55b1e940bdca886 F test/delete.test 402ee3ccb6e544582d24c573ef70b34d09583ae7 @@ -42,7 +42,7 @@ F test/index.test ee060ef8912be47ba616e50cce7985259a68d58a F test/insert.test 66f4c3bd600fec8eb1e733b928cbe6fa885eff0c F test/insert2.test 732405e30331635af8d159fccabe835eea5cd0c6 F test/lock.test f56cf41d29d2c4cbaa6239424b5b0ee844c273a0 -F test/main.test b7366cc6f3690915a11834bc1090deeff08acaf9 +F test/main.test 83cfa58b0b9b69924cc915d5c50b12f0ac9e40e7 F test/select1.test 68ff778c24fc8982e63dda37acb5b0396913adf7 F test/select2.test 0c24b9bb8825ebb96e6cc65f1eb61bace0e02aa0 F test/select3.test a9234b8424b6c6d71de534f43b91ade9be68e9cc @@ -51,7 +51,7 @@ F test/select5.test e2b9d51d88cbd6c307c2c05b0ef55fe7ba811ac2 F test/sort.test d582086c4bb7df3fbf50aa72e69d7e235e9f8e31 F test/subselect.test bf8b251a92fb091973c1c469ce499dc9648a41d5 F test/table.test eaa25951c0f18615763cd3dc248ea4bc38739c05 -F test/tester.tcl 59edb045efc11478be291182c0455b790c00043a +F test/tester.tcl 446b88283b12efb12691479a403cde15d64fbb82 F test/update.test 62f6ce99ff31756aab0ca832ff6d34c5a87b6250 F test/vacuum.test 2127748ff4ddb409212efbb6d9fb9c469ea1b49c F test/where.test bbab5a308055fb6087dc23d600b4ad2b72797397 @@ -66,7 +66,7 @@ F www/arch.fig 4f246003b7da23bd63b8b0af0618afb4ee3055c8 F www/arch.png 8dae0766d42ed3de9ed013c1341a5792bcf633e6 F www/arch.tcl a40380c1fe0080c43e6cc5c20ed70731511b06be F www/c_interface.tcl 11be2d5826eb7d6efd629751d3b483c1ed78ba14 -F www/changes.tcl c31acb39bd4e961e966ac05347a3bbffa56c576d +F www/changes.tcl 3b0abdf91bef39602876788bbf0e1c4585784363 F www/crosscompile.tcl bee79c34f6c3f162ec1c6f5294e79f73651d27ee F www/fileformat.tcl cfb7fba80b7275555281ba2f256c00734bcdd1c9 F www/index.tcl b19418d506f90968deef972bf1b427d98bdf13e0 @@ -76,7 +76,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2 F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad -P 5518e012bf35821f65fe2ca7cbafca6a97e7a4ac -R 1c6acddf7130094f372af0f6ab539a9f +P 8c36b248fd57dfaf3233a365f13f150a07affb3c +R e96f216bb6081dde097b05975fb0cc41 U drh -Z 150fc454dfaa87f8bdafb86307caf84b +Z 81f33655b1e674df748718a194f26c56 diff --git a/manifest.uuid b/manifest.uuid index c5e3f96d1d..54125d72a3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8c36b248fd57dfaf3233a365f13f150a07affb3c \ No newline at end of file +ced90c3f93e5e0cf73ea77b62a1308cd8dd5f3b3 \ No newline at end of file diff --git a/src/dbbemem.c b/src/dbbemem.c index b91c87e7da..c8118055eb 100644 --- a/src/dbbemem.c +++ b/src/dbbemem.c @@ -26,9 +26,9 @@ ** sqlite and the code that does the actually reading and writing ** of information to the disk. ** -** This file uses an in-memory hash talbe as the database backend. +** This file uses an in-memory hash table as the database backend. ** -** $Id: dbbemem.c,v 1.4 2000/10/19 15:28:41 drh Exp $ +** $Id: dbbemem.c,v 1.5 2000/12/10 18:23:50 drh Exp $ */ #include "sqliteInt.h" #include diff --git a/src/main.c b/src/main.c index ca43c35fce..0a21177086 100644 --- a/src/main.c +++ b/src/main.c @@ -26,7 +26,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.21 2000/10/19 01:49:02 drh Exp $ +** $Id: main.c,v 1.22 2000/12/10 18:23:50 drh Exp $ */ #include "sqliteInt.h" @@ -257,29 +257,50 @@ void sqlite_close(sqlite *db){ ** Return TRUE if the given SQL string ends in a semicolon. */ int sqlite_complete(const char *zSql){ - int i; - int lastWasSemi = 0; - - i = 0; - while( i>=0 && zSql[i]!=0 ){ - int tokenType; - int n; - - n = sqliteGetToken(&zSql[i], &tokenType); - switch( tokenType ){ - case TK_SPACE: - case TK_COMMENT: + int isComplete = 0; + while( *zSql ){ + switch( *zSql ){ + case ';': { + isComplete = 1; break; - case TK_SEMI: - lastWasSemi = 1; + } + case ' ': + case '\t': + case '\n': + case '\f': { break; - default: - lastWasSemi = 0; + } + case '\'': { + isComplete = 0; + zSql++; + while( *zSql && *zSql!='\'' ){ zSql++; } + if( *zSql==0 ) return 0; break; + } + case '"': { + isComplete = 0; + zSql++; + while( *zSql && *zSql!='"' ){ zSql++; } + if( *zSql==0 ) return 0; + break; + } + case '-': { + if( zSql[1]!='-' ){ + isComplete = 0; + break; + } + while( *zSql && *zSql!='\n' ){ zSql++; } + if( *zSql==0 ) return isComplete; + break; + } + default: { + isComplete = 0; + break; + } } - i += n; + zSql++; } - return lastWasSemi; + return isComplete; } /* diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 87fba207f7..5b777ef518 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -23,7 +23,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.32 2000/11/28 20:47:23 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.33 2000/12/10 18:23:51 drh Exp $ */ #include "sqlite.h" #include "dbbe.h" @@ -62,17 +62,18 @@ /* ** The following global variables are used for testing and debugging -** only. Thy only work if MEMORY_DEBUG is defined. +** only. They only work if MEMORY_DEBUG is defined. */ #ifdef MEMORY_DEBUG -int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ -int sqlite_nFree; /* Number of sqliteFree() calls */ -int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ +extern int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ +extern int sqlite_nFree; /* Number of sqliteFree() calls */ +extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ #endif /* ** The number of entries in the in-memory hash array holding the -** database schema. +** database schema. (Collision resolution is by chaining, so the +** table will hold more than this many entries.) */ #define N_HASH 51 @@ -123,7 +124,7 @@ typedef struct AggExpr AggExpr; */ struct sqlite { Dbbe *pBe; /* The backend driver */ - int flags; /* Miscellanous flags */ + int flags; /* Miscellanous flags. See below */ int file_format; /* What file format version is this database? */ int nTable; /* Number of tables in the database */ void *pBusyArg; /* 1st Argument to the busy callback */ diff --git a/src/table.c b/src/table.c index 27b6ab7b3a..d713ee1842 100644 --- a/src/table.c +++ b/src/table.c @@ -1,9 +1,31 @@ /* +** Copyright (c) 2000 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/ +** +************************************************************************* ** This file contains the sqlite_get_table() and sqlite_free_table() ** interface routines. These are just wrappers around the main ** interface routine of sqlite_exec(). ** -** This routines are in a separate files to that they will not be linked +** These routines are in a separate files so that they will not be linked ** if they are not used. */ #include diff --git a/src/tokenize.c b/src/tokenize.c index 20c0f11cb6..fddad500ea 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -27,7 +27,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.15 2000/10/22 20:39:59 drh Exp $ +** $Id: tokenize.c,v 1.16 2000/12/10 18:23:51 drh Exp $ */ #include "sqliteInt.h" #include @@ -102,7 +102,7 @@ static Keyword aKeywordTable[] = { /* ** This is the hash table */ -#define KEY_HASH_SIZE 37 +#define KEY_HASH_SIZE 69 static Keyword *apHashTable[KEY_HASH_SIZE]; diff --git a/src/util.c b/src/util.c index f9652bb540..cb2670a273 100644 --- a/src/util.c +++ b/src/util.c @@ -26,7 +26,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.16 2000/10/11 19:28:52 drh Exp $ +** $Id: util.c,v 1.17 2000/12/10 18:23:51 drh Exp $ */ #include "sqliteInt.h" #include @@ -38,6 +38,15 @@ */ #ifdef MEMORY_DEBUG +/* +** For keeping track of the number of mallocs and frees. This +** is used to check for memory leaks. +*/ +int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ +int sqlite_nFree; /* Number of sqliteFree() calls */ +int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ + + /* ** Allocate new memory and set it to zero. Return NULL if ** no memory is available. @@ -361,7 +370,7 @@ int sqliteHashNoCase(const char *z, int n){ int c; if( n<=0 ) n = strlen(z); while( n-- > 0 && (c = *z++)!=0 ){ - h = h<<3 ^ h ^ UpperToLower[c]; + h = (h<<3) ^ h ^ UpperToLower[c]; } if( h<0 ) h = -h; return h; diff --git a/src/vdbe.c b/src/vdbe.c index 777b23e6aa..2973d85e88 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -41,7 +41,7 @@ ** But other routines are also provided to help in building up ** a program instruction by instruction. ** -** $Id: vdbe.c,v 1.47 2000/10/23 13:16:33 drh Exp $ +** $Id: vdbe.c,v 1.48 2000/12/10 18:23:51 drh Exp $ */ #include "sqliteInt.h" #include @@ -639,18 +639,17 @@ static void PopStack(Vdbe *p, int N){ pStack--; pzStack--; } -#if 0 /* Older code was a little slower */ - while( p->tos>=0 && N-->0 ){ - int i = p->tos--; - if( p->aStack[i].flags & STK_Dyn ){ - sqliteFree(p->zStack[i]); - } - p->aStack[i].flags = 0; - p->zStack[i] = 0; - } -#endif } +/* +** Here is a macro to handle the common case of popping the stack +** once. This macro only works from within the sqliteVdbeExec() +** function. +*/ +#define POPSTACK \ + if( aStack[p->tos].flags & STK_Dyn ) sqliteFree(zStack[p->tos]); \ + p->tos--; + /* ** Make sure space has been allocated to hold at least N ** stack elements. Allocate additional stack space if @@ -1303,7 +1302,7 @@ int sqliteVdbeExec( break; } } - PopStack(p, 1); + POPSTACK; Release(p, nos); aStack[nos].r = b; aStack[nos].flags = STK_Real; @@ -1631,7 +1630,7 @@ int sqliteVdbeExec( VERIFY( if( p->tos<0 ) goto not_enough_stack; ) Integerify(p, p->tos); c = aStack[p->tos].i; - PopStack(p, 1); + POPSTACK; if( c ) pc = pOp->p2-1; break; } @@ -1646,7 +1645,7 @@ int sqliteVdbeExec( int c; VERIFY( if( p->tos<0 ) goto not_enough_stack; ) c = (aStack[p->tos].flags & STK_Null)!=0; - PopStack(p, 1); + POPSTACK; if( c ) pc = pOp->p2-1; break; } @@ -1661,7 +1660,7 @@ int sqliteVdbeExec( int c; VERIFY( if( p->tos<0 ) goto not_enough_stack; ) c = (aStack[p->tos].flags & STK_Null)==0; - PopStack(p, 1); + POPSTACK; if( c ) pc = pOp->p2-1; break; } @@ -1878,7 +1877,7 @@ int sqliteVdbeExec( } p->nFetch++; } - PopStack(p, 1); + POPSTACK; break; } @@ -1949,7 +1948,7 @@ int sqliteVdbeExec( if( !alreadyExists ) pc = pOp->p2 - 1; } if( pOp->opcode!=OP_Distinct ){ - PopStack(p, 1); + POPSTACK; } break; } @@ -2027,7 +2026,7 @@ int sqliteVdbeExec( } pBe->Delete(p->aCsr[i].pCursor, nKey, zKey); } - PopStack(p, 1); + POPSTACK; break; } @@ -2226,7 +2225,7 @@ int sqliteVdbeExec( if( j>=k ){ j = -1; pc = pOp->p2 - 1; - PopStack(p, 1); + POPSTACK; } p->aCsr[i].index = j+1; } @@ -2413,7 +2412,7 @@ int sqliteVdbeExec( int val; Integerify(p, p->tos); val = aStack[p->tos].i; - PopStack(p, 1); + POPSTACK; fwrite(&val, sizeof(int), 1, p->apList[i]); } break; @@ -2705,7 +2704,7 @@ int sqliteVdbeExec( rc = SQLITE_ABORT; } } - PopStack(p, 1); + POPSTACK; break; } @@ -2920,7 +2919,7 @@ int sqliteVdbeExec( pMem->s.flags |= STK_Dyn; } if( zOld ) sqliteFree(zOld); - PopStack(p, 1); + POPSTACK; break; } @@ -2997,7 +2996,7 @@ int sqliteVdbeExec( }else{ AggInsert(&p->agg, zKey); } - PopStack(p, 1); + POPSTACK; break; } @@ -3059,7 +3058,7 @@ int sqliteVdbeExec( } if( zOld ) sqliteFree(zOld); } - PopStack(p, 1); + POPSTACK; break; } @@ -3153,7 +3152,7 @@ int sqliteVdbeExec( if( tos<0 ) goto not_enough_stack; Stringify(p, tos); SetInsert(&p->aSet[i], zStack[tos]); - PopStack(p, 1); + POPSTACK; } break; } @@ -3172,7 +3171,7 @@ int sqliteVdbeExec( if( VERIFY( i>=0 && inSet &&) SetTest(&p->aSet[i], zStack[tos])){ pc = pOp->p2 - 1; } - PopStack(p, 1); + POPSTACK; break; } @@ -3190,7 +3189,7 @@ int sqliteVdbeExec( if(VERIFY( i>=0 && inSet &&) !SetTest(&p->aSet[i], zStack[tos])){ pc = pOp->p2 - 1; } - PopStack(p, 1); + POPSTACK; break; } @@ -3205,7 +3204,7 @@ int sqliteVdbeExec( VERIFY( if( tos<0 ) goto not_enough_stack; ) Stringify(p, tos); len = aStack[tos].n-1; - PopStack(p, 1); + POPSTACK; p->tos++; aStack[tos].i = len; aStack[tos].flags = STK_Int; @@ -3241,7 +3240,7 @@ int sqliteVdbeExec( VERIFY( if( p->tos<0 ) goto not_enough_stack; ) Integerify(p, p->tos); cnt = aStack[p->tos].i; - PopStack(p, 1); + POPSTACK; }else{ cnt = pOp->p2; } @@ -3249,7 +3248,7 @@ int sqliteVdbeExec( VERIFY( if( p->tos<0 ) goto not_enough_stack; ) Integerify(p, p->tos); start = aStack[p->tos].i - 1; - PopStack(p, 1); + POPSTACK; }else{ start = pOp->p1 - 1; } @@ -3274,7 +3273,7 @@ int sqliteVdbeExec( if( z==0 ) goto no_mem; strncpy(z, &zStack[p->tos][start], cnt); z[cnt] = 0; - PopStack(p, 1); + POPSTACK; p->tos++; zStack[p->tos] = z; aStack[p->tos].n = cnt + 1; diff --git a/test/all.test b/test/all.test index 7acf62228e..6d04127f3e 100644 --- a/test/all.test +++ b/test/all.test @@ -22,17 +22,17 @@ #*********************************************************************** # This file runs all tests. # -# $Id: all.test,v 1.4 2000/10/19 14:21:43 drh Exp $ +# $Id: all.test,v 1.5 2000/12/10 18:23:51 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl rename finish_test really_finish_test -proc finish_test {} {} +proc finish_test {} {memleak_check} if {[file exists ./sqlite_test_count]} { set COUNT [exec cat ./sqlite_test_count] } else { - set COUNT 1 + set COUNT 4 } if {[file exists ./sqlite_test_prefixes]} { @@ -41,6 +41,13 @@ if {[file exists ./sqlite_test_prefixes]} { set PREFIXES {memory: gdbm:} } +# LeakList will hold a list of the number of unfreed mallocs after +# each round of the test. This number should be constant. If it +# grows, it may mean there is a memory leak in the library. +# +set LeakList {} + + for {set Counter 0} {$Counter<$COUNT} {incr Counter} { foreach p $PREFIXES { set dbprefix $p @@ -49,6 +56,27 @@ for {set Counter 0} {$Counter<$COUNT} {incr Counter} { source $testfile } } + if {[info exists Leak]} { + lappend LeakList $Leak + } +} + +# Do one last test to look for a memory leak in the library. This will +# only work if SQLite is compiled with the -DMEMORY_DEBUG=1 flag. +# +if {$LeakList!=""} { + puts -nonewline memory-leak-test... + incr ::nTest + foreach x $LeakList { + if {$x!=[lindex $LeakList 0]} { + puts " failed!" + puts "Expected: all values to be the same" + puts " Got: $LeakList" + incr ::nErr + break + } + } + puts " Ok" } really_finish_test diff --git a/test/main.test b/test/main.test index c2807970b3..165d51506c 100644 --- a/test/main.test +++ b/test/main.test @@ -23,7 +23,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is exercising the code in main.c. # -# $Id: main.test,v 1.3 2000/06/16 20:51:26 drh Exp $ +# $Id: main.test,v 1.4 2000/12/10 18:23:52 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -48,6 +48,34 @@ do_test main-1.4 { ; } } {1} +do_test main-1.5 { + db complete {DROP TABLE 'xyz;} +} {0} +do_test main-1.6 { + db complete {DROP TABLE 'xyz';} +} {1} +do_test main-1.7 { + db complete {DROP TABLE "xyz;} +} {0} +do_test main-1.8 { + db complete {DROP TABLE "xyz';} +} {0} +do_test main-1.9 { + db complete {DROP TABLE "xyz";} +} {1} +do_test main-1.10 { + db complete {DROP TABLE xyz; hi} +} {0} +do_test main-1.11 { + db complete {DROP TABLE xyz; } +} {1} +do_test main-1.12 { + db complete {DROP TABLE xyz; -- hi } +} {1} +do_test main-1.13 { + db complete {DROP TABLE xyz; -- hi + } +} {1} # Try to open a database with a corrupt master file. # diff --git a/test/tester.tcl b/test/tester.tcl index 6a85c21418..3690c1636d 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -23,7 +23,7 @@ # This file implements some common TCL routines used for regression # testing the SQLite library # -# $Id: tester.tcl,v 1.7 2000/10/19 14:10:09 drh Exp $ +# $Id: tester.tcl,v 1.8 2000/12/10 18:23:52 drh Exp $ # Create a test database # @@ -112,10 +112,25 @@ proc testif {args} { set ::skip_test 1 } +# The procedure uses the special "--malloc-stats--" macro of SQLite +# (which is only available if SQLite is compiled with -DMEMORY_DEBUG=1) +# to see how many malloc()s have not been free()ed. The number +# of surplus malloc()s is stored in the global variable $::Leak. +# If the value in $::Leak grows, it may mean there is a memory leak +# in the library. +# +proc memleak_check {} { + set r [execsql {--malloc-stats--}] + if {$r==""} return + set ::Leak [expr {[lindex $r 0]-[lindex $r 1]}] + # puts "*** $::Leak mallocs have not been freed ***" +} + # Run this routine last # proc finish_test {} { global nTest nErr + memleak_check catch {db close} puts "$nErr errors out of $nTest tests" exit $nErr diff --git a/www/changes.tcl b/www/changes.tcl index 5d41e27230..1fd8a2852b 100644 --- a/www/changes.tcl +++ b/www/changes.tcl @@ -17,6 +17,16 @@ proc chng {date desc} { puts "

    $desc

" } +chng {2000 Dec 10 (1.0.17)} { +
  • Rewrote sqlite_complete() to make it faster.
  • +
  • Minor tweaks to other code to make it run a little faster.
  • +
  • Added new tests for sqlite_complete() and for memory leaks.
  • +} + +chng {2000 Dec 4 (1.0.16)} { +
  • Documentation updates. Mostly fixing of typos and spelling errors.
  • +} + chng {2000 Oct 23 (1.0.15)} {
  • Documentation updates
  • Some sanity checking code was removed from the inner loop of vdbe.c @@ -33,7 +43,7 @@ chng {2000 Oct 18 (1.0.13)} {
  • Break out the GDBM driver into a separate file in anticipation to added new drivers.
  • Allow the name of a database to be prefixed by the driver type. - For now, the only driver type is "gdbm:".
  • + For now, the only driver type is "gdbm:".
  • } chng {2000 Oct 16 (1.0.12)} {