aboutsummaryrefslogtreecommitdiff
path: root/src/test_stat.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-02-21 15:13:50 +0000
committerdrh <drh@noemail.net>2015-02-21 15:13:50 +0000
commit878acb32efa879e0b680cce08f63e65f89fa4f77 (patch)
tree84f334c6f75c248e10f9a92c17e3dae631f2c597 /src/test_stat.c
parent1ee4a2dd88663517c8dd980926af9e76f37c88fb (diff)
parent2da47d38691b74a6cfa2ce2e5bdce3bb7d8fc186 (diff)
downloadsqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.tar.gz
sqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.zip
Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: f36bb5fa5c5e3430808fe35d58f45559a216d341
Diffstat (limited to 'src/test_stat.c')
-rw-r--r--src/test_stat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test_stat.c b/src/test_stat.c
index 615df3d80..daa84de2c 100644
--- a/src/test_stat.c
+++ b/src/test_stat.c
@@ -301,8 +301,11 @@ static int statDecodePage(Btree *pBt, StatPage *p){
if( p->nCell ){
int i; /* Used to iterate through cells */
- int nUsable = szPage - sqlite3BtreeGetReserve(pBt);
+ int nUsable; /* Usable bytes per page */
+ sqlite3BtreeEnter(pBt);
+ nUsable = szPage - sqlite3BtreeGetReserveNoMutex(pBt);
+ sqlite3BtreeLeave(pBt);
p->aCell = sqlite3_malloc((p->nCell+1) * sizeof(StatCell));
memset(p->aCell, 0, (p->nCell+1) * sizeof(StatCell));
@@ -425,7 +428,11 @@ statNextRestart:
while( p->iCell<p->nCell ){
StatCell *pCell = &p->aCell[p->iCell];
if( pCell->iOvfl<pCell->nOvfl ){
- int nUsable = sqlite3BtreeGetPageSize(pBt)-sqlite3BtreeGetReserve(pBt);
+ int nUsable;
+ sqlite3BtreeEnter(pBt);
+ nUsable = sqlite3BtreeGetPageSize(pBt) -
+ sqlite3BtreeGetReserveNoMutex(pBt);
+ sqlite3BtreeLeave(pBt);
pCsr->zName = (char *)sqlite3_column_text(pCsr->pStmt, 0);
pCsr->iPageno = pCell->aOvfl[pCell->iOvfl];
pCsr->zPagetype = "overflow";