Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(search_family): Add options test for the FT.AGGREGATE command #4479

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BagritsevichStepan
Copy link
Contributor

@BagritsevichStepan BagritsevichStepan commented Jan 20, 2025

related to the #4204

  1. Fix some small issues during parsing of the several SEARCH methods
  2. Remove using builder in Parse* methods.
    It was a bad decision to use it because, in some cases, we were returning an error with builder->SendError(...). However, in those cases, we were not handling parser errors with parser->Error(). As a result, debug builds were crashing because of this check:
CmdArgParser::~CmdArgParser() {
  DCHECK(!error_.has_value()) << "Parsing error occured but not checked";
}

Now, we ensure that parsing errors are processed in all cases.
3. Add options test for the FT.AGGREGATE command

@@ -119,7 +119,7 @@ struct CmdArgParser {

// Check if the next value is equal to a specific tag. If equal, its consumed.
template <class... Args> bool Check(std::string_view tag, Args*... args) {
if (cur_i_ + sizeof...(Args) >= args_.size())
if (cur_i_ + sizeof...(Args) >= args_.size() || error_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if an error occurred previously during parsing, why are we still returning true for parser->Check("TAG"), for example? It should simply skip all checks

@BagritsevichStepan BagritsevichStepan force-pushed the search/ft-aggregate-add-option-tests branch from 3570612 to 4926c1d Compare February 9, 2025 12:43
Signed-off-by: Stepan Bagritsevich <[email protected]>
@BagritsevichStepan BagritsevichStepan force-pushed the search/ft-aggregate-add-option-tests branch from 4926c1d to a047d47 Compare February 9, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants