From: dan Date: Wed, 2 Jun 2010 17:15:24 +0000 (+0000) Subject: If an error occurs while writing frames to the log to commit a transaction, do not... X-Git-Tag: version-3.7.2~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10ec894c3a07e21c164e5589324165eba01ea1bd;p=thirdparty%2Fsqlite.git If an error occurs while writing frames to the log to commit a transaction, do not mark the pages as clean in the cache. Otherwise, the subsequent rollback does not roll them back (leaving the client to continue with a cache that makes it appear that the transaction was committed - inconsistent with the database on disk). FossilOrigin-Name: cb571c1b71a37b3a10d640987c77a6eec508235d --- diff --git a/manifest b/manifest index 1e9b36fa4e..7719de6b69 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Added\simplementation\sof\svfslog_time()\sfor\sWindows\stesting. -D 2010-06-02T16:40:55 +C If\san\serror\soccurs\swhile\swriting\sframes\sto\sthe\slog\sto\scommit\sa\stransaction,\sdo\snot\smark\sthe\spages\sas\sclean\sin\sthe\scache.\sOtherwise,\sthe\ssubsequent\srollback\sdoes\snot\sroll\sthem\sback\s(leaving\sthe\sclient\sto\scontinue\swith\sa\scache\sthat\smakes\sit\sappear\sthat\sthe\stransaction\swas\scommitted\s-\sinconsistent\swith\sthe\sdatabase\son\sdisk). +D 2010-06-02T17:15:25 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -154,7 +154,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19 F src/os_unix.c 8fa4eeb27c54f26e9ce01bead2fa117fadea1526 F src/os_win.c f815403c51a2adad30244374c801dd7fd2734567 -F src/pager.c acbef227bf158776449907c275c5d9332e4e52f9 +F src/pager.c fa5ce633dac820ad15896c8b651a21487e764fe1 F src/pager.h 76466c3a5af56943537f68b1f16567101a0cd1d0 F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c ace8f6a5ecd4711cc66a1b23053be7109bd437cf @@ -815,7 +815,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P c3606f3985e4ab38479409c13f3a01d1be4f8189 -R 713c6c4f6edb5a9fc8fea5e21eed458c -U shaneh -Z 68efeee2b3c24d365a6309078d4fa333 +P b3109f85bde0b24bfbcfe6c0f7bbe973be196c1d +R 830ef9967206d6e34b488a57bc115b0c +U dan +Z 189de0d7978aa94a58fbada93d61bb5d diff --git a/manifest.uuid b/manifest.uuid index 4e293ef99a..fea9134b6c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b3109f85bde0b24bfbcfe6c0f7bbe973be196c1d \ No newline at end of file +cb571c1b71a37b3a10d640987c77a6eec508235d \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 3eb1233483..416e9ed135 100644 --- a/src/pager.c +++ b/src/pager.c @@ -5082,7 +5082,9 @@ int sqlite3PagerCommitPhaseOne( (pPager->fullSync ? pPager->sync_flags : 0) ); } - sqlite3PcacheCleanAll(pPager->pPCache); + if( rc==SQLITE_OK ){ + sqlite3PcacheCleanAll(pPager->pPCache); + } }else{ /* The following block updates the change-counter. Exactly how it ** does this depends on whether or not the atomic-update optimization