mdbx: return MDBX_RESULT_TRUE on empty transaction commit.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-05-05 23:18:01 +03:00
parent 548d0a50b8
commit 405de05ca9

View File

@ -10390,8 +10390,15 @@ int mdbx_txn_commit_ex(MDBX_txn *txn, MDBX_commit_latency *latency) {
(txn->mt_flags & (MDBX_TXN_DIRTY | MDBX_TXN_SPILLS)) == 0) { (txn->mt_flags & (MDBX_TXN_DIRTY | MDBX_TXN_SPILLS)) == 0) {
for (int i = txn->mt_numdbs; --i >= 0;) for (int i = txn->mt_numdbs; --i >= 0;)
mdbx_tassert(txn, (txn->mt_dbistate[i] & DBI_DIRTY) == 0); mdbx_tassert(txn, (txn->mt_dbistate[i] & DBI_DIRTY) == 0);
rc = MDBX_SUCCESS; #if defined(MDBX_NOSUCCESS_EMPTY_COMMIT) && MDBX_NOSUCCESS_EMPTY_COMMIT
rc = mdbx_txn_end(txn, end_mode);
if (unlikely(rc != MDBX_SUCCESS))
goto fail;
rc = MDBX_RESULT_TRUE;
goto provide_latency;
#else
goto done; goto done;
#endif /* MDBX_NOSUCCESS_EMPTY_COMMIT */
} }
mdbx_debug("committing txn %" PRIaTXN " %p on mdbenv %p, root page %" PRIaPGNO mdbx_debug("committing txn %" PRIaTXN " %p on mdbenv %p, root page %" PRIaPGNO