mdbx: исправление затенения курсоров во вложенных транзакциях.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2025-03-15 22:12:42 +03:00
parent aeac971f0b
commit dcf35e5306
2 changed files with 12 additions and 7 deletions

View File

@@ -691,11 +691,9 @@ MDBX_txn *mdbx_cursor_txn(const MDBX_cursor *mc) {
if (unlikely(!mc || mc->signature != cur_signature_live))
return nullptr;
MDBX_txn *txn = mc->txn;
if (unlikely(!txn || txn->signature != txn_signature))
if (unlikely(!txn || txn->signature != txn_signature || (txn->flags & MDBX_TXN_FINISHED)))
return nullptr;
if (unlikely(txn->flags & MDBX_TXN_FINISHED))
return nullptr;
return txn;
return (txn->flags & MDBX_TXN_HAS_CHILD) ? txn->env->txn : txn;
}
MDBX_dbi mdbx_cursor_dbi(const MDBX_cursor *mc) {