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

ForestDB queries wrong key range for descending=true and prefixMatch #908

Closed
snej opened this issue Sep 8, 2015 · 1 comment
Closed
Assignees
Milestone

Comments

@snej
Copy link
Contributor

snej commented Sep 8, 2015

Spun off from #889 — as exposed by a CBLQueryBuilder test case, there's a bug in the view query support for ForestDB. When descending=true and there's a prefixMatch > 0, the endKey gets modified when it should be the startKey. (Because prefix matches alter the max key.)

@snej snej self-assigned this Sep 8, 2015
@snej snej added this to the 1.2 milestone Sep 8, 2015
@snej
Copy link
Contributor Author

snej commented Sep 8, 2015

I checked the corresponding code for all-docs queries (-[CBL_ForestDBStorage getAllDocs:status:]), but it's already doing the correct thing.

There should probably be some common accessors on CBLQueryOptions for minKey and maxKey that take into account descending and prefixMatch. That would move the logic to a single place and make sure everyone does it right.

@snej snej closed this as completed in f38ef1e Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant