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(mango): improve handling of unsatisfiable ranges in selectors #4568

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 3, 2023

  1. mango: improve handling of unsatisfiable ranges in selectors

    Certain configurations of unsatisfiable field ranges could cause
    HTTP 500 because they are not handled, for example:
    
        {"$and": [{"field": {"$eq": N}}, {"field": {"$gt": N}}]}
    
    This makes `mango_idx_view:end_key/1` fail because there is no
    clause to cover `[{'$gt',35,'$eq',35}]`, the value that the
    selector becomes mapped to.
    
    Similar field ranges are somewhat already handled by being mapped
    to `empty` so this seems to be an oversight in the original
    implementation.  Consider the following case, which will not
    crash on the contrary:
    
        {"$and": [{"field": {"$gt": N}}, {"field": {"$eq": N}}]}
    
    Add the missing function clauses to fix this problem.
    
    Found by:	random query generation
    pgj committed May 3, 2023
    Configuration menu
    Copy the full SHA
    fff3463 View commit details
    Browse the repository at this point in the history