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

add custom ordering support to range types #289

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

Boog900
Copy link
Contributor

@Boog900 Boog900 commented Nov 27, 2024

What does this PR do?

This PR adds custom ordering support to the iterator/range types, by using the Comparator trait. Without this PR using any of the range functions on Database when a custom ordering is set will give unexpected results, like not giving all the keys in the range.

This PR also adds a IntegerComparator type, which represents the ordering when the MDB_INTEGERKEY flag is set. This is needed to allow the range functions to work when a table sets that flag.

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for those changes!
I love seeing this kind of PR fixing hidden bugs like that.

As this is breaking, I'll probably release this PR as part of a new version later when #278 lands.

@Kerollmops Kerollmops added the breaking A change that is breaking the semver label Nov 28, 2024
@Kerollmops Kerollmops enabled auto-merge November 28, 2024 12:09
@Kerollmops Kerollmops merged commit 8b01852 into meilisearch:main Nov 28, 2024
8 checks passed
@Boog900 Boog900 deleted the range-custom-sort branch November 28, 2024 14:52
Kerollmops added a commit that referenced this pull request Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A change that is breaking the semver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants