Additional parsing bugs fixed. (CVS 3981)

FossilOrigin-Name: d12a8924c6083cdff14990b4fd036ca386c2e34a
This commit is contained in:
drh
2007-05-11 01:44:50 +00:00
parent db83f8231f
commit 4e05c83bc3
5 changed files with 30 additions and 32 deletions
+2 -3
View File
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.290 2007/05/11 00:20:08 drh Exp $
** $Id: expr.c,v 1.291 2007/05/11 01:44:51 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -280,10 +280,9 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
Vdbe *v = pParse->pVdbe;
Expr *p;
int depth;
static const Token zeroToken = { (u8*)"0", 0, 1 };
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
return sqlite3Expr(TK_INTEGER, 0, 0, &zeroToken);
return sqlite3Expr(TK_NULL, 0, 0, 0);
}
if( v==0 ) return 0;
p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);
+6 -9
View File
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.225 2007/05/10 10:46:57 danielk1977 Exp $
** @(#) $Id: parse.y,v 1.226 2007/05/11 01:44:52 drh Exp $
*/
// All token codes are small integers with #defines that begin with "TK_"
@@ -661,14 +661,11 @@ expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). {
expr(A) ::= ID(X) LP distinct(D) exprlist(Y) RP(E). {
if( Y->nExpr>SQLITE_MAX_FUNCTION_ARG ){
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &X);
sqlite3ExprListDelete(Y);
A = 0;
}else{
A = sqlite3ExprFunction(Y, &X);
sqlite3ExprSpan(A,&X,&E);
if( D && A ){
A->flags |= EP_Distinct;
}
}
A = sqlite3ExprFunction(Y, &X);
sqlite3ExprSpan(A,&X,&E);
if( D && A ){
A->flags |= EP_Distinct;
}
}
expr(A) ::= ID(X) LP STAR RP(E). {