-
Notifications
You must be signed in to change notification settings - Fork 87
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
Cursor::iter_start() panics on empty database #27
Comments
I went ahead and tossed together a PR on the off chance the implementation approach above sounds good to you. |
ncloudioj
added a commit
to ncloudioj/lmdb-rs
that referenced
this issue
Mar 13, 2019
use newly published lmdb-rkv-sys crate with upgraded LMDB version 0.9.23
Hitting this issue also. Test case demonstrating problem:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like it should instead return an iterator that yields no results.
Unfortunately, it doesn't work to simply ignore the result of
get()
initer_start()
and return theIter
anyway: the subsequentmdb_cursor_get()
call inIter
yields error code 22.One way to do this would be to add a bool field to
Iter
to record whether or not it should try to look up more records, and set the field to true if the firstget()
doesn't find a key. Could also set the field when the first error is returned to spare further lookups, though that's likely not a bottleneck for anybody.Anyway, if this sounds good I'm happy to submit a PR for it.
The text was updated successfully, but these errors were encountered: