1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Report the error SQLITE_CORRUPT instead of SQLITE_IOERR if unable

to rollback a hot journal that was damaged (for example) by filesystem
corruption following a power failure. (CVS 3460)

FossilOrigin-Name: 70501e4ea588ed762e4f6bc211ce63397faa3367
This commit is contained in:
drh
2006-10-03 19:05:18 +00:00
parent bfe6631e7a
commit fa7d4acf0b
3 changed files with 12 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.273 2006/09/15 12:29:16 drh Exp $
** @(#) $Id: pager.c,v 1.274 2006/10/03 19:05:19 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -1341,6 +1341,10 @@ static int pager_playback(Pager *pPager){
pPager->journalOff = szJ;
break;
}else{
/* If we are unable to rollback a hot journal, then the database
** is probably not recoverable. Return CORRUPT.
*/
rc = SQLITE_CORRUPT;
goto end_playback;
}
}