Index: src/parse.y ================================================================== --- src/parse.y +++ src/parse.y @@ -12,11 +12,11 @@ ** This file contains SQLite's grammar for SQL. Process this file ** using the lemon parser generator to generate C code that runs ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.226 2007/05/11 01:44:52 drh Exp $ +** @(#) $Id: parse.y,v 1.227 2007/05/15 00:09:13 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" %token_prefix TK_ @@ -37,10 +37,11 @@ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); }else{ sqlite3ErrorMsg(pParse, "incomplete SQL statement"); } pParse->parseError = 1; + pParse->rc = SQLITE_ERROR; } } %stack_overflow { sqlite3ErrorMsg(pParse, "parser stack overflow"); pParse->parseError = 1; Index: test/alter.test ================================================================== --- test/alter.test +++ test/alter.test @@ -9,11 +9,11 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the ALTER TABLE statement. # -# $Id: alter.test,v 1.20 2007/05/08 12:37:46 danielk1977 Exp $ +# $Id: alter.test,v 1.21 2007/05/15 00:09:13 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -298,10 +298,15 @@ do_test alter-2.5 { catchsql { ALTER TABLE t3 RENAME TO sqlite_t3; } } {1 {object name reserved for internal use: sqlite_t3}} +do_test alter-2.6 { + catchsql { + ALTER TABLE t3 ADD COLUMN (ALTER TABLE t3 ADD COLUMN); + } +} {1 {near "(": syntax error}} # If this compilation does not include triggers, omit the alter-3.* tests. ifcapable trigger { #-----------------------------------------------------------------------