]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
When an OOM fault occurs while moving a page for autovacuum in an in-memory
authordrh <drh@noemail.net>
Sun, 12 Jul 2009 02:31:36 +0000 (02:31 +0000)
committerdrh <drh@noemail.net>
Sun, 12 Jul 2009 02:31:36 +0000 (02:31 +0000)
database, be sure to undo the page move prior to returning the error, to
avoid corrupting the in-memory database file. (CVS 6883)

FossilOrigin-Name: d0964b93669123e228e7ce1890167447c56753b5

manifest
manifest.uuid
src/pager.c

index ee753a3ff0c5af0e56fc7d2b96c9056a15d5a0f0..58f9ea7dd4f39b60b1ea358f9d88d55f22234286 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\san\sunused\sparameter\sfrom\sthe\saccessPayload()\sfunction\sin\sbtree.c.\s(CVS\s6882)
-D 2009-07-11T18:26:29
+C When\san\sOOM\sfault\soccurs\swhile\smoving\sa\spage\sfor\sautovacuum\sin\san\sin-memory\ndatabase,\sbe\ssure\sto\sundo\sthe\spage\smove\sprior\sto\sreturning\sthe\serror,\sto\navoid\scorrupting\sthe\sin-memory\sdatabase\sfile.\s(CVS\s6883)
+D 2009-07-12T02:31:37
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -147,7 +147,7 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
 F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
 F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
-F src/pager.c 164c5b0160203d7fd26ad27bd168dff90f0f122a
+F src/pager.c e442d1caaeb30ab197d65514bdf41bba090800d6
 F src/pager.h 5aec418bf99f568b92ae82816a1463400513726d
 F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
 F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 6994b41a94a60f6460cf9814767db321ab3851f7
-R da8d0008fb07861a1469ffe34a7c142f
+P 7deb6568d89335926b77336756837c6dc3985529
+R 186b1819a0d45400cca179251342930e
 U drh
-Z bc5999a27b9e97e6525ec2bc92994493
+Z 012114440579d3a3fa4fe565db859264
index 4d09adb00ad75a9f6e480bf29f57c83b626fcdcb..ebae947e27d4e26b890cc1084ec084ef9b85fb7e 100644 (file)
@@ -1 +1 @@
-7deb6568d89335926b77336756837c6dc3985529
\ No newline at end of file
+d0964b93669123e228e7ce1890167447c56753b5
\ No newline at end of file
index e7c4e21310dfb8fa115352d6d66f96b4b01cb23c..0ee445717689526d81cf0c0e0abae9a0276f5c01 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.605 2009/07/07 13:56:24 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.606 2009/07/12 02:31:37 drh Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -5255,7 +5255,10 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
   if( MEMDB ){
     DbPage *pNew;
     rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
-    if( rc!=SQLITE_OK ) return rc;
+    if( rc!=SQLITE_OK ){
+      sqlite3PcacheMove(pPg, origPgno);
+      return rc;
+    }
     sqlite3PagerUnref(pNew);
   }