1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

In btree.c, save the positions of any open cursors before moving any pages around to auto-vacuum the database on commit.

FossilOrigin-Name: 30c0a69363931a72d1c34e5be71646932398d172
This commit is contained in:
dan
2013-03-26 14:16:20 +00:00
parent 41f89cc676
commit 0aed84d19f
3 changed files with 12 additions and 10 deletions

View File

@@ -3185,7 +3185,9 @@ static int autoVacuumCommit(BtShared *pBt){
nFree = get4byte(&pBt->pPage1->aData[36]);
nFin = finalDbSize(pBt, nOrig, nFree);
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT;
if( nFin<nOrig ){
rc = saveAllCursors(pBt, 0, 0);
}
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){
rc = incrVacuumStep(pBt, nFin, iFree, 1);
}
@@ -3202,7 +3204,7 @@ static int autoVacuumCommit(BtShared *pBt){
}
}
assert( nRef==sqlite3PagerRefcount(pPager) );
assert( nRef>=sqlite3PagerRefcount(pPager) );
return rc;
}