/ Check-in [18d030da0c]
Login

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

Overview
Comment:Catch another case where SQLITE_IOERR could be returned instead of SQLITE_NOMEM following an out-of-memory error. (CVS 5739)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 18d030da0c1755aab458e5aa0d3ad0a714706d67
User & Date: danielk1977 2008-09-23 17:39:26
Context
2008-09-24
09:12
Fix some function declarations (change "int foo()" to "int foo(void)"). Ticket #3399. (CVS 5740) check-in: 0fb98c3535 user: danielk1977 tags: trunk
2008-09-23
17:39
Catch another case where SQLITE_IOERR could be returned instead of SQLITE_NOMEM following an out-of-memory error. (CVS 5739) check-in: 18d030da0c user: danielk1977 tags: trunk
16:41
Always transform error code SQLITE_IOERR_NOMEM to SQLITE_NOMEM before returning. This was already happening in most places. (CVS 5738) check-in: 046ef07261 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.501 2008/09/22 17:22:20 danielk1977 Exp $
           17  +** $Id: main.c,v 1.502 2008/09/23 17:39:26 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   
    22     22   #ifdef SQLITE_ENABLE_FTS3
    23     23   # include "fts3.h"
    24     24   #endif
................................................................................
  1530   1530   
  1531   1531     /* Open the backend database driver */
  1532   1532     db->openFlags = flags;
  1533   1533     rc = sqlite3BtreeFactory(db, zFilename, 0, SQLITE_DEFAULT_CACHE_SIZE, 
  1534   1534                              flags | SQLITE_OPEN_MAIN_DB,
  1535   1535                              &db->aDb[0].pBt);
  1536   1536     if( rc!=SQLITE_OK ){
         1537  +    if( rc==SQLITE_IOERR_NOMEM ){
         1538  +      rc = SQLITE_NOMEM;
         1539  +    }
  1537   1540       sqlite3Error(db, rc, 0);
  1538   1541       goto opendb_out;
  1539   1542     }
  1540   1543     db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
  1541   1544     db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);
  1542   1545   
  1543   1546