From 8993ce21647f00d029fdc6c7cf997f6a0c443cf2 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Wed, 18 Jan 2023 00:25:19 +0800 Subject: [PATCH] report errors on where clauses in optional match queries. --- src/parser/parser.yy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parser/parser.yy b/src/parser/parser.yy index 966e81c6f77..5f8d462cd5d 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -1682,7 +1682,11 @@ match_clause $$ = new MatchClause($2, $3, false/*optional*/); } | KW_OPTIONAL KW_MATCH match_path_list where_clause { - $$ = new MatchClause($3, $4, true); + if ($4 != nullptr) { + throw nebula::GraphParser::syntax_error(@4, "Where clause in optional match is not supported."); + } else { + $$ = new MatchClause($3, nullptr, true); + } } ;