From 47383316ab1ee5f5e3bcde934a1a866bbd2452a5 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:20:13 +0800 Subject: [PATCH] Fix #1212. Return FoldConstantExprVisitor, if status_ already failed due to found syantax errors. --- src/graph/visitor/FoldConstantExprVisitor.cpp | 2 +- tests/tck/features/expression/NotIn.feature | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/graph/visitor/FoldConstantExprVisitor.cpp b/src/graph/visitor/FoldConstantExprVisitor.cpp index 30cadcf8b25..16633288665 100644 --- a/src/graph/visitor/FoldConstantExprVisitor.cpp +++ b/src/graph/visitor/FoldConstantExprVisitor.cpp @@ -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; } diff --git a/tests/tck/features/expression/NotIn.feature b/tests/tck/features/expression/NotIn.feature index 6fce6111f2c..60fe563f379 100644 --- a/tests/tck/features/expression/NotIn.feature +++ b/tests/tck/features/expression/NotIn.feature @@ -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: