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

Fix an error introduced by (5346). The list could become corrupted when the database was truncated. (CVS 5356)

FossilOrigin-Name: fbd320ed27dc8910f5035b41171576b4a37cb8b9
This commit is contained in:
danielk1977
2008-07-07 18:42:40 +00:00
parent 75c5fa88e9
commit da8c8f2f8f
3 changed files with 11 additions and 8 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.461 2008/07/07 11:18:28 danielk1977 Exp $
** @(#) $Id: pager.c,v 1.462 2008/07/07 18:42:41 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -2651,6 +2651,9 @@ static void pager_truncate_cache(Pager *pPager){
ppPg = &pPg->pNextAll;
}else{
*ppPg = pPg->pNextAll;
if( *ppPg ){
(*ppPg)->pPrevAll = pPg->pPrevAll;
}
IOTRACE(("PGFREE %p %d\n", pPager, pPg->pgno));
PAGER_INCR(sqlite3_pager_pgfree_count);
unlinkPage(pPg);