Skip to content

Commit e9edb3e

Browse files
committed
Fix for select 1;select 2 without trailing semi.
1 parent a8d2820 commit e9edb3e

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/backend/parser/gram.y

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.82 1999/05/21 18:31:06 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.83 1999/05/22 05:06:43 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -360,25 +360,20 @@ Oid param_type(int t); /* used in parse_expr.c */
360360
%left UNION INTERSECT EXCEPT
361361
%%
362362

363-
stmtblock: stmtmulti
363+
stmtblock: stmtmulti opt_semi
364364
{ parsetree = $1; }
365-
| stmt
366-
{ parsetree = lcons($1,NIL); }
367365
;
368366

369-
stmtmulti: stmtmulti stmt ';'
370-
{ $$ = lappend($1, $2); }
371-
/***S*I***/
372-
/* We comment the next rule because it seems to be redundant
373-
* and produces 16 shift/reduce conflicts with the new SelectStmt rule
374-
* needed for EXCEPT and INTERSECTS. So far I did not notice any
375-
* violations by removing the rule! */
376-
/* | stmtmulti stmt
377-
{ $$ = lappend($1, $2); } */
378-
| stmt ';'
367+
stmtmulti: stmtmulti ';' stmt
368+
{ $$ = lappend($1, $3); }
369+
| stmt
379370
{ $$ = lcons($1,NIL); }
380371
;
381372

373+
opt_semi: ';'
374+
| /*EMPTY*/
375+
;
376+
382377
stmt : AddAttrStmt
383378
| AlterUserStmt
384379
| ClosePortalStmt

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy