Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

MDBX_GET_BOTH not returning MDBX_NOTFOUND for missing value #243

Closed
kriszyp opened this issue Nov 25, 2021 · 4 comments
Closed

MDBX_GET_BOTH not returning MDBX_NOTFOUND for missing value #243

kriszyp opened this issue Nov 25, 2021 · 4 comments
Assignees
Labels

Comments

@kriszyp
Copy link

kriszyp commented Nov 25, 2021

Using mdbx_cursor_get with MDBX_GET_BOTH on a MDBX_DUPSORT database, where the provided key exists and has values, but the provided value does not exist for the key, will return 0.
Expected behavior: MDBX_GET_BOTH should position the cursor at exactly the key and value provided, and if the exact key/value dooes not exist, it should return MDBX_NOTFOUND (this is the behavior in LMDB with MDB_GET_BOTH, which does return MDB_NOTFOUND if the key/value does not exist).

@erthink
Copy link
Owner

erthink commented Nov 25, 2021

I will check this.
As a temporary solution, I suggest you try MDBX_SET_LOWERBOUND, maybe it will be more convenient.

@kriszyp
Copy link
Author

kriszyp commented Nov 25, 2021

That works great, thank you!

@erthink
Copy link
Owner

erthink commented Nov 25, 2021

@kriszyp, thank you for reporting.

@kriszyp
Copy link
Author

kriszyp commented Nov 25, 2021

No problem, thanks for the quick response. The JS library, lmdbx-js (formerly called lmdbx-store) is really stabilizing and working well with libmdbx, I think, and I am hoping to add support for Deno soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants