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 database returning IncompleteStorage for next_key when node doesn't exist #1505

Merged
merged 4 commits into from
Dec 22, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Dec 22, 2023

cc #1483 #131

When searching for the next key within a certain prefix, the database code will currently do a next key search, then check if the output matches the requested prefix.
If the next key search doesn't succeed because some keys are missing, it returns IncompleteStorage, even if we know that there is no result within the given prefix.
This PR fixes that.

The PR is bigger than the strict minimum for the fix because I started simplifying a bit the code in prevision for checking the prefix during the iteration, then half-way through I realized that there was a much simpler solution.

@tomaka tomaka added this pull request to the merge queue Dec 22, 2023
Merged via the queue into smol-dot:main with commit a1418fd Dec 22, 2023
@tomaka tomaka deleted the add-failing-test branch December 22, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant