/ Check-in [d9392949]
Login

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

Overview
Comment:Bug fix: do not segfault if a SELECT without a FROM clause includes the * wildcard in the result column list. (CVS 609)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d939294994e5f6c7862b66573301e111e56a2681
User & Date: drh 2002-06-06 23:42:28
Context
2002-06-08
23:25
Add optimizations for the IN operator in WHERE clauses. This is a partial implementation of enhancement #63. Still need to add test cases. (CVS 610) check-in: 8481e841 user: drh tags: trunk
2002-06-06
23:42
Bug fix: do not segfault if a SELECT without a FROM clause includes the * wildcard in the result column list. (CVS 609) check-in: d9392949 user: drh tags: trunk
23:30
Fix for ticket #59: Add documentation for the || operator. Also added documentation for the new SQL92 join syntax. (CVS 608) check-in: a0abef62 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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.91 2002/06/06 18:54:40 drh Exp $
           15  +** $Id: select.c,v 1.92 2002/06/06 23:42:28 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** Allocate a new Select structure and return a pointer to that
    21     21   ** structure.
    22     22   */
................................................................................
   724    724                 pExpr = pRight;
   725    725                 pExpr->span = pExpr->token;
   726    726               }
   727    727               pNew = sqliteExprListAppend(pNew, pExpr, 0);
   728    728             }
   729    729           }
   730    730           if( !tableSeen ){
   731         -          assert( pName!=0 );
   732         -          sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1, 
   733         -            pName->z, pName->n, 0);
          731  +          if( pName ){
          732  +            sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1, 
          733  +              pName->z, pName->n, 0);
          734  +          }else{
          735  +            sqliteSetString(&pParse->zErrMsg, "no tables specified", 0);
          736  +          }
   734    737             rc = 1;
   735    738           }
   736    739         }
   737    740       }
   738    741       sqliteExprListDelete(pEList);
   739    742       p->pEList = pNew;
   740    743     }

Changes to test/misc1.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for miscellanous features that were
    14     14   # left out of other test files.
    15     15   #
    16         -# $Id: misc1.test,v 1.6 2002/05/24 02:14:50 drh Exp $
           16  +# $Id: misc1.test,v 1.7 2002/06/06 23:42:28 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # Test the creation and use of tables that have a large number
    22     22   # of columns.
    23     23   #
................................................................................
   223    223   } {0 {}}
   224    224   do_test misc1-7.6 {
   225    225     execsql {
   226    226       SELECT * FROM t5 ORDER BY a;
   227    227     }
   228    228   } {0 2 4 1 2 3}
   229    229   
          230  +do_test misc1-8.1 {
          231  +  catchsql {
          232  +    SELECT *;
          233  +  }
          234  +} {1 {no tables specified}}
          235  +do_test misc1-8.2 {
          236  +  catchsql {
          237  +    SELECT t1.*;
          238  +  }
          239  +} {1 {no such table: t1}}
          240  +
   230    241   
   231    242   finish_test