Differences From Artifact [4f21866040755ce5]:
- File
src/pager.c
- 2010-04-02 13:25:22 - part of checkin [d64d181c79] on branch trunk - Check for a failure in the call to sqlite3PagerPagecount() from within sqlite3PagerWrite(). (Error discovered by valgrind.) (user: drh
To Artifact [044c27315eccca1a]:
- File
src/pager.c
- 2010-04-03 13:08:10 - part of checkin [7626f6c9ea] on branch trunk - Silently abandon a rollback if the journal has been truncated. (user: drh
1974 } 1974 }
1975 rc = pager_playback_one_page(pPager,1,isUnsync,&pPager->journalOff,0,0); 1975 rc = pager_playback_one_page(pPager,1,isUnsync,&pPager->journalOff,0,0);
1976 if( rc!=SQLITE_OK ){ 1976 if( rc!=SQLITE_OK ){
1977 if( rc==SQLITE_DONE ){ 1977 if( rc==SQLITE_DONE ){
1978 rc = SQLITE_OK; 1978 rc = SQLITE_OK;
1979 pPager->journalOff = szJ; 1979 pPager->journalOff = szJ;
1980 break; 1980 break;
> 1981 }else if( rc==SQLITE_IOERR_SHORT_READ ){
> 1982 /* If the journal has been truncated, simply stop reading and
> 1983 ** processing the journal. This might happen if the journal was
> 1984 ** not completely written and synced prior to a crash. In that
> 1985 ** case, the database should have never been written in the
> 1986 ** first place so it is OK to simply abandon the rollback. */
> 1987 rc = SQLITE_OK;
> 1988 goto end_playback;
1981 }else{ 1989 }else{
1982 /* If we are unable to rollback, quit and return the error 1990 /* If we are unable to rollback, quit and return the error
1983 ** code. This will cause the pager to enter the error state 1991 ** code. This will cause the pager to enter the error state
1984 ** so that no further harm will be done. Perhaps the next 1992 ** so that no further harm will be done. Perhaps the next
1985 ** process to come along will be able to rollback the database. 1993 ** process to come along will be able to rollback the database.
1986 */ 1994 */
1987 goto end_playback; 1995 goto end_playback;