summaryrefslogtreecommitdiff
path: root/tools/mdbx_chk
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-25 11:57:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-25 11:57:29 +0300
commita4b13dbed9ff21c3b992ee21ba708730186296e4 (patch)
tree41d97e2c924929a9da7d740aa3353598ea9cc64d /tools/mdbx_chk
parentc0f6475d8f49a0d97428c674cc3ec938fe78213b (diff)
libmdbx: merge with 0.7 final version
Diffstat (limited to 'tools/mdbx_chk')
-rw-r--r--tools/mdbx_chk/src/mdbx_chk.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/mdbx_chk/src/mdbx_chk.cc b/tools/mdbx_chk/src/mdbx_chk.cc
index 5b41402f85..f2725bd37f 100644
--- a/tools/mdbx_chk/src/mdbx_chk.cc
+++ b/tools/mdbx_chk/src/mdbx_chk.cc
@@ -23,7 +23,7 @@
#endif /* _MSC_VER (warnings) */
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
-#include "../../libs/libmdbx/src/src/elements/internals.h"
+#include "../../libs/libmdbx/src/src/internals.h"
typedef struct flagbit {
int bit;
@@ -39,8 +39,8 @@ const flagbit dbflags[] = {{MDBX_DUPSORT, "dupsort"},
{0, NULL}};
#if defined(_WIN32) || defined(_WIN64)
-#include "../../libs/libmdbx/src/src/tools/wingetopt.h"
-#include "../../libs/libmdbx/src/src/tools/wingetopt.c"
+#include "../../libs/libmdbx/src/src/wingetopt.h"
+#include "../../libs/libmdbx/src/src/wingetopt.c"
static volatile BOOL user_break;
static BOOL WINAPI ConsoleBreakHandlerRoutine(DWORD dwCtrlType) {
@@ -562,6 +562,12 @@ static int process_db(MDBX_dbi dbi_handle, char *dbi_name, visitor *handler,
uint64_t record_count = 0, dups = 0;
uint64_t key_bytes = 0, data_bytes = 0;
+ if ((MDBX_TXN_FINISHED | MDBX_TXN_ERROR) & mdbx_txn_flags(txn)) {
+ print(" ! abort processing '%s' due to a previous error\n",
+ dbi_name ? dbi_name : "@MAIN");
+ return MDBX_BAD_TXN;
+ }
+
if (dbi_handle == ~0u) {
rc = mdbx_dbi_open(txn, dbi_name, 0, &dbi_handle);
if (rc) {