Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
fix match where agg check
Browse files Browse the repository at this point in the history
  • Loading branch information
czpmango committed Apr 6, 2021
1 parent 3f7ad2f commit 00bc4cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "common/expression/ReduceExpression.h"
#include "util/ParserUtil.h"
#include "util/ExpressionUtils.h"
#include "context/QueryContext.h"
#include "util/SchemaUtil.h"

Expand Down Expand Up @@ -1286,6 +1287,11 @@ with_clause

match_clause
: KW_MATCH match_path where_clause {
if (graph::ExpressionUtils::findAny($3->filter(),{Expression::Kind::kAggregate})) {
delete($3);
delete($2);
throw nebula::GraphParser::syntax_error(@3, "Invalid use of aggregating function "+$3->filter()->toString()+" in this context.");
}
$$ = new MatchClause($2, $3, false/*optinal*/);
}
| KW_OPTIONAL KW_MATCH match_path where_clause {
Expand Down

0 comments on commit 00bc4cb

Please sign in to comment.