mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Remove most static and global variables from a pure build. There
are still a number of static and global variables used for testing. (CVS 3342) FossilOrigin-Name: 76e4d4187779097954038e444111f837737e789c
This commit is contained in:
14
src/btree.c
14
src/btree.c
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.325 2006/06/27 16:34:57 danielk1977 Exp $
|
||||
** $Id: btree.c,v 1.326 2006/08/08 13:51:43 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -426,10 +426,10 @@ struct BtCursor {
|
||||
#if SQLITE_TEST
|
||||
# define TRACE(X) if( sqlite3_btree_trace )\
|
||||
{ sqlite3DebugPrintf X; fflush(stdout); }
|
||||
int sqlite3_btree_trace=0; /* True to enable tracing */
|
||||
#else
|
||||
# define TRACE(X)
|
||||
#endif
|
||||
int sqlite3_btree_trace=0; /* True to enable tracing */
|
||||
|
||||
/*
|
||||
** Forward declaration
|
||||
@@ -2367,7 +2367,7 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *nTrunc){
|
||||
MemPage *pFreeMemPage = 0; /* "" */
|
||||
|
||||
#ifndef NDEBUG
|
||||
int nRef = *sqlite3pager_stats(pPager);
|
||||
int nRef = sqlite3pager_refcount(pPager);
|
||||
#endif
|
||||
|
||||
assert( pBt->autoVacuum );
|
||||
@@ -2475,7 +2475,7 @@ static int autoVacuumCommit(BtShared *pBt, Pgno *nTrunc){
|
||||
assert( finSize!=PENDING_BYTE_PAGE(pBt) );
|
||||
|
||||
autovacuum_out:
|
||||
assert( nRef==*sqlite3pager_stats(pPager) );
|
||||
assert( nRef==sqlite3pager_refcount(pPager) );
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3pager_rollback(pPager);
|
||||
}
|
||||
@@ -6388,7 +6388,7 @@ char *sqlite3BtreeIntegrityCheck(Btree *p, int *aRoot, int nRoot){
|
||||
IntegrityCk sCheck;
|
||||
BtShared *pBt = p->pBt;
|
||||
|
||||
nRef = *sqlite3pager_stats(pBt->pPager);
|
||||
nRef = sqlite3pager_refcount(pBt->pPager);
|
||||
if( lockBtreeWithRetry(p)!=SQLITE_OK ){
|
||||
return sqliteStrDup("Unable to acquire a read lock on the database");
|
||||
}
|
||||
@@ -6454,10 +6454,10 @@ char *sqlite3BtreeIntegrityCheck(Btree *p, int *aRoot, int nRoot){
|
||||
/* Make sure this analysis did not leave any unref() pages
|
||||
*/
|
||||
unlockBtreeIfUnused(pBt);
|
||||
if( nRef != *sqlite3pager_stats(pBt->pPager) ){
|
||||
if( nRef != sqlite3pager_refcount(pBt->pPager) ){
|
||||
checkAppendMsg(&sCheck, 0,
|
||||
"Outstanding page count goes from %d to %d during this analysis",
|
||||
nRef, *sqlite3pager_stats(pBt->pPager)
|
||||
nRef, sqlite3pager_refcount(pBt->pPager)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user