diff options
Diffstat (limited to 'src/backend/parser/gram.y')
| -rw-r--r-- | src/backend/parser/gram.y | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 9054742427..9384214942 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -198,8 +198,6 @@ static Node *makeAndExpr(Node *lexpr, Node *rexpr, int location); static Node *makeOrExpr(Node *lexpr, Node *rexpr, int location); static Node *makeNotExpr(Node *expr, int location); static Node *makeAArrayExpr(List *elements, int location); -static Node *makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, - int location); static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args, int location); static List *mergeTableFuncParameters(List *func_args, List *columns); @@ -15195,39 +15193,66 @@ func_expr_common_subexpr: } | CURRENT_DATE { - $$ = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("current_date"), + NIL, + COERCE_SQL_SYNTAX, + @1); } | CURRENT_TIME { - $$ = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("current_time"), + NIL, + COERCE_SQL_SYNTAX, + @1); } | CURRENT_TIME '(' Iconst ')' { - $$ = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, $3, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("current_time"), + list_make1(makeIntConst($3, @3)), + COERCE_SQL_SYNTAX, + @1); } | CURRENT_TIMESTAMP { - $$ = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("current_timestamp"), + NIL, + COERCE_SQL_SYNTAX, + @1); } | CURRENT_TIMESTAMP '(' Iconst ')' { - $$ = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, $3, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("current_timestamp"), + list_make1(makeIntConst($3, @3)), + COERCE_SQL_SYNTAX, + @1); } | LOCALTIME { - $$ = makeSQLValueFunction(SVFOP_LOCALTIME, -1, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("localtime"), + NIL, + COERCE_SQL_SYNTAX, + @1); } | LOCALTIME '(' Iconst ')' { - $$ = makeSQLValueFunction(SVFOP_LOCALTIME_N, $3, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("localtime"), + list_make1(makeIntConst($3, @3)), + COERCE_SQL_SYNTAX, + @1); } | LOCALTIMESTAMP { - $$ = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("localtimestamp"), + NIL, + COERCE_SQL_SYNTAX, + @1); } | LOCALTIMESTAMP '(' Iconst ')' { - $$ = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, $3, @1); + $$ = (Node *) makeFuncCall(SystemFuncName("localtimestamp"), + list_make1(makeIntConst($3, @3)), + COERCE_SQL_SYNTAX, + @1); } | CURRENT_ROLE { @@ -18167,18 +18192,6 @@ makeAArrayExpr(List *elements, int location) } static Node * -makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, int location) -{ - SQLValueFunction *svf = makeNode(SQLValueFunction); - - svf->op = op; - /* svf->type will be filled during parse analysis */ - svf->typmod = typmod; - svf->location = location; - return (Node *) svf; -} - -static Node * makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args, int location) { |
