diff --git a/src/graph/validator/LookupValidator.cpp b/src/graph/validator/LookupValidator.cpp index 4f185327280..31bbe16f4cc 100644 --- a/src/graph/validator/LookupValidator.cpp +++ b/src/graph/validator/LookupValidator.cpp @@ -191,6 +191,9 @@ Status LookupValidator::validateWhere() { } auto* filter = whereClause->filter(); + if (filter != nullptr) { + filter = graph::ExpressionUtils::rewriteParameter(filter, qctx_); + } if (FTIndexUtils::needTextSearch(filter)) { lookupCtx_->isFulltextIndex = true; lookupCtx_->fulltextExpr = filter; diff --git a/src/storage/ExprVisitorBase.cpp b/src/storage/ExprVisitorBase.cpp index 8d8b21ec603..d2f286b1fa2 100644 --- a/src/storage/ExprVisitorBase.cpp +++ b/src/storage/ExprVisitorBase.cpp @@ -33,9 +33,7 @@ void ExprVisitorBase::visit(SubscriptExpression *expr) { expr->left()->accept(this); expr->right()->accept(this); } -void ExprVisitorBase::visit(AttributeExpression *expr) { - fatal(expr); -} +void ExprVisitorBase::visit(AttributeExpression *) {} void ExprVisitorBase::visit(LogicalExpression *expr) { for (auto operand : expr->operands()) { operand->accept(this); diff --git a/tests/tck/features/yield/parameter.feature b/tests/tck/features/yield/parameter.feature index 3a9de58e15a..40fb28ea56d 100644 --- a/tests/tck/features/yield/parameter.feature +++ b/tests/tck/features/yield/parameter.feature @@ -252,7 +252,7 @@ Feature: Parameter """ LOOKUP ON player WHERE player.age>$p2+43 """ - Then a SemanticError should be raised at runtime: Column type error : age + Then a SemanticError should be raised at runtime: Type error `(true+43)' When executing query: """ MATCH (v:player) RETURN v LIMIT $p6 @@ -388,3 +388,18 @@ Feature: Parameter update edge on like "1"->"2" set likeness=likeness+$p6.a when likeness>$p1 """ Then the execution should be successful + When executing query: + """ + $var=lookup on player where player.name==$p6.c and player.age in [43,35,42,45] yield id(vertex) AS VertexID;DELETE VERTEX $var.VertexID;RETURN count($var.VertexID) AS record + """ + Then the execution should be successful + When executing query: + """ + $var=lookup on player where player.name==$p3 and player.age in [43,35,42,45] yield id(vertex) AS VertexID;DELETE VERTEX $var.VertexID;RETURN count($var.VertexID) AS record + """ + Then the execution should be successful + When executing query: + """ + $var=lookup on player where player.name==$p7.a.b.d[4] and player.age in [43,35,42,45] yield id(vertex) AS VertexID;DELETE VERTEX $var.VertexID;RETURN count($var.VertexID) AS record + """ + Then the execution should be successful