mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Get autovacuum and in-memory databases working together. Ticket #1727. (CVS 3148)
FossilOrigin-Name: 21446df6420df00468867f1131c28604a1ae91a3
This commit is contained in:
10
src/pager.c
10
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.263 2006/03/16 16:19:56 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.264 2006/03/23 23:29:04 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -1833,7 +1833,10 @@ static void unlinkHashChain(Pager *pPager, PgHdr *pPg){
|
||||
assert( pPager->aHash[h]==pPg );
|
||||
pPager->aHash[h] = pPg->pNextHash;
|
||||
}
|
||||
|
||||
if( MEMDB ){
|
||||
static void clearHistory(PgHistory*); /* Forward reference */
|
||||
clearHistory(PGHDR_TO_HIST(pPg, pPager));
|
||||
}
|
||||
pPg->pgno = 0;
|
||||
pPg->pNextHash = pPg->pPrevHash = 0;
|
||||
}
|
||||
@@ -3242,6 +3245,7 @@ int sqlite3pager_commit(Pager *pPager){
|
||||
pPg->dirty = 0;
|
||||
pPg->inJournal = 0;
|
||||
pPg->inStmt = 0;
|
||||
pPg->needSync = 0;
|
||||
pPg->pPrevStmt = pPg->pNextStmt = 0;
|
||||
pPg = pPg->pDirty;
|
||||
}
|
||||
@@ -3656,6 +3660,8 @@ int sqlite3pager_sync(Pager *pPager, const char *zMaster, Pgno nTrunc){
|
||||
}
|
||||
|
||||
pPager->state = PAGER_SYNCED;
|
||||
}else if( MEMDB && nTrunc!=0 ){
|
||||
rc = sqlite3pager_truncate(pPager, nTrunc);
|
||||
}
|
||||
|
||||
sync_exit:
|
||||
|
Reference in New Issue
Block a user