提交 b105324f 编写于 作者: T Thomas G. Lockhart

Fix SUBSTRING(str FROM int TO int) parsing.

上级 142d42f9
...@@ -10,7 +10,7 @@ ...@@ -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 ...@@ -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 ...@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册