/ Check-in [d0964b93]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d0964b93669123e228e7ce1890167447c56753b5
User & Date: drh 2009-07-12 02:31:37
Context
2009-07-12
02:32
Simplifications to btree.c to help facilitate coverage testing. (CVS 6884) check-in: dfb146ef user: drh tags: trunk
02:31
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) check-in: d0964b93 user: drh tags: trunk
2009-07-11
18:26
Remove an unused parameter from the accessPayload() function in btree.c. (CVS 6882) check-in: 7deb6568 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.605 2009/07/07 13:56:24 danielk1977 Exp $
           21  +** @(#) $Id: pager.c,v 1.606 2009/07/12 02:31:37 drh Exp $
    22     22   */
    23     23   #ifndef SQLITE_OMIT_DISKIO
    24     24   #include "sqliteInt.h"
    25     25   
    26     26   /*
    27     27   ** Macros for troubleshooting.  Normally turned off
    28     28   */
................................................................................
  5251   5251     ** to exist, in case the transaction needs to roll back.  We allocate
  5252   5252     ** the page now, instead of at rollback, because we can better deal
  5253   5253     ** with an out-of-memory error now.  Ticket #3761.
  5254   5254     */
  5255   5255     if( MEMDB ){
  5256   5256       DbPage *pNew;
  5257   5257       rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
  5258         -    if( rc!=SQLITE_OK ) return rc;
         5258  +    if( rc!=SQLITE_OK ){
         5259  +      sqlite3PcacheMove(pPg, origPgno);
         5260  +      return rc;
         5261  +    }
  5259   5262       sqlite3PagerUnref(pNew);
  5260   5263     }
  5261   5264   
  5262   5265     return SQLITE_OK;
  5263   5266   }
  5264   5267   #endif
  5265   5268