Skip to content
Snippets Groups Projects
Unverified Commit b0cc455c authored by jie.wang's avatar jie.wang Committed by GitHub
Browse files

Fix date function crash (#943)


* fix date() crash

* use simple regex in the expected result of tck

Co-authored-by: default avatarYee <2520865+yixinglu@users.noreply.github.com>
parent 234042a5
No related branches found
No related tags found
No related merge requests found
......@@ -869,13 +869,7 @@ edge_prop_expression
function_call_expression
: LABEL L_PAREN opt_argument_list R_PAREN {
if (!$3) {
if (FunctionManager::find(*$1, 0).ok()) {
$$ = new FunctionCallExpression($1);
} else {
throw nebula::GraphParser::syntax_error(@1, "Unknown function ");
}
} else if ($3->numArgs() == 1 && AggFunctionManager::find(*$1).ok()) {
if ($3->numArgs() == 1 && AggFunctionManager::find(*$1).ok()) {
$$ = new AggregateExpression($1, $3->args()[0].release(), false);
delete($3);
} else if (FunctionManager::find(*$1, $3->numArgs()).ok()) {
......@@ -945,7 +939,7 @@ uuid_expression
opt_argument_list
: %empty {
$$ = nullptr;
$$ = new ArgumentList();
}
| argument_list {
$$ = $1;
......
......@@ -16,3 +16,13 @@ Feature: Function Call Expression
Then the result should be, in any order:
| a | b | c | d | e | f |
| 1 | -1 | 1 | -1 | 0 | 1 |
Scenario: date related
When executing query:
"""
YIELD timestamp("2000-10-10T10:00:00") AS a, date() AS b, time() AS c,
datetime() AS d
"""
Then the result should be, in any order:
| a | b | c | d |
| /^\d+$/ | /^\d{4}\-\d{2}-\d{2}$/ | /^\d{2}:\d{2}:\d{2}\.\d{6}$/ | /^\d{4}\-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}$/ |
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment