mdbx: return MDBX_ENODATA instead of MDBX_EINVAL for non-positioned/EOF cursor and MDBX_GET_CURRENT.

Change-Id: I2adf76f8f662e77e5a6aa077344fab6b430975c4
This commit is contained in:
Leonid Yuriev 2020-11-07 16:23:50 +03:00
parent c55f99073b
commit 5f09ec73c9

View File

@ -12384,7 +12384,7 @@ int mdbx_cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
switch (op) {
case MDBX_GET_CURRENT: {
if (unlikely(!(mc->mc_flags & C_INITIALIZED)))
return MDBX_EINVAL;
return MDBX_ENODATA;
MDBX_page *mp = mc->mc_pg[mc->mc_top];
const unsigned nkeys = page_numkeys(mp);
if (mc->mc_ki[mc->mc_top] >= nkeys) {