/ Check-in [302ec768]
Login

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

Overview
Comment:Catch an out-of-memory condition in vacuum code. (Bug in (3373)). (CVS 3675)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:302ec768579e2f7c17a33749e685289a041aeb11
User & Date: danielk1977 2007-03-06 16:03:56
Context
2007-03-08
12:23
Change the documentation to be more specific about the restriction on the use of keywords. Ticket #2264. (CVS 3676) check-in: d03d4805 user: drh tags: trunk
2007-03-06
16:03
Catch an out-of-memory condition in vacuum code. (Bug in (3373)). (CVS 3675) check-in: 302ec768 user: danielk1977 tags: trunk
15:53
Fixes to the overflow-chain optization of (3672). (CVS 3674) check-in: d6986d1e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vacuum.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the VACUUM command.
    13     13   **
    14     14   ** Most of the code in this file may be omitted by defining the
    15     15   ** SQLITE_OMIT_VACUUM macro.
    16     16   **
    17         -** $Id: vacuum.c,v 1.66 2007/01/03 23:37:29 drh Exp $
           17  +** $Id: vacuum.c,v 1.67 2007/03/06 16:03:56 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "vdbeInt.h"
    21     21   #include "os.h"
    22     22   
    23     23   #ifndef SQLITE_OMIT_VACUUM
    24     24   /*
................................................................................
   116    116     zSql = 0;
   117    117     if( rc!=SQLITE_OK ) goto end_of_vacuum;
   118    118     pDb = &db->aDb[db->nDb-1];
   119    119     assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
   120    120     pTemp = db->aDb[db->nDb-1].pBt;
   121    121     sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain),
   122    122        sqlite3BtreeGetReserve(pMain));
          123  +  if( sqlite3MallocFailed() ){
          124  +    rc = SQLITE_NOMEM;
          125  +    goto end_of_vacuum;
          126  +  }
   123    127     assert( sqlite3BtreeGetPageSize(pTemp)==sqlite3BtreeGetPageSize(pMain) );
   124    128     rc = execSql(db, "PRAGMA vacuum_db.synchronous=OFF");
   125    129     if( rc!=SQLITE_OK ){
   126    130       goto end_of_vacuum;
   127    131     }
   128    132   
   129    133   #ifndef SQLITE_OMIT_AUTOVACUUM