mdbx: minor refine/fix cursor_check() internals.

Change-Id: I89ea9a5336b88e7d0201a7f59d66a8bc53849172
This commit is contained in:
Leonid Yuriev 2021-03-28 03:09:13 +03:00
parent 636c212235
commit 3ed99f8c20

View File

@ -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);