Skip to content

Commit

Permalink
Check match_sparse params (#1932)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
Co-authored-by: Jin Hai <[email protected]>
  • Loading branch information
Ami11111 and JinHai-CN authored Sep 29, 2024
1 parent 377ddcd commit 80070d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/planner/expression_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@ SharedPtr<BaseExpression> ExpressionBinder::BuildSearchExpr(const SearchExpr &ex
}
case ParsedExprType::kMatchSparse: {
const auto &match_sparse = *static_cast<const MatchSparseExpr *>(match_expr);
for(auto &param : 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;
}
Expand Down

0 comments on commit 80070d3

Please sign in to comment.