Fix SUBSTRING(str FROM int TO int) parsing.

This commit is contained in:
Thomas G. Lockhart 1997-09-26 15:09:11 +00:00
parent 142d42f938
commit b105324f7e
1 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.51 1997/09/25 14:11:42 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.52 1997/09/26 15:09:11 thomas Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -2938,9 +2938,7 @@ position_expr: attr opt_indirection
substr_list: expr_list substr_from substr_for
{
$$ = $1;
if ($2 != NULL) $$ = lappend($$, $2);
if ($3 != NULL) $$ = lappend($$, $3);
$$ = nconc(nconc($1,$2),$3);
}
| /* EMPTY */
{ $$ = NIL; }
@ -2949,7 +2947,12 @@ substr_list: expr_list substr_from substr_for
substr_from: FROM expr_list
{ $$ = $2; }
| /* EMPTY */
{ $$ = NIL; }
{
A_Const *n = makeNode(A_Const);
n->val.type = T_Integer;
n->val.val.ival = 1;
$$ = lcons((Node *)n,NIL);
}
;
substr_for: FOR expr_list