Fix for select 1;select 2 without trailing semi.

This commit is contained in:
Bruce Momjian 1999-05-22 05:06:43 +00:00
parent a8d2820e6d
commit e9edb3ef92
1 changed files with 9 additions and 14 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.82 1999/05/21 18:31:06 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.83 1999/05/22 05:06:43 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -360,25 +360,20 @@ Oid param_type(int t); /* used in parse_expr.c */
%left UNION INTERSECT EXCEPT
%%
stmtblock: stmtmulti
stmtblock: stmtmulti opt_semi
{ parsetree = $1; }
| stmt
{ parsetree = lcons($1,NIL); }
;
stmtmulti: stmtmulti stmt ';'
{ $$ = lappend($1, $2); }
/***S*I***/
/* We comment the next rule because it seems to be redundant
* and produces 16 shift/reduce conflicts with the new SelectStmt rule
* needed for EXCEPT and INTERSECTS. So far I did not notice any
* violations by removing the rule! */
/* | stmtmulti stmt
{ $$ = lappend($1, $2); } */
| stmt ';'
stmtmulti: stmtmulti ';' stmt
{ $$ = lappend($1, $3); }
| stmt
{ $$ = lcons($1,NIL); }
;
opt_semi: ';'
| /*EMPTY*/
;
stmt : AddAttrStmt
| AlterUserStmt
| ClosePortalStmt