/ Check-in [8153edf8]
Login

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

Overview
Comment:Save an if(...) clause made redundant by (3691). (CVS 3692)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8153edf8bea51b9344de1b700482879190f86fb4
User & Date: danielk1977 2007-03-15 15:35:29
Context
2007-03-16
18:30
Out-of-memory cleanup in tokenizers. Handle NULL return from malloc/calloc/realloc appropriately, and use sizeof(var) instead of sizeof(type) to make certain that we don't get a mismatch between them as the code rots. (CVS 3693) check-in: fbc53da8 user: shess tags: trunk
2007-03-15
15:35
Save an if(...) clause made redundant by (3691). (CVS 3692) check-in: 8153edf8 user: danielk1977 tags: trunk
15:33
Check for multiple calls to sqlite3FailedMalloc(). Ignore the second and subsequent calls. (CVS 3691) check-in: 71808745 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the ATTACH and DETACH commands.
    13     13   **
    14         -** $Id: attach.c,v 1.53 2006/06/27 16:34:57 danielk1977 Exp $
           14  +** $Id: attach.c,v 1.54 2007/03/15 15:35:29 danielk1977 Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** Resolve an expression that was part of an ATTACH or DETACH statement. This
    20     20   ** is slightly different from resolving a normal SQL expression, because simple
    21     21   ** identifiers are treated as strings, not possible column names or aliases.
................................................................................
   184    184         sqlite3BtreeClose(db->aDb[iDb].pBt);
   185    185         db->aDb[iDb].pBt = 0;
   186    186         db->aDb[iDb].pSchema = 0;
   187    187       }
   188    188       sqlite3ResetInternalSchema(db, 0);
   189    189       db->nDb = iDb;
   190    190       if( rc==SQLITE_NOMEM ){
   191         -      if( !sqlite3MallocFailed() ) sqlite3FailedMalloc();
          191  +      sqlite3FailedMalloc();
   192    192         sqlite3_snprintf(sizeof(zErr),zErr, "out of memory");
   193    193       }else{
   194    194         sqlite3_snprintf(sizeof(zErr),zErr, "unable to open database: %s", zFile);
   195    195       }
   196    196       goto attach_error;
   197    197     }
   198    198