/ Check-in [54fa2227]
Login

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

Overview
Comment:Assume the malloc-failed flag cannot already be set when calling sqlite3_errmsg(16)(). (CVS 3745)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:54fa22273d551e00e1abd86992ff7c62ec4e0daf
User & Date: danielk1977 2007-03-29 15:00:53
Context
2007-03-29
16:30
Don't call ctype functions on hi-bit chars. Some platforms raise assertions when this occurs, and it's almost certainly not the right thing to do in the first place. (CVS 3746) check-in: f6c3abdc user: shess tags: trunk
15:00
Assume the malloc-failed flag cannot already be set when calling sqlite3_errmsg(16)(). (CVS 3745) check-in: 54fa2227 user: danielk1977 tags: trunk
13:35
Fix a bug in XFER optimization introduced by check-in (3736). (CVS 3744) check-in: 3714ac17 user: drh 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.362 2007/03/27 22:24:11 drh Exp $
           17  +** $Id: main.c,v 1.363 2007/03/29 15:00:53 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** The following constant value is used by the SQLITE_BIGENDIAN and
................................................................................
   726    726   
   727    727   /*
   728    728   ** Return UTF-8 encoded English language explanation of the most recent
   729    729   ** error.
   730    730   */
   731    731   const char *sqlite3_errmsg(sqlite3 *db){
   732    732     const char *z;
   733         -  if( !db || sqlite3MallocFailed() ){
          733  +  assert( !sqlite3MallocFailed() );
          734  +  if( !db ){
   734    735       return sqlite3ErrStr(SQLITE_NOMEM);
   735    736     }
   736    737     if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
   737    738       return sqlite3ErrStr(SQLITE_MISUSE);
   738    739     }
   739    740     z = (char*)sqlite3_value_text(db->pErr);
   740    741     if( z==0 ){
................................................................................
   765    766       0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ', 
   766    767       0, 'o', 0, 'u', 0, 't', 0, ' ', 
   767    768       0, 'o', 0, 'f', 0, ' ', 
   768    769       0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0
   769    770     };
   770    771   
   771    772     const void *z;
   772         -  if( sqlite3MallocFailed() ){
          773  +  assert( !sqlite3MallocFailed() );
          774  +  if( !db ){
   773    775       return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
   774    776     }
   775    777     if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
   776    778       return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
   777    779     }
   778    780     z = sqlite3_value_text16(db->pErr);
   779    781     if( z==0 ){