mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:54:14 +08:00
mdbx: check txn inside mdbx_cursor_txn().
Change-Id: Ia3d24800890369e3b6cab23d8f69c27246a4f017
This commit is contained in:
parent
6b5533338f
commit
c4007cbc70
@ -8184,7 +8184,12 @@ void mdbx_cursor_close(MDBX_cursor *mc) {
|
||||
MDBX_txn *mdbx_cursor_txn(MDBX_cursor *mc) {
|
||||
if (unlikely(!mc || mc->mc_signature != MDBX_MC_SIGNATURE))
|
||||
return NULL;
|
||||
return mc->mc_txn;
|
||||
MDBX_txn *txn = mc->mc_txn;
|
||||
if (unlikely(!txn || txn->mt_signature != MDBX_MT_SIGNATURE))
|
||||
return NULL;
|
||||
if (unlikely(txn->mt_flags & MDBX_TXN_FINISHED))
|
||||
return NULL;
|
||||
return txn;
|
||||
}
|
||||
|
||||
MDBX_dbi mdbx_cursor_dbi(MDBX_cursor *mc) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user