You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "pgj (via GitHub)" <gi...@apache.org> on 2023/05/03 20:34:33 UTC

[GitHub] [couchdb] pgj opened a new pull request, #4568: fix(`mango`): improve handling of unsatisfiable ranges in selectors

pgj opened a new pull request, #4568:
URL: https://github.com/apache/couchdb/pull/4568

   Certain configurations of unsatisfiable field ranges could cause HTTP 500 because they are not handled, for example:
   
   ```json
   {"$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:
   
   ```json
   {"$and": [{"field": {"$gt": N}}, {"field": {"$eq": N}}]}
   ```
   
   Add the missing function clauses to fix this problem.
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org