diff --git a/src/core.c b/src/core.c index 8fe79d12..f9c1063e 100644 --- a/src/core.c +++ b/src/core.c @@ -11427,9 +11427,10 @@ __hot static int mdbx_page_get(MDBX_cursor *mc, pgno_t pgno, MDBX_page **ret, MDBX_page *p = nullptr; mdbx_assert(env, ((txn->mt_flags ^ env->me_flags) & MDBX_WRITEMAP) == 0); mdbx_assert(env, pp_txnid >= MIN_TXNID && pp_txnid <= txn->mt_txnid); - const uint16_t illegal_bits = (txn->mt_flags & MDBX_TXN_RDONLY) - ? P_LOOSE | P_SUBP | P_META | P_DIRTY - : P_LOOSE | P_SUBP | P_META; + const uint16_t illegal_bits = + (txn->mt_flags & MDBX_TXN_RDONLY) + ? ~(P_BRANCH | P_LEAF | P_LEAF2 | P_OVERFLOW) + : ~(P_BRANCH | P_LEAF | P_LEAF2 | P_OVERFLOW | P_DIRTY); int level; if (unlikely((txn->mt_flags & (MDBX_TXN_RDONLY | MDBX_WRITEMAP)) == 0)) { level = 1; @@ -11438,7 +11439,7 @@ __hot static int mdbx_page_get(MDBX_cursor *mc, pgno_t pgno, MDBX_page **ret, * because the dirty list got full. Bring this page * back in from the map (but don't unspill it here, * leave that unless page_touch happens again). */ - if (txn->tw.spill_pages && + if (unlikely(txn->mt_flags & MDBX_TXN_SPILLS) && txn->tw.spill_pages && mdbx_pnl_exist(txn->tw.spill_pages, pgno << 1)) { pp_txnid = txn->mt_txnid; goto spilled;