From 5db855d728d30311947365eb4b6b3a37f2eea854 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 17 Jun 2021 21:43:38 +0300 Subject: [PATCH] mdbx: fix false-negative `mdbx_cursor_eof()` result. Fixes https://github.com/erthink/libmdbx/issues/207. --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 11443689..287c0680 100644 --- a/src/core.c +++ b/src/core.c @@ -20661,7 +20661,7 @@ int mdbx_cursor_eof(const MDBX_cursor *mc) { if (mc->mc_snum == 0) return MDBX_RESULT_TRUE; - if ((mc->mc_flags & C_EOF) && + if ((mc->mc_flags & C_EOF) || mc->mc_ki[mc->mc_top] >= page_numkeys(mc->mc_pg[mc->mc_top])) return MDBX_RESULT_TRUE;