From 3ed99f8c20e291ceb16a96ea645e8f77620eface Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 28 Mar 2021 03:09:13 +0300 Subject: [PATCH] mdbx: minor refine/fix `cursor_check()` internals. Change-Id: I89ea9a5336b88e7d0201a7f59d66a8bc53849172 --- src/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index 252c318f..bf374fe8 100644 --- a/src/core.c +++ b/src/core.c @@ -16830,8 +16830,8 @@ static __cold int mdbx_cursor_check(MDBX_cursor *mc, unsigned options) { mc->mc_txn->tw.dirtyroom + mc->mc_txn->tw.dirtylist->length == mc->mc_txn->mt_env->me_options.dp_limit); - mdbx_cassert(mc, mc->mc_top == mc->mc_snum - 1); - if (unlikely(mc->mc_top != mc->mc_snum - 1)) + mdbx_cassert(mc, mc->mc_top == mc->mc_snum - 1 || (options & C_UPDATING)); + if (unlikely(mc->mc_top != mc->mc_snum - 1) && (options & C_UPDATING) == 0) return MDBX_CURSOR_FULL; mdbx_cassert(mc, (options & C_UPDATING) ? mc->mc_snum <= mc->mc_db->md_depth : mc->mc_snum == mc->mc_db->md_depth);