Fix crash caused by using exists() in a RETURN statement (#1303)
This commit is contained in:
parent
2fd34489af
commit
3143c986de
@ -518,6 +518,10 @@ bool SymbolGenerator::PreVisit(Exists &exists) {
|
||||
throw utils::NotYetImplemented("WITH can not be used with exists, but only during matching!");
|
||||
}
|
||||
|
||||
if (scope.in_return) {
|
||||
throw utils::NotYetImplemented("RETURN can not be used with exists, but only during matching!");
|
||||
}
|
||||
|
||||
scope.in_exists = true;
|
||||
|
||||
const auto &symbol = CreateAnonymousSymbol();
|
||||
|
@ -527,3 +527,15 @@ Feature: WHERE exists
|
||||
MATCH (n:Two) SET n.prop = exists((n)<-[:TYPE]-()) RETURN n.prop;
|
||||
"""
|
||||
Then an error should be raised
|
||||
|
||||
Scenario: Test exists does not work in RETURN clauses
|
||||
Given an empty graph
|
||||
And having executed:
|
||||
"""
|
||||
CREATE (:One {prop:1})-[:TYPE]->(:Two);
|
||||
"""
|
||||
When executing query:
|
||||
"""
|
||||
MATCH (n) RETURN exists((n)-[]-());
|
||||
"""
|
||||
Then an error should be raised
|
||||
|
Loading…
Reference in New Issue
Block a user