Fix SUBSTRING(str FROM int TO int) parsing.
This commit is contained in:
parent
142d42f938
commit
b105324f7e
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -2938,9 +2938,7 @@ position_expr: attr opt_indirection
|
|||||||
|
|
||||||
substr_list: expr_list substr_from substr_for
|
substr_list: expr_list substr_from substr_for
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = nconc(nconc($1,$2),$3);
|
||||||
if ($2 != NULL) $$ = lappend($$, $2);
|
|
||||||
if ($3 != NULL) $$ = lappend($$, $3);
|
|
||||||
}
|
}
|
||||||
| /* EMPTY */
|
| /* EMPTY */
|
||||||
{ $$ = NIL; }
|
{ $$ = NIL; }
|
||||||
@ -2949,7 +2947,12 @@ substr_list: expr_list substr_from substr_for
|
|||||||
substr_from: FROM expr_list
|
substr_from: FROM expr_list
|
||||||
{ $$ = $2; }
|
{ $$ = $2; }
|
||||||
| /* EMPTY */
|
| /* 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
|
substr_for: FOR expr_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user