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

Fix a case where the doNotSyncSpill flag may remain permanently set following aIO error.

FossilOrigin-Name: 56c7d111bf7013be95a4c2a657a4861eee91db91
This commit is contained in:
dan
2010-06-26 17:15:07 +00:00
parent 273f3f0d1a
commit 6ce60746c1
3 changed files with 18 additions and 17 deletions

View File

@@ -4857,17 +4857,18 @@ int sqlite3PagerWrite(DbPage *pDbPage){
pg1 = ((pPg->pgno-1) & ~(nPagePerSector-1)) + 1;
rc = sqlite3PagerPagecount(pPager, (int *)&nPageCount);
if( rc ) return rc;
if( pPg->pgno>nPageCount ){
nPage = (pPg->pgno - pg1)+1;
}else if( (pg1+nPagePerSector-1)>nPageCount ){
nPage = nPageCount+1-pg1;
}else{
nPage = nPagePerSector;
if( rc==SQLITE_OK ){
if( pPg->pgno>nPageCount ){
nPage = (pPg->pgno - pg1)+1;
}else if( (pg1+nPagePerSector-1)>nPageCount ){
nPage = nPageCount+1-pg1;
}else{
nPage = nPagePerSector;
}
assert(nPage>0);
assert(pg1<=pPg->pgno);
assert((pg1+nPage)>pPg->pgno);
}
assert(nPage>0);
assert(pg1<=pPg->pgno);
assert((pg1+nPage)>pPg->pgno);
for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
Pgno pg = pg1+ii;