Index: src/expr.c ================================================================== --- src/expr.c +++ src/expr.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.215 2005/08/12 22:56:09 drh Exp $ +** $Id: expr.c,v 1.216 2005/08/12 22:58:53 drh Exp $ */ #include "sqliteInt.h" #include /* @@ -224,15 +224,15 @@ */ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){ Vdbe *v = pParse->pVdbe; Expr *p; int depth; - if( v==0 ) return 0; if( pParse->nested==0 ){ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken); return 0; } + if( v==0 ) return 0; p = sqlite3Expr(TK_REGISTER, 0, 0, pToken); if( p==0 ){ return 0; /* Malloc failed */ } depth = atoi(&pToken->z[1]); Index: test/main.test ================================================================== --- test/main.test +++ test/main.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is exercising the code in main.c. # -# $Id: main.test,v 1.20 2005/02/26 17:31:28 drh Exp $ +# $Id: main.test,v 1.21 2005/08/12 22:58:53 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Only do the next group of tests if the sqlite3_complete API is available @@ -303,7 +303,11 @@ } {1 {near "bogus": syntax error}} do_test main-3.5 { set v [catch {execsql {create}} msg] lappend v $msg } {1 {near "create": syntax error}} +do_test main-3.6 { + catchsql {SELECT 'abc' + #9} +} {1 {near "#9": syntax error}} + finish_test Index: test/trigger1.test ================================================================== --- test/trigger1.test +++ test/trigger1.test @@ -586,7 +586,12 @@ execsql { SELECT * FROM insert_log; } } {main 21 22 23 temp 24 25 26 aux 27 28 29} } + +do_test trigger1-11.1 { + catchsql {SELECT raise(abort,'message');} +} {1 {RAISE() may only be used within a trigger-program}} + finish_test