/ Check-in [d07cdd3c]
Login

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

Overview
Comment:Make sure the parser aborts quickly following a syntax error. (CVS 3996)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d07cdd3c096c120d104ae13f7932c0a955324517
User & Date: drh 2007-05-15 00:09:13
Context
2007-05-15
01:13
The built-in substr() function applied to a BLOB counts bytes, not characters. (CVS 3997) check-in: 75d57308 user: drh tags: trunk
00:09
Make sure the parser aborts quickly following a syntax error. (CVS 3996) check-in: d07cdd3c user: drh tags: trunk
2007-05-14
16:50
Fix a problem with ORDER BY and compound SELECT queries. (CVS 3995) check-in: af76928f user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains SQLite's grammar for SQL.  Process this file
    13     13   ** using the lemon parser generator to generate C code that runs
    14     14   ** the parser.  Lemon will also generate a header file containing
    15     15   ** numeric codes for all of the tokens.
    16     16   **
    17         -** @(#) $Id: parse.y,v 1.226 2007/05/11 01:44:52 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.227 2007/05/15 00:09:13 drh Exp $
    18     18   */
    19     19   
    20     20   // All token codes are small integers with #defines that begin with "TK_"
    21     21   %token_prefix TK_
    22     22   
    23     23   // The type of the data attached to each token is Token.  This is also the
    24     24   // default type for non-terminals.
................................................................................
    35     35     if( !pParse->parseError ){
    36     36       if( TOKEN.z[0] ){
    37     37         sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
    38     38       }else{
    39     39         sqlite3ErrorMsg(pParse, "incomplete SQL statement");
    40     40       }
    41     41       pParse->parseError = 1;
           42  +    pParse->rc = SQLITE_ERROR;
    42     43     }
    43     44   }
    44     45   %stack_overflow {
    45     46     sqlite3ErrorMsg(pParse, "parser stack overflow");
    46     47     pParse->parseError = 1;
    47     48   }
    48     49   

Changes to test/alter.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the ALTER TABLE statement.
    13     13   #
    14         -# $Id: alter.test,v 1.20 2007/05/08 12:37:46 danielk1977 Exp $
           14  +# $Id: alter.test,v 1.21 2007/05/15 00:09:13 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
    21     21   ifcapable !altertable {
................................................................................
   296    296     }
   297    297   } {1 {table sqlite_master may not be altered}}
   298    298   do_test alter-2.5 {
   299    299     catchsql {
   300    300       ALTER TABLE t3 RENAME TO sqlite_t3;
   301    301     }
   302    302   } {1 {object name reserved for internal use: sqlite_t3}}
          303  +do_test alter-2.6 {
          304  +  catchsql {
          305  +    ALTER TABLE t3 ADD COLUMN (ALTER TABLE t3 ADD COLUMN);
          306  +  }
          307  +} {1 {near "(": syntax error}}
   303    308   
   304    309   # If this compilation does not include triggers, omit the alter-3.* tests.
   305    310   ifcapable trigger {
   306    311   
   307    312   #-----------------------------------------------------------------------
   308    313   # Tests alter-3.* test ALTER TABLE on tables that have triggers.
   309    314   #