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

When an OOM fault occurs while moving a page for autovacuum in an in-memory

database, be sure to undo the page move prior to returning the error, to
avoid corrupting the in-memory database file. (CVS 6883)

FossilOrigin-Name: d0964b93669123e228e7ce1890167447c56753b5
This commit is contained in:
drh
2009-07-12 02:31:36 +00:00
parent fb1926837a
commit 6a8b8d3cc8
3 changed files with 12 additions and 9 deletions

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.605 2009/07/07 13:56:24 danielk1977 Exp $
** @(#) $Id: pager.c,v 1.606 2009/07/12 02:31:37 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -5255,7 +5255,10 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
if( MEMDB ){
DbPage *pNew;
rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
if( rc!=SQLITE_OK ) return rc;
if( rc!=SQLITE_OK ){
sqlite3PcacheMove(pPg, origPgno);
return rc;
}
sqlite3PagerUnref(pNew);
}