1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

When an OOM fault occurs while moving a page for autovacuum in an in-memory

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
This commit is contained in:
drh
2009-07-12 02:31:36 +00:00
parent fb1926837a
commit 6a8b8d3cc8
3 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
C Remove\san\sunused\sparameter\sfrom\sthe\saccessPayload()\sfunction\sin\sbtree.c.\s(CVS\s6882) 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-11T18:26:29 D 2009-07-12T02:31:37
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -147,7 +147,7 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405 F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
F src/pager.c 164c5b0160203d7fd26ad27bd168dff90f0f122a F src/pager.c e442d1caaeb30ab197d65514bdf41bba090800d6
F src/pager.h 5aec418bf99f568b92ae82816a1463400513726d F src/pager.h 5aec418bf99f568b92ae82816a1463400513726d
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5 F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P 6994b41a94a60f6460cf9814767db321ab3851f7 P 7deb6568d89335926b77336756837c6dc3985529
R da8d0008fb07861a1469ffe34a7c142f R 186b1819a0d45400cca179251342930e
U drh U drh
Z bc5999a27b9e97e6525ec2bc92994493 Z 012114440579d3a3fa4fe565db859264

View File

@@ -1 +1 @@
7deb6568d89335926b77336756837c6dc3985529 d0964b93669123e228e7ce1890167447c56753b5

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** 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 #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -5255,7 +5255,10 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
if( MEMDB ){ if( MEMDB ){
DbPage *pNew; DbPage *pNew;
rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1); rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
if( rc!=SQLITE_OK ) return rc; if( rc!=SQLITE_OK ){
sqlite3PcacheMove(pPg, origPgno);
return rc;
}
sqlite3PagerUnref(pNew); sqlite3PagerUnref(pNew);
} }