Skip to content

Commit

Permalink
Fix #1212. Return FoldConstantExprVisitor, if status_ already failed …
Browse files Browse the repository at this point in the history
…due to found syantax errors.
  • Loading branch information
xtcyclist committed Sep 1, 2022
1 parent 51d84a4 commit 4738331
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/visitor/FoldConstantExprVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void FoldConstantExprVisitor::visitBinaryExpr(BinaryExpression *expr) {

Expression *FoldConstantExprVisitor::fold(Expression *expr) {
// Container expression should remain the same type after being folded
if (expr->isContainerExpr()) {
if (expr->isContainerExpr() || !status_.ok()) {
return expr;
}

Expand Down
21 changes: 21 additions & 0 deletions tests/tck/features/expression/NotIn.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ Feature: Not In Expression
| r |
| false |

Scenario: Match Not In Set
Given a graph with space named "nba"
When executing query:
"""
match p0 = (n0)<-[e0:`like`|`teammate`|`teammate`]->(n1)
where id(n0) == "Suns"
and not (e0.like.likeness in [e0.teammate.end_year, ( e0.teammate.start_year ) ] )
or not (( "" ) not ends with ( "" + "" + "" ))
and ("" not in ( "" + "" + "" + "" ))
or (e0.teammate.start_year > ( e0.teammate.end_year ))
and (( ( ( e0.like.likeness ) ) ) / e0.teammate.start_year >
e0.teammate.start_year)
or (e0.like.likeness*e0.teammate.start_year%e0.teammate.end_year+
( ( e0.teammate.start_year ) ) > e0.teammate.end_year)
or (( ( ( ( e0.teammate.end_year ) ) ) ) in [9.8978784E7 ] )
return e0.like.likeness, e0.teammate.start_year, e0.teammate.start_year,
e0.teammate.end_year, e0.teammate.end_year
limit 91
"""
Then a SemanticError should be raised at runtime: Type error `("" NOT IN "")'
Scenario: Using NOT IN list in GO
Given a graph with space named "nba"
When executing query:
Expand Down

0 comments on commit 4738331

Please sign in to comment.