mdbx: добавление поддержки MDBX_OUSTED в mdbx_strerror() и C++ API.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-07-24 15:27:48 +03:00
parent cb743d44fc
commit 2e7d325cf1
4 changed files with 8 additions and 2 deletions

3
mdbx.h
View File

@ -1982,7 +1982,8 @@ typedef enum MDBX_error {
* corresponding DBI-handle could be (re)used */
MDBX_DANGLING_DBI = -30412,
/** Транзакция была асинхронно отменена/вытеснена */
/** The parked read transaction was outed for the sake of
* recycling old MVCC snapshots. */
MDBX_OUSTED = -30411,
/* The last of MDBX-added error codes */

View File

@ -582,6 +582,7 @@ MDBX_DECLARE_EXCEPTION(transaction_full);
MDBX_DECLARE_EXCEPTION(transaction_overlapping);
MDBX_DECLARE_EXCEPTION(duplicated_lck_file);
MDBX_DECLARE_EXCEPTION(dangling_map_id);
MDBX_DECLARE_EXCEPTION(transaction_ousted);
#undef MDBX_DECLARE_EXCEPTION
[[noreturn]] LIBMDBX_API void throw_too_small_target_buffer();

View File

@ -339,7 +339,7 @@ DEFINE_EXCEPTION(transaction_full)
DEFINE_EXCEPTION(transaction_overlapping)
DEFINE_EXCEPTION(duplicated_lck_file)
DEFINE_EXCEPTION(dangling_map_id)
DEFINE_EXCEPTION(transaction_ousted)
#undef DEFINE_EXCEPTION
__cold const char *error::what() const noexcept {
@ -428,6 +428,7 @@ __cold void error::throw_exception() const {
CASE_EXCEPTION(transaction_overlapping, MDBX_TXN_OVERLAPPING);
CASE_EXCEPTION(duplicated_lck_file, MDBX_DUPLICATED_CLK);
CASE_EXCEPTION(dangling_map_id, MDBX_DANGLING_DBI);
CASE_EXCEPTION(transaction_ousted, MDBX_OUSTED);
#undef CASE_EXCEPTION
default:
if (is_mdbx_error())

View File

@ -168,6 +168,9 @@ __cold const char *mdbx_liberr2str(int errnum) {
case MDBX_DANGLING_DBI:
return "MDBX_DANGLING_DBI: Some cursors and/or other resources should be"
" closed before subDb or corresponding DBI-handle could be (re)used";
case MDBX_OUSTED:
return "MDBX_OUSTED: The parked read transaction was outed for the sake"
" of recycling old MVCC snapshots";
default:
return nullptr;
}