mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Do not reset the page cache when a rollback journal truncate fails, as doing
so can cause loss of information for an in-memory TEMP file. FossilOrigin-Name: 345ce1c9f64f2a424663b4dfcbe4586d9df7bff6
This commit is contained in:
12
src/pager.c
12
src/pager.c
@@ -2032,12 +2032,14 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
|
||||
sqlite3BitvecDestroy(pPager->pInJournal);
|
||||
pPager->pInJournal = 0;
|
||||
pPager->nRec = 0;
|
||||
if( MEMDB || pagerFlushOnCommit(pPager) ){
|
||||
sqlite3PcacheCleanAll(pPager->pPCache);
|
||||
}else{
|
||||
sqlite3PcacheClearWritable(pPager->pPCache);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( MEMDB || pagerFlushOnCommit(pPager) ){
|
||||
sqlite3PcacheCleanAll(pPager->pPCache);
|
||||
}else{
|
||||
sqlite3PcacheClearWritable(pPager->pPCache);
|
||||
}
|
||||
sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize);
|
||||
}
|
||||
sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize);
|
||||
|
||||
if( pagerUseWal(pPager) ){
|
||||
/* Drop the WAL write-lock, if any. Also, if the connection was in
|
||||
|
Reference in New Issue
Block a user