willholley opened a new pull request #866: Fix incorrect index selection when 
sort specified
URL: https://github.com/apache/couchdb/pull/866
 
 
   ## Overview
   
   Mango has an apparently long-standing bug whereby if an index is deemed 
valid for sorting a query but is not valid according to mango_idx:is_usable, 
the query planner would fall back to _all_docs silently, therefore ignoring the 
sort order specified in the query.
   
   This reverses the index selection logic so that the list of usable indexes 
is generated prior to filtering them based on the sort order specified in the 
query.
   
   Similar logic is applied to use_index, allowing us to generate a more 
specific error message when a user specifies an index which isn't valid for the 
current
   selector.
   
   This fix exposes that the change introduced in 
https://github.com/apache/couchdb/pull/816 may cause existing queries with sort 
fields to fail (indeed, several queries in our test suite needed fixing), so we 
need to consider whether this is a severe enough breaking change to warrant a 
major version bump.
   
   ## Testing recommendations
   
   Run the test suite. Test that you can run Mango queries with sort criteria.
   
   ## Related Pull Requests
   
   https://github.com/apache/couchdb/pull/816
   
   ## Checklist
   
   - [ ] Code is written and works correctly;
   - [ ] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to