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

When moving pages as part of autovacuum on an in-memory database, make sure

that the source location is journalled so that a ROLLBACK can occur.
Part of the fix for ticket [564d412f15a00]

FossilOrigin-Name: 2f42f91fe65b0b21671936013df08037091f0cc6
This commit is contained in:
drh
2009-11-20 18:48:35 +00:00
parent e6828f5503
commit 8c30f72deb
3 changed files with 27 additions and 9 deletions

View File

@@ -5101,6 +5101,14 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
assert( pPg->nRef>0 );
/* In order to be able to rollback, an in-memory database must journal
** the page we are moving from.
*/
if( MEMDB ){
rc = sqlite3PagerWrite(pPg);
if( rc ) return rc;
}
/* If the page being moved is dirty and has not been saved by the latest
** savepoint, then save the current contents of the page into the
** sub-journal now. This is required to handle the following scenario:
@@ -5119,7 +5127,7 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
** one or more savepoint bitvecs. This is the reason this function
** may return SQLITE_NOMEM.
*/
if( pPg->flags&PGHDR_DIRTY
if( pPg->flags&PGHDR_DIRTY
&& subjRequiresPage(pPg)
&& SQLITE_OK!=(rc = subjournalPage(pPg))
){