Skip to content

Commit

Permalink
Adding parser support for AT TIME ZONE (#215)
Browse files Browse the repository at this point in the history
* Adding parser support for AT TIME ZONE

Signed-off-by: Rishabh Tanwar <[email protected]>
Co-authored-by: Ashish Prasad <[email protected]>
Co-authored-by: Sai Rohan Basa <[email protected]>
Task: BABEL-4412
  • Loading branch information
3 people authored Sep 26, 2023
1 parent c7572cd commit 1f0851f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/backend/parser/gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -14539,10 +14539,20 @@ a_expr: c_expr { $$ = $1; }
}
| a_expr AT TIME ZONE a_expr %prec AT
{
$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
if(sql_dialect == SQL_DIALECT_TSQL)
{
$$ = (Node *) makeFuncCall(list_make2(makeString("sys"), makeString("timezone")),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
}
else
{
$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
list_make2($5, $1),
COERCE_SQL_SYNTAX,
@2);
}
}
/*
* These operators must be called out explicitly in order to make use
Expand Down

0 comments on commit 1f0851f

Please sign in to comment.