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 #4828

Merged
merged 1 commit into from
Nov 3, 2023
Merged

mango: fix $beginsWith range #4828

merged 1 commit into from
Nov 3, 2023

Commits on Nov 3, 2023

  1. mango: fix $beginsWith range

    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.
    willholley committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    586aaec View commit details
    Browse the repository at this point in the history