Throw when exists() combined with CASE (#1382)
This commit is contained in:
parent
157b36162b
commit
4aacd45640
@ -507,6 +507,10 @@ bool SymbolGenerator::PreVisit(Exists &exists) {
|
|||||||
throw utils::NotYetImplemented("RETURN can not be used with exists, but only during matching!");
|
throw utils::NotYetImplemented("RETURN can not be used with exists, but only during matching!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scope.num_if_operators) {
|
||||||
|
throw utils::NotYetImplemented("IF operator cannot be used with exists, but only during matching!");
|
||||||
|
}
|
||||||
|
|
||||||
scope.in_exists = true;
|
scope.in_exists = true;
|
||||||
|
|
||||||
const auto &symbol = CreateAnonymousSymbol();
|
const auto &symbol = CreateAnonymousSymbol();
|
||||||
|
@ -97,3 +97,15 @@ Feature: Case
|
|||||||
Then the result should be:
|
Then the result should be:
|
||||||
| CASE name WHEN null THEN "doesn't work" WHEN 2 THEN "doesn't work" ELSE 'works' END |
|
| CASE name WHEN null THEN "doesn't work" WHEN 2 THEN "doesn't work" ELSE 'works' END |
|
||||||
| 'works' |
|
| 'works' |
|
||||||
|
|
||||||
|
Scenario: Test exists does not work in CASE clauses
|
||||||
|
Given an empty graph
|
||||||
|
And having executed:
|
||||||
|
"""
|
||||||
|
CREATE ()-[:T]->();
|
||||||
|
"""
|
||||||
|
When executing query:
|
||||||
|
"""
|
||||||
|
MATCH (a) WHERE CASE WHEN TRUE THEN exists(()-[]->()) END RETURN a;
|
||||||
|
"""
|
||||||
|
Then an error should be raised
|
||||||
|
@ -97,3 +97,15 @@ Feature: Case
|
|||||||
Then the result should be:
|
Then the result should be:
|
||||||
| CASE name WHEN null THEN "doesn't work" WHEN 2 THEN "doesn't work" ELSE 'works' END |
|
| CASE name WHEN null THEN "doesn't work" WHEN 2 THEN "doesn't work" ELSE 'works' END |
|
||||||
| 'works' |
|
| 'works' |
|
||||||
|
|
||||||
|
Scenario: Test exists does not work in CASE clauses
|
||||||
|
Given an empty graph
|
||||||
|
And having executed:
|
||||||
|
"""
|
||||||
|
CREATE ()-[:T]->();
|
||||||
|
"""
|
||||||
|
When executing query:
|
||||||
|
"""
|
||||||
|
MATCH (a) WHERE CASE WHEN TRUE THEN exists(()-[]->()) END RETURN a;
|
||||||
|
"""
|
||||||
|
Then an error should be raised
|
||||||
|
Loading…
Reference in New Issue
Block a user