Skip to content
Snippets Groups Projects
Unverified Commit d4e47276 authored by kyle.cao's avatar kyle.cao Committed by GitHub
Browse files

Fix match where clause (#766)


small change

small change

Co-authored-by: default avatarYee <2520865+yixinglu@users.noreply.github.com>
Co-authored-by: default avatarjie.wang <38901892+jievince@users.noreply.github.com>
parent cf0dce1c
No related branches found
No related tags found
No related merge requests found
......@@ -32,8 +32,16 @@ Status WhereClausePlanner::buildFilter(WhereClauseContext* wctx, SubPlan& subpla
auto rewriter = [wctx](const Expression* expr) {
return MatchSolver::doRewrite(*wctx->aliasesUsed, expr);
};
RewriteMatchLabelVisitor visitor(std::move(rewriter));
newFilter->accept(&visitor);
auto kind = newFilter->kind();
if (kind == Expression::Kind::kLabel
|| kind == Expression::Kind::kLabelAttribute) {
newFilter.reset(rewriter(newFilter.get()));
} else {
RewriteMatchLabelVisitor visitor(std::move(rewriter));
newFilter->accept(&visitor);
}
auto* cond = wctx->qctx->objPool()->add(newFilter.release());
subplan.root = Filter::make(wctx->qctx, nullptr, cond);
subplan.tail = subplan.root;
......
......@@ -361,6 +361,11 @@ Feature: Basic match
MATCH (v:player{name:"abc"})
"""
Then a SyntaxError should be raised at runtime: syntax error near `)'
When executing query:
"""
MATCH (v:player) where v.name return v
"""
Then a ExecutionError should be raised at runtime: Internal Error: Wrong type result, the type should be NULL,EMPTY or BOOL
Scenario: Unimplemented features
When executing query:
......
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