diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 13 | ||||
-rw-r--r-- | src/tclsqlite.c | 4 | ||||
-rw-r--r-- | src/test1.c | 12 | ||||
-rw-r--r-- | src/tokenize.c | 8 |
4 files changed, 27 insertions, 10 deletions
diff --git a/src/btree.c b/src/btree.c index 1a5062a6e..f68766e8d 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.248 2005/02/15 16:23:02 drh Exp $ +** $Id: btree.c,v 1.249 2005/02/26 17:31:27 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -1843,7 +1843,10 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){ rc = ptrmapGet(pBt, iDbPage, &eType, &iPtrPage); if( rc!=SQLITE_OK ) goto autovacuum_out; - assert( eType!=PTRMAP_ROOTPAGE ); + if( eType==PTRMAP_ROOTPAGE ){ + rc = SQLITE_CORRUPT; + goto autovacuum_out; + } /* If iDbPage is free, do not swap it. */ if( eType==PTRMAP_FREEPAGE ){ @@ -4690,12 +4693,12 @@ int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){ return rc; } rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage); - assert( eType!=PTRMAP_ROOTPAGE ); - assert( eType!=PTRMAP_FREEPAGE ); - if( rc!=SQLITE_OK ){ + if( rc!=SQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ releasePage(pRoot); return rc; } + assert( eType!=PTRMAP_ROOTPAGE ); + assert( eType!=PTRMAP_FREEPAGE ); rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove); releasePage(pRoot); if( rc!=SQLITE_OK ){ diff --git a/src/tclsqlite.c b/src/tclsqlite.c index a5ef6106c..3196793e7 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.118 2005/01/25 04:27:55 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.119 2005/02/26 17:31:27 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -729,6 +729,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ ** built-in "info complete" command of Tcl. */ case DB_COMPLETE: { +#ifndef SQLITE_OMIT_COMPLETE Tcl_Obj *pResult; int isComplete; if( objc!=3 ){ @@ -738,6 +739,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ isComplete = sqlite3_complete( Tcl_GetStringFromObj(objv[2], 0) ); pResult = Tcl_GetObjResult(interp); Tcl_SetBooleanObj(pResult, isComplete); +#endif break; } diff --git a/src/test1.c b/src/test1.c index b6ebe3669..424cb1538 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.130 2005/02/17 00:03:07 drh Exp $ +** $Id: test1.c,v 1.131 2005/02/26 17:31:27 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -2032,7 +2032,7 @@ static int test_complete16( int objc, Tcl_Obj *CONST objv[] ){ -#ifndef SQLITE_OMIT_UTF16 +#if !defined(SQLITE_OMIT_COMPLETE) && !defined(SQLITE_OMIT_UTF16) char *zBuf; if( objc!=2 ){ @@ -2042,7 +2042,7 @@ static int test_complete16( zBuf = Tcl_GetByteArrayFromObj(objv[1], 0); Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_complete16(zBuf))); -#endif /* SQLITE_OMIT_UTF16 */ +#endif /* SQLITE_OMIT_COMPLETE && SQLITE_OMIT_UTF16 */ return TCL_OK; } @@ -2723,6 +2723,12 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY); #endif +#ifdef SQLITE_OMIT_COMPLETE + Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY); +#endif + #ifdef SQLITE_OMIT_COMPOUND_SELECT Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY); #else diff --git a/src/tokenize.c b/src/tokenize.c index 4fc1d3d7c..1c3d19949 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.100 2005/01/31 12:42:29 danielk1977 Exp $ +** $Id: tokenize.c,v 1.101 2005/02/26 17:31:27 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -431,6 +431,11 @@ abort_parse: return nErr; } +/* The sqlite3_complete() API may be omitted (to save code space) by +** defining the following symbol. +*/ +#ifndef SQLITE_OMIT_COMPLETE + /* ** Token types used by the sqlite3_complete() routine. See the header ** comments on that procedure for additional information. @@ -662,3 +667,4 @@ int sqlite3_complete16(const void *zSql){ return rc; } #endif /* SQLITE_OMIT_UTF16 */ +#endif /* SQLITE_OMIT_COMPLETE */ |