From 80070d382ab0068f83efb6de6d315e078b0636e1 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <132966438+Ami11111@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:05:07 +0800 Subject: [PATCH] Check match_sparse params (#1932) ### What problem does this PR solve? Check match_sparse params, only alpha and beta allowed Issue link:#1929 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Signed-off-by: Jin Hai Co-authored-by: Jin Hai --- src/planner/expression_binder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/planner/expression_binder.cpp b/src/planner/expression_binder.cpp index 32bf350948..59c0c82d53 100644 --- a/src/planner/expression_binder.cpp +++ b/src/planner/expression_binder.cpp @@ -898,6 +898,11 @@ SharedPtr ExpressionBinder::BuildSearchExpr(const SearchExpr &ex } case ParsedExprType::kMatchSparse: { const auto &match_sparse = *static_cast(match_expr); + for(auto ¶m : match_sparse.opt_params_){ + if(param->param_name_ != "alpha" and param->param_name_ != "beta" and param->param_name_ != "tail"){ + RecoverableError(Status::SyntaxError(fmt::format("Unsupported optional parameter: {}", param->param_name_))); + } + } if (match_sparse.filter_expr_) { have_filter_in_subsearch = true; }