mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Silently abandon a rollback if the journal has been truncated.
FossilOrigin-Name: 7626f6c9ea04d1a5690dd11bb13e8c3c04e3b0f5
This commit is contained in:
@@ -1978,6 +1978,14 @@ static int pager_playback(Pager *pPager, int isHot){
|
||||
rc = SQLITE_OK;
|
||||
pPager->journalOff = szJ;
|
||||
break;
|
||||
}else if( rc==SQLITE_IOERR_SHORT_READ ){
|
||||
/* If the journal has been truncated, simply stop reading and
|
||||
** processing the journal. This might happen if the journal was
|
||||
** not completely written and synced prior to a crash. In that
|
||||
** case, the database should have never been written in the
|
||||
** first place so it is OK to simply abandon the rollback. */
|
||||
rc = SQLITE_OK;
|
||||
goto end_playback;
|
||||
}else{
|
||||
/* If we are unable to rollback, quit and return the error
|
||||
** code. This will cause the pager to enter the error state
|
||||
|
Reference in New Issue
Block a user