From: drh Date: Sat, 3 Apr 2010 13:08:09 +0000 (+0000) Subject: Silently abandon a rollback if the journal has been truncated. X-Git-Tag: version-3.7.2~493 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d83c0fdd55575b58ca39da25882ff77e11391fb;p=thirdparty%2Fsqlite.git Silently abandon a rollback if the journal has been truncated. FossilOrigin-Name: 7626f6c9ea04d1a5690dd11bb13e8c3c04e3b0f5 --- diff --git a/manifest b/manifest index f6fb251118..780eaec514 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Check\sfor\sa\sfailure\sin\sthe\scall\sto\ssqlite3PagerPagecount()\sfrom\swithin\nsqlite3PagerWrite().\s\s(Error\sdiscovered\sby\svalgrind.) -D 2010-04-02T13:25:22 +C Silently\sabandon\sa\srollback\sif\sthe\sjournal\shas\sbeen\struncated. +D 2010-04-03T13:08:10 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -155,7 +155,7 @@ F src/os_common.h 240c88b163b02c21a9f21f87d49678a0aa21ff30 F src/os_os2.c 75a8c7b9a00a2cf1a65f9fa4afbc27d46634bb2f F src/os_unix.c 148d2f625db3727250c0b880481ae7630b6d0eb0 F src/os_win.c 1c7453c2df4dab26d90ff6f91272aea18bcf7053 -F src/pager.c 4f21866040755ce5197b2aeb2be0347b4eb8533f +F src/pager.c 044c27315eccca1a2304bf81cbc00fa22f2e62bb F src/pager.h ef8a2cf10084f60ab45ee2dfded8bf8b0c655ddf F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c ace8f6a5ecd4711cc66a1b23053be7109bd437cf @@ -797,14 +797,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 937b931a7cdad6874638158ed6a9ab6356b0bd0c -R 73d7e6cd9e7a10e0bf151c9030c3b0d7 +P d64d181c79aee3501be6f7eb8c11ab2cc9a8d63c +R 3bdad3b76e18f681c1678d561acddbce U drh -Z 8d895a1ff28772dc8276f305b1442c69 +Z ebdfae7bcabbf0ea17047bbf6cf050c7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFLtfBFoxKgR168RlERAqICAJ9gxXTQ86C6yFFViOOB09EP7vEcTgCeND0B -nBWy7JzkNrn+iM2JC6lOT94= -=zLIR +iD8DBQFLtz29oxKgR168RlERAuqsAJ4hKN76txIcKQDlFSgIapQDRryKkQCePyBi +S7/nszC7vd1px1L9m9QGYc0= +=nWWr -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 515decc36b..5088c15e1b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d64d181c79aee3501be6f7eb8c11ab2cc9a8d63c \ No newline at end of file +7626f6c9ea04d1a5690dd11bb13e8c3c04e3b0f5 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 7182f34e6d..03fd077da1 100644 --- a/src/pager.c +++ b/src/pager.c @@ -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