/ Check-in [c8394ac2]
Login

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

Overview
Comment:Fix a bug introduced by checkin (4739). (CVS 4741)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c8394ac24b87707fa7f2e3cb43ad8efb65d2595e
User & Date: drh 2008-01-22 19:34:28
Context
2008-01-22
21:30
Add the fault injector module in fault.c. Use it as a basis for memory allocation failure testing. (CVS 4742) check-in: 1a335e18 user: drh tags: trunk
19:34
Fix a bug introduced by checkin (4739). (CVS 4741) check-in: c8394ac2 user: drh tags: trunk
16:35
Detect and report a particular type of database corruption that would formerly cause a segfault. (CVS 4740) check-in: f47cf3cc user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/prepare.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains the implementation of the sqlite3_prepare()
    13     13   ** interface, and routines that contribute to loading the database schema
    14     14   ** from disk.
    15     15   **
    16         -** $Id: prepare.c,v 1.73 2008/01/22 16:35:37 drh Exp $
           16  +** $Id: prepare.c,v 1.74 2008/01/22 19:34:28 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include <ctype.h>
    20     20   
    21     21   /*
    22     22   ** Fill the InitData structure with an error message that indicates
    23     23   ** that the database is corrupt.
................................................................................
    82     82           db->mallocFailed = 1;
    83     83         }else if( rc!=SQLITE_INTERRUPT ){
    84     84           corruptSchema(pData, zErr);
    85     85         }
    86     86         sqlite3_free(zErr);
    87     87         return 1;
    88     88       }
    89         -  }else if( argv[2]==0 ){
           89  +  }else if( argv[0]==0 ){
    90     90       corruptSchema(pData, 0);
    91     91     }else{
    92     92       /* If the SQL column is blank it means this is an index that
    93     93       ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
    94     94       ** constraint for a CREATE TABLE.  The index should have already
    95     95       ** been created when we processed the CREATE TABLE.  All we have
    96     96       ** to do here is record the root page number for that index.