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

Cursor::iterFrom: Panics on empty databases #31

Open
reivilibre opened this issue May 29, 2018 · 0 comments
Open

Cursor::iterFrom: Panics on empty databases #31

reivilibre opened this issue May 29, 2018 · 0 comments

Comments

@reivilibre
Copy link

self.get(None, None, ffi::MDB_FIRST).unwrap();

The above line causes a panic in the event of an empty database.
Given that the MDB_SET_RANGE: 'Position at first key greater than or equal to specified key.' option is used, it seems like it might also cause a panic if you ask for a key which is greater than any key stored.

I think that causing a panic here isn't intuitive.
Options I see:

  • Return an empty iterator instead
  • (breaking) Make iter_from return a Result<Iter<'txn>, lmdb::error::Error> instead.

Would a PR with one of options be OK?

ncloudioj added a commit to ncloudioj/lmdb-rs that referenced this issue Mar 13, 2019
Revert "Fix Android cross-compile build: `cargo build --target armv7-linux-androideabi`"
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

No branches or pull requests

1 participant