1
0
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:
drh
2016-05-11 12:47:46 +00:00
parent 65c6420335
commit a37e0cfb22
3 changed files with 14 additions and 12 deletions

View File

@@ -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