diff --git a/src/parser/parser.yy b/src/parser/parser.yy index 36d98cdb5a3f400c6415b65cd67ea91493cc2868..b2b257b6b57865b71f97b7d3845503bd8534a43b 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -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; diff --git a/tests/tck/features/expression/FunctionCall.feature b/tests/tck/features/expression/FunctionCall.feature index 8b60169175607dfdcdbd82402eb95186644202a6..b053830c05c06b0b6af8f50f88717fd9c29b03ea 100644 --- a/tests/tck/features/expression/FunctionCall.feature +++ b/tests/tck/features/expression/FunctionCall.feature @@ -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}$/ |