From 5c693ccd96157464dc2d59c130607f6075d0f47a Mon Sep 17 00:00:00 2001 From: sasgas Date: Thu, 3 Dec 2020 11:22:34 +0900 Subject: [PATCH 1/3] mdbx++: fix missing null assignment. Resolves https://github.com/erthink/libmdbx/pull/143 Change-Id: Ifb88cebe2f07297a2f6cf70e31ae6abe61a0c0b2 --- AUTHORS | 1 + src/mdbx.c++ | 2 ++ 2 files changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index d050f2c0..ca419517 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,3 +30,4 @@ Contributors - Sebastien Launay - Vladimir Romanov - Zano Foundation +- 장세연 diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 3e859798..759d4ff8 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -1319,6 +1319,7 @@ void txn_managed::abort() { handle_ = nullptr; err.throw_exception(); } + handle_ = nullptr; } void txn_managed::commit() { @@ -1328,6 +1329,7 @@ void txn_managed::commit() { handle_ = nullptr; err.throw_exception(); } + handle_ = nullptr; } //------------------------------------------------------------------------------ From a98730120487e87b000da65b9ccbbabf089933ee Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 3 Dec 2020 09:32:25 +0300 Subject: [PATCH 2/3] mdbx++: refine abort/commit. More for https://github.com/erthink/libmdbx/pull/143 Change-Id: I07de4c43d039f904495f0f4caf586d8764174dcf --- .github/actions/spelling/expect.txt | 2 ++ src/mdbx.c++ | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 75cdff13..20846e42 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -137,6 +137,7 @@ calloc cas casename cassert +castis castortech cattr cbegin @@ -1390,6 +1391,7 @@ rw samedata samelength SAMSUNG +sasgas savailable scalability sched diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 759d4ff8..73a222f3 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -1314,22 +1314,18 @@ txn_managed::~txn_managed() noexcept { void txn_managed::abort() { const error err = static_cast(::mdbx_txn_abort(handle_)); - if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) { - if (err.code() != MDBX_THREAD_MISMATCH) - handle_ = nullptr; + if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH)) + handle_ = nullptr; + if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) err.throw_exception(); - } - handle_ = nullptr; } void txn_managed::commit() { const error err = static_cast(::mdbx_txn_commit(handle_)); - if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) { - if (err.code() != MDBX_THREAD_MISMATCH) - handle_ = nullptr; + if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH)) + handle_ = nullptr; + if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) err.throw_exception(); - } - handle_ = nullptr; } //------------------------------------------------------------------------------ From e6eeb1703052b080bdb8f04a860f1a6ca94f2986 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 3 Dec 2020 09:36:45 +0300 Subject: [PATCH 3/3] mdbx: update ChangeLog. Change-Id: I694056afe448883b16b8ec769d8a560040044ae5 --- ChangeLog.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 90cd7f04..7d5134eb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ ChangeLog ## v0.9.3 (in development) +TODO: - Engage new terminology (https://github.com/erthink/libmdbx/issues/137). - Rework/speedup the implementation of the dirty page list (lazy compactification, lazy sorting via merge). - Resolve few TODOs (https://github.com/erthink/libmdbx/issues/123, https://github.com/erthink/libmdbx/issues/124, @@ -11,6 +12,17 @@ ChangeLog - Finalize C++ API (few typos and trivia bugs are still likely for now). - Packages for ROSA Linux, ALT Linux, Fedora/RHEL, Debian/Ubuntu. +Acknowledgements: + - Mahlon E. Smith (http://www.martini.nu/) for FreeBSD port of libmdbx. + - 장세연 (http://www.castis.com) for bug fixing and PR. + +Added features: + - Package for FreeBSD is available now by Mahlon E. Smith. + +Fixes: + - Fixed missing cleanup (null assigned) in the C++ commit/abort (https://github.com/erthink/libmdbx/pull/143). + + ## v0.9.2 scheduled at 2020-11-27 Acknowledgements: