File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 10
10
*
11
11
*
12
12
* IDENTIFICATION
13
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.106 1999/10/03 23:55:30 tgl Exp $
13
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.107 1999/10/05 18:14:31 momjian Exp $
14
14
*
15
15
* HISTORY
16
16
* AUTHOR DATE MAJOR EVENT
@@ -365,20 +365,29 @@ Oid param_type(int t); /* used in parse_expr.c */
365
365
%left UNION INTERSECT EXCEPT
366
366
%%
367
367
368
- stmtblock: stmtmulti opt_semi
368
+ /*
369
+ * Handle comment-only lines, and ;; SELECT * FROM pg_class ;;;
370
+ * psql already handles such cases, but other interfaces don't.
371
+ * bjm 1999/10/05
372
+ */
373
+ stmtblock: stmtmulti
369
374
{ parsetree = $1; }
370
375
;
371
376
372
377
stmtmulti: stmtmulti ';' stmt
373
- { $$ = lappend($1, $3); }
378
+ { if ($3 != (Node *)NIL)
379
+ $$ = lappend($1, $3);
380
+ else
381
+ $$ = $1;
382
+ }
374
383
| stmt
375
- { $$ = lcons($1,NIL); }
384
+ { if ($1 != (Node *)NIL)
385
+ $$ = lcons($1,NIL);
386
+ else
387
+ $$ = (Node *)NIL;
388
+ }
376
389
;
377
390
378
- opt_semi: ';'
379
- | /*EMPTY*/
380
- ;
381
-
382
391
stmt : AddAttrStmt
383
392
| AlterUserStmt
384
393
| ClosePortalStmt
@@ -423,6 +432,8 @@ stmt : AddAttrStmt
423
432
| VariableShowStmt
424
433
| VariableResetStmt
425
434
| ConstraintsSetStmt
435
+ | /*EMPTY*/
436
+ { $$ = (Node *)NIL; }
426
437
;
427
438
428
439
/*****************************************************************************
You can’t perform that action at this time.
0 commit comments