diff --git a/src/graph/validator/LookupValidator.cpp b/src/graph/validator/LookupValidator.cpp index 9a5a73fd93d..a3a9500cb97 100644 --- a/src/graph/validator/LookupValidator.cpp +++ b/src/graph/validator/LookupValidator.cpp @@ -442,8 +442,7 @@ StatusOr LookupValidator::checkConstExpr(Expression* expr, if (type == nebula::cpp2::PropertyType::UNKNOWN) { return Status::SemanticError("Invalid column: %s", prop.c_str()); } - QueryExpressionContext dummy(nullptr); - auto v = Expression::eval(expr, dummy); + auto v = Expression::eval(expr, QueryExpressionContext(qctx_->ectx())()); // TODO(Aiee) extract the type cast logic as a method if we decide to support // more cross-type comparisons. diff --git a/tests/tck/features/yield/parameter.feature b/tests/tck/features/yield/parameter.feature index fd5ea74fdbf..58bd96d71c9 100644 --- a/tests/tck/features/yield/parameter.feature +++ b/tests/tck/features/yield/parameter.feature @@ -98,6 +98,19 @@ Feature: Parameter | "Tim Duncan" | Scenario: ngql with parameters + When executing query: + """ + LOOKUP ON player where player.age>$p1+40 YIELD player.name AS name + """ + Then the result should be, in any order: + | name | + | "Grant Hill" | + | "Jason Kidd" | + | "Vince Carter" | + | "Tim Duncan" | + | "Shaquille O'Neal" | + | "Steve Nash" | + | "Ray Allen" | When executing query: """ $p1=GO FROM "Tim Duncan" OVER like WHERE like.likeness>$p1 yield like._dst as dst;