diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 15 | ||||
-rw-r--r-- | src/expr.c | 6 | ||||
-rw-r--r-- | src/pager.c | 10 | ||||
-rw-r--r-- | src/tclsqlite.c | 4 | ||||
-rw-r--r-- | src/test_schema.c | 8 | ||||
-rw-r--r-- | src/vdbeapi.c | 2 |
6 files changed, 32 insertions, 13 deletions
diff --git a/src/build.c b/src/build.c index 91f7057f1..c1b5a4530 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.483 2008/04/28 18:46:43 drh Exp $ +** $Id: build.c,v 1.484 2008/05/01 17:16:53 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -159,7 +159,7 @@ void sqlite3FinishCoding(Parse *pParse){ */ if( pParse->cookieGoto>0 ){ u32 mask; - int iDb, i; + int iDb; sqlite3VdbeJumpHere(v, pParse->cookieGoto-1); for(iDb=0, mask=1; iDb<db->nDb; mask<<=1, iDb++){ if( (mask & pParse->cookieMask)==0 ) continue; @@ -168,11 +168,14 @@ void sqlite3FinishCoding(Parse *pParse){ sqlite3VdbeAddOp2(v,OP_VerifyCookie, iDb, pParse->cookieValue[iDb]); } #ifndef SQLITE_OMIT_VIRTUALTABLE - for(i=0; i<pParse->nVtabLock; i++){ - char *vtab = (char *)pParse->apVtabLock[i]->pVtab; - sqlite3VdbeAddOp4(v, OP_VBegin, 0, 0, 0, vtab, P4_VTAB); + { + int i; + for(i=0; i<pParse->nVtabLock; i++){ + char *vtab = (char *)pParse->apVtabLock[i]->pVtab; + sqlite3VdbeAddOp4(v, OP_VBegin, 0, 0, 0, vtab, P4_VTAB); + } + pParse->nVtabLock = 0; } - pParse->nVtabLock = 0; #endif /* Once all the cookies have been verified and transactions opened, diff --git a/src/expr.c b/src/expr.c index e0c5ecfbc..bc5f0eab1 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.370 2008/04/29 00:15:21 drh Exp $ +** $Id: expr.c,v 1.371 2008/05/01 17:16:53 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -266,8 +266,7 @@ Expr *sqlite3Expr( const Token *pToken /* Argument token */ ){ Expr *pNew; - static const Expr zeroExpr; - pNew = sqlite3DbMallocRaw(db, sizeof(Expr)); + pNew = sqlite3DbMallocZero(db, sizeof(Expr)); if( pNew==0 ){ /* When malloc fails, delete pLeft and pRight. Expressions passed to ** this function must always be allocated with sqlite3Expr() for this @@ -277,7 +276,6 @@ Expr *sqlite3Expr( sqlite3ExprDelete(pRight); return 0; } - *pNew = zeroExpr; pNew->op = op; pNew->pLeft = pLeft; pNew->pRight = pRight; diff --git a/src/pager.c b/src/pager.c index 89d6140e6..fadcf29dc 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.437 2008/05/01 17:03:49 drh Exp $ +** @(#) $Id: pager.c,v 1.438 2008/05/01 17:16:53 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -516,7 +516,9 @@ static const unsigned char aJournalMagic[] = { p->iInUseDB++; if( p->iInUseMM && p->iInUseDB==1 ){ sqlite3_mutex *mutex; +#ifndef SQLITE_MUTEX_NOOP mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM2); +#endif p->iInUseDB = 0; sqlite3_mutex_enter(mutex); p->iInUseDB = 1; @@ -2324,7 +2326,9 @@ int sqlite3PagerOpen( pPager->iInUseMM = 0; pPager->iInUseDB = 0; if( !memDb ){ +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM2); +#endif sqlite3_mutex_enter(mutex); pPager->pNext = sqlite3PagerList; if( sqlite3PagerList ){ @@ -2706,7 +2710,9 @@ int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){ int sqlite3PagerClose(Pager *pPager){ #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT if( !MEMDB ){ +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM2); +#endif sqlite3_mutex_enter(mutex); if( pPager->pPrev ){ pPager->pPrev->pNext = pPager->pNext; @@ -3223,7 +3229,9 @@ int sqlite3PagerReleaseMemory(int nReq){ /* Acquire the memory-management mutex */ +#ifndef SQLITE_MUTEX_NOOP mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM2); +#endif sqlite3_mutex_enter(mutex); /* Signal all database connections that memory management wants diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 4818d898f..0fd4602e3 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -12,7 +12,7 @@ ** A TCL Interface to SQLite. Append this file to sqlite3.c and ** compile the whole thing to build a TCL-enabled version of SQLite. ** -** $Id: tclsqlite.c,v 1.216 2008/04/16 00:28:14 drh Exp $ +** $Id: tclsqlite.c,v 1.217 2008/05/01 17:16:53 drh Exp $ */ #include "tcl.h" #include <errno.h> @@ -479,6 +479,7 @@ static int DbBusyHandler(void *cd, int nTries){ return 1; } +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK /* ** This routine is invoked as the 'progress callback' for the database. */ @@ -493,6 +494,7 @@ static int DbProgressHandler(void *cd){ } return 0; } +#endif #ifndef SQLITE_OMIT_TRACE /* diff --git a/src/test_schema.c b/src/test_schema.c index 880052015..536af86a0 100644 --- a/src/test_schema.c +++ b/src/test_schema.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test_schema.c,v 1.13 2007/08/16 04:30:40 drh Exp $ +** $Id: test_schema.c,v 1.14 2008/05/01 17:16:53 drh Exp $ */ /* The code in this file defines a sqlite3 virtual-table module that @@ -67,6 +67,11 @@ struct schema_cursor { }; /* +** None of this works unless we have virtual tables. +*/ +#ifndef SQLITE_OMIT_VIRTUALTABLE + +/* ** Table destructor for the schema module. */ static int schemaDestroy(sqlite3_vtab *pVtab){ @@ -287,6 +292,7 @@ static sqlite3_module schemaModule = { 0, /* xRename */ }; +#endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) */ #ifdef SQLITE_TEST diff --git a/src/vdbeapi.c b/src/vdbeapi.c index fdb585acf..6e9008451 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -47,6 +47,7 @@ static struct StatementLruList sqlite3LruStatements; ** ** assert( stmtLruCheck() ); */ +#ifndef NDEBUG static int stmtLruCheck(){ Vdbe *p; for(p=sqlite3LruStatements.pFirst; p; p=p->pLruNext){ @@ -57,6 +58,7 @@ static int stmtLruCheck(){ } return 1; } +#endif /* ** Add vdbe p to the end of the statement lru list. It is assumed that |