From 6866fa3eaaaa8d5159f373ab525c261b8ced5f61 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 30 Dec 2021 22:12:04 +0300 Subject: [PATCH] mdbx: revert returning `MDBX_ENODATA` from cursor-next. --- src/core.c | 2 +- test/test.cc | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/core.c b/src/core.c index 8d534f16..ce5da831 100644 --- a/src/core.c +++ b/src/core.c @@ -13805,7 +13805,7 @@ static int mdbx_cursor_next(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, mp = mc->mc_pg[mc->mc_top]; if (unlikely(mc->mc_flags & C_EOF)) { if (mc->mc_ki[mc->mc_top] + 1u >= page_numkeys(mp)) - return (mc->mc_flags & C_SUB) ? MDBX_NOTFOUND : MDBX_ENODATA; + return MDBX_NOTFOUND; mc->mc_flags ^= C_EOF; } diff --git a/test/test.cc b/test/test.cc index dc2e42cc..fc5890ae 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1181,13 +1181,6 @@ bool testcase::speculum_verify() { log_error("false-negative cursor-eof: %u, rc %i", n, eof); rc = false; } - err = mdbx_cursor_get(cursor, &akey, &avalue, MDBX_GET_CURRENT); - if (err == MDBX_SUCCESS) - err = mdbx_cursor_get(cursor, &akey, &avalue, MDBX_NEXT); - if (err != MDBX_ENODATA) { - log_error("unexpected %d for MDBX_GET_CURRENT at EOF", err); - rc = false; - } } mdbx_cursor_close(cursor); return rc;