/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/pager.c.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
....
5251
5252
5253
5254
5255
5256
5257
5258



5259
5260
5261
5262
5263
5264
5265
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** 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 $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/
................................................................................
  ** to exist, in case the transaction needs to roll back.  We allocate
  ** the page now, instead of at rollback, because we can better deal
  ** with an out-of-memory error now.  Ticket #3761.
  */
  if( MEMDB ){
    DbPage *pNew;
    rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
    if( rc!=SQLITE_OK ) return rc;



    sqlite3PagerUnref(pNew);
  }

  return SQLITE_OK;
}
#endif








|







 







|
>
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
....
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.606 2009/07/12 02:31:37 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/
................................................................................
  ** to exist, in case the transaction needs to roll back.  We allocate
  ** the page now, instead of at rollback, because we can better deal
  ** with an out-of-memory error now.  Ticket #3761.
  */
  if( MEMDB ){
    DbPage *pNew;
    rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1);
    if( rc!=SQLITE_OK ){
      sqlite3PcacheMove(pPg, origPgno);
      return rc;
    }
    sqlite3PagerUnref(pNew);
  }

  return SQLITE_OK;
}
#endif