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

fixed case issue MOD-4872 #3403

Merged
merged 9 commits into from Feb 28, 2023
Merged

fixed case issue MOD-4872 #3403

merged 9 commits into from Feb 28, 2023

Conversation

DvirDukhan
Copy link
Contributor

This PR removes redunant "to lower" transformation for prefix nodes and introduces rm_strndupescape to duplicate and escape strings.
The prefix string will be modify to lower case when in

  1. tag - query_EvalSingleTagNode calls to tag_strtolower when tag field is case sensitive
  2. text - Query_EvalPrefixNode calls strToFoldedRunes which transform the query string into lower case regardless

added test
closes MOD-4872, closes #3391

rafie
rafie previously approved these changes Feb 20, 2023
rafie
rafie previously approved these changes Feb 20, 2023
@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Base: 82.72% // Head: 82.65% // Decreases project coverage by -0.07% ⚠️

Coverage data is based on head (9c8f622) compared to base (26a1f03).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3403      +/-   ##
==========================================
- Coverage   82.72%   82.65%   -0.07%     
==========================================
  Files         175      175              
  Lines       29921    29940      +19     
==========================================
- Hits        24752    24748       -4     
- Misses       5169     5192      +23     
Impacted Files Coverage Δ
src/query_param.c 81.81% <ø> (ø)
src/query.c 91.13% <100.00%> (+0.03%) ⬆️
src/util/strconv.h 100.00% <100.00%> (ø)
src/vector_index.c 81.78% <0.00%> (-7.29%) ⬇️
src/spec.c 87.86% <0.00%> (-0.07%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -213,7 +213,7 @@ QueryNode *NewPrefixNode_WithParams(QueryParseCtx *q, QueryToken *qt, bool prefi
ret->pfx.suffix = suffix;
q->numTokens++;
if (qt->type == QT_TERM) {
char *s = rm_strdupcase(qt->s, qt->len);
char *s = rm_strndup_unescape(qt->s, qt->len);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to also handle PARAMS, such as this test

(QT_TERM_CASE and QT_PARAM_TERM_CASE ?)

n->children = array_ensure_append(n->children, children + ii, 1, QueryNode *);
for(size_t jj = 0; jj < QueryNode_NumParams(child); ++jj) {
Param *p = child->params + jj;
p->type = PARAM_TERM_CASE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

When evaluating PARAM_TERM_CASE we use rm_strdup and not rm_strndup_unescape

*(char**)param->target = rm_strdup(val);

So we do not unescape params?

oshadmi
oshadmi previously approved these changes Feb 26, 2023
Copy link
Collaborator

@oshadmi oshadmi left a comment

Choose a reason for hiding this comment

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

Let's handle un-escaping params in another PR

@rafie rafie merged commit a21efd6 into master Feb 28, 2023
@rafie rafie deleted the dvirdu_mod-4872 branch February 28, 2023 04:28
rafie pushed a commit that referenced this pull request Feb 28, 2023
* fixed case issue
* rename function + fix test
* param bigfix + test
* Add waitForIndex in test:testGroupByWithApplyError
* Fix for test_short_read failure
* test_short_read fix 2

---------

Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com>
Co-authored-by: rafie <rafi@redislabs.com>
(cherry picked from commit a21efd6)
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.

Wildcards don't work on case sensitive tags
3 participants