1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a bug in the rollback validation logic (code that only runs during

debugging).  The problem was introduced by check-in (835). (CVS 849)

FossilOrigin-Name: b6ea0da76a27a4a67a3978c53405840518de2379
This commit is contained in:
drh
2003-01-25 15:43:22 +00:00
parent a3da6fafd7
commit a218b6a22a
3 changed files with 16 additions and 13 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.70 2003/01/22 01:26:44 drh Exp $
** @(#) $Id: pager.c,v 1.71 2003/01/25 15:43:22 drh Exp $
*/
#include "os.h" /* Must be first to enable large file support */
#include "sqliteInt.h"
@ -1713,12 +1713,15 @@ int sqlitepager_rollback(Pager *pPager){
** worked if it had occurred after an OS crash or unexpected power
** loss.
*/
if( pPager->syncJSize<sizeof(aJournalMagic)+sizeof(Pgno) ){
pPager->syncJSize = sizeof(aJournalMagic)+sizeof(Pgno);
if( !pPager->noSync ){
assert( !pPager->tempFile );
if( pPager->syncJSize<sizeof(aJournalMagic)+sizeof(Pgno) ){
pPager->syncJSize = sizeof(aJournalMagic)+sizeof(Pgno);
}
TRACE2("TRUNCATE JOURNAL %lld\n", pPager->syncJSize);
rc = sqliteOsTruncate(&pPager->jfd, pPager->syncJSize);
if( rc ) return rc;
}
TRACE2("TRUNCATE JOURNAL %lld\n", pPager->syncJSize);
rc = sqliteOsTruncate(&pPager->jfd, pPager->syncJSize);
if( rc ) return rc;
#endif
if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){