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

mango: fix $beginsWith range #4830

Closed
wants to merge 1 commit into from
Closed

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Nov 2, 2023

This is a full jenkin runs for the mango-begingswith-fixes pr

In the intial implementation of $beginsWith, the range calculation
for json indexes mistakenly appends an integer with the size of
8 bits which gets maxed out at FF, rather than building a binary
with an extra 3 bytes at the end.

This commit fixes the `mango_idx_view:range/5` by correctly appending
the `U+FFFF` code point to create a utf-8 encoded binary. Additionally,
the Erlang `utf8` binary type ensures the result
is a valid utf8 string. If `Arg` is not a utf8 binary, this will
throw a badarg error.

We expect `Arg` strings to be a valid utf8 but, to be safe,
`mango_selector:norm_ops/1` is enhanced to verify
that any argument to `$beginsWith` is a utf8 string.
@pgj
Copy link
Contributor

pgj commented Nov 2, 2023

Why is not #4829 enough?

@nickva
Copy link
Contributor Author

nickva commented Nov 2, 2023

Why is not #4829 enough?

noticed some failures there and was wondering if it just need to be rebased

@pgj
Copy link
Contributor

pgj commented Nov 2, 2023

Okay.

@nickva
Copy link
Contributor Author

nickva commented Nov 2, 2023

the build passed! closing the pr

@nickva nickva closed this Nov 2, 2023
@nickva nickva deleted the jenkins-mango-begingswith-fixes-2 branch May 14, 2024 14:27
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.

3 participants