/ Check-in [86f45d7b]
Login

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

Overview
Comment:Fix a typo in the previous check-in. Also simplify a line in select.c. (CVS 4631)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 86f45d7bb6f7d9e5c177be76d8a7ace754d52bcd
User & Date: drh 2007-12-14 16:11:09
Context
2007-12-14
17:22
Change to the crash simulator to give better diagnostics in case it runs out of memory while using the mem3.c allocator. (CVS 4632) check-in: 0d5747db user: drh tags: trunk
16:11
Fix a typo in the previous check-in. Also simplify a line in select.c. (CVS 4631) check-in: 86f45d7b user: drh tags: trunk
15:12
Fix an out-of-memory NULL pointer defer in the code generator. Ticket #2843. (CVS 4630) check-in: b821b6ed user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

     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 C code routines that are called by the parser
    13     13   ** to handle INSERT statements in SQLite.
    14     14   **
    15         -** $Id: insert.c,v 1.196 2007/12/14 15:12:21 drh Exp $
           15  +** $Id: insert.c,v 1.197 2007/12/14 16:11:09 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** Set P3 of the most recently inserted opcode to a column affinity
    21     21   ** string for index pIdx. A column affinity string has one character
    22     22   ** for each column in the table, according to the affinity of the column:
................................................................................
   106    106   ** run without using temporary table for the results of the SELECT. 
   107    107   */
   108    108   static int readsTable(Vdbe *v, int iStartAddr, int iDb, Table *pTab){
   109    109     int i;
   110    110     int iEnd = sqlite3VdbeCurrentAddr(v);
   111    111     for(i=iStartAddr; i<iEnd; i++){
   112    112       VdbeOp *pOp = sqlite3VdbeGetOp(v, i);
   113         -    assert( pOp==0 );
          113  +    assert( pOp!=0 );
   114    114       if( pOp->opcode==OP_OpenRead ){
   115    115         VdbeOp *pPrior = &pOp[-1];
   116    116         int tnum = pOp->p2;
   117    117         assert( i>iStartAddr );
   118    118         assert( pPrior->opcode==OP_Integer );
   119    119         if( pPrior->p1==iDb ){
   120    120           Index *pIndex;

Changes to src/select.c.

     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 C code routines that are called by the parser
    13     13   ** to handle SELECT statements in SQLite.
    14     14   **
    15         -** $Id: select.c,v 1.370 2007/12/13 21:54:11 drh Exp $
           15  +** $Id: select.c,v 1.371 2007/12/14 16:11:09 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   
    20     20   /*
    21     21   ** Delete all the content of a Select structure but do not deallocate
    22     22   ** the select structure itself.
................................................................................
  1460   1460   
  1461   1461     /* If the term is a simple identifier that try to match that identifier
  1462   1462     ** against a column name in the result set.
  1463   1463     */
  1464   1464     if( pE->op==TK_ID || (pE->op==TK_STRING && pE->token.z[0]!='\'') ){
  1465   1465       sqlite3 *db = pParse->db;
  1466   1466       char *zCol = sqlite3NameFromToken(db, &pE->token);
  1467         -    if( db->mallocFailed ){
  1468         -      sqlite3_free(zCol);
         1467  +    if( zCol==0 ){
  1469   1468         return -1;
  1470   1469       }
  1471   1470       for(i=0; i<pEList->nExpr; i++){
  1472   1471         char *zAs = pEList->a[i].zName;
  1473   1472         if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
  1474   1473           sqlite3_free(zCol);
  1475   1474           return i+1;