mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx: slightly more cases to return MDBX_ENODATA
.
This commit is contained in:
parent
9d55d06a20
commit
a2141ceaac
@ -13741,7 +13741,7 @@ static int mdbx_cursor_next(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
|
||||
mp = mc->mc_pg[mc->mc_top];
|
||||
if (mc->mc_flags & C_EOF) {
|
||||
if (mc->mc_ki[mc->mc_top] + 1u >= page_numkeys(mp))
|
||||
return MDBX_NOTFOUND;
|
||||
return MDBX_ENODATA;
|
||||
mc->mc_flags ^= C_EOF;
|
||||
}
|
||||
|
||||
@ -14324,7 +14324,7 @@ int mdbx_cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
|
||||
int (*mfunc)(MDBX_cursor * mc, MDBX_val * key, MDBX_val * data);
|
||||
switch (op) {
|
||||
case MDBX_GET_CURRENT: {
|
||||
if (unlikely(!(mc->mc_flags & C_INITIALIZED)))
|
||||
if (unlikely((mc->mc_flags & (C_INITIALIZED | C_EOF)) != C_INITIALIZED))
|
||||
return MDBX_ENODATA;
|
||||
MDBX_page *mp = mc->mc_pg[mc->mc_top];
|
||||
const unsigned nkeys = page_numkeys(mp);
|
||||
|
Loading…
Reference in New Issue
Block a user