diff --git a/src/core.c b/src/core.c index 69b64c0f..755d7777 100644 --- a/src/core.c +++ b/src/core.c @@ -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);