mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Make the btree layer robust when faced with a corrupt database that
contains duplicate entries on the freelist. Ticket #3209. (CVS 5392) FossilOrigin-Name: 30825f74d60d8ace39bafd06814017ceefeb4fa4
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.464 2008/07/10 00:32:42 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.465 2008/07/11 03:34:10 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -4547,8 +4547,12 @@ void sqlite3PagerDontRollback(DbPage *pPg){
|
||||
** has not been previously called during the same transaction.
|
||||
** And if DontWrite() has previously been called, the following
|
||||
** conditions must be met.
|
||||
**
|
||||
** (Later:) Not true. If the database is corrupted by having duplicate
|
||||
** pages on the freelist (ex: corrupt9.test) then the following is not
|
||||
** necessarily true:
|
||||
*/
|
||||
assert( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize );
|
||||
/* assert( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ); */
|
||||
|
||||
assert( pPager->pInJournal!=0 );
|
||||
sqlite3BitvecSet(pPager->pInJournal, pPg->pgno);
|
||||
|
Reference in New Issue
Block a user