mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:34:12 +08:00
mdbx-chk: fix - don't check some numbers if btree-walking was disabled.
Change-Id: I3e1abb7fa7720ecb3fc22e6b4a9b1b56494fb8a0
This commit is contained in:
parent
a5fb5887f9
commit
2acaaeb2ff
@ -93,7 +93,7 @@ size_t userdb_count, skipped_subdb;
|
|||||||
uint64_t total_unused_bytes, reclaimable_pages, gc_pages, alloc_pages,
|
uint64_t total_unused_bytes, reclaimable_pages, gc_pages, alloc_pages,
|
||||||
unused_pages, backed_pages;
|
unused_pages, backed_pages;
|
||||||
unsigned verbose;
|
unsigned verbose;
|
||||||
bool ignore_wrong_order, quiet;
|
bool ignore_wrong_order, quiet, dont_traversal;
|
||||||
const char *only_subdb;
|
const char *only_subdb;
|
||||||
|
|
||||||
struct problem {
|
struct problem {
|
||||||
@ -626,22 +626,23 @@ static int process_db(MDBX_dbi dbi_handle, char *dbi_name, visitor *handler,
|
|||||||
error("too many DBIs or out of memory\n");
|
error("too many DBIs or out of memory\n");
|
||||||
return MDBX_ENOMEM;
|
return MDBX_ENOMEM;
|
||||||
}
|
}
|
||||||
const uint64_t subtotal_pages =
|
if (!dont_traversal) {
|
||||||
ms.ms_branch_pages + ms.ms_leaf_pages + ms.ms_overflow_pages;
|
const uint64_t subtotal_pages =
|
||||||
if (subtotal_pages != dbi->pages.total)
|
ms.ms_branch_pages + ms.ms_leaf_pages + ms.ms_overflow_pages;
|
||||||
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n", "subtotal",
|
if (subtotal_pages != dbi->pages.total)
|
||||||
subtotal_pages, dbi->pages.total);
|
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n",
|
||||||
if (ms.ms_branch_pages != dbi->pages.branch)
|
"subtotal", subtotal_pages, dbi->pages.total);
|
||||||
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n", "branch",
|
if (ms.ms_branch_pages != dbi->pages.branch)
|
||||||
ms.ms_branch_pages, dbi->pages.branch);
|
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n", "branch",
|
||||||
const uint64_t allleaf_pages = dbi->pages.leaf + dbi->pages.leaf_dupfixed;
|
ms.ms_branch_pages, dbi->pages.branch);
|
||||||
if (ms.ms_leaf_pages != allleaf_pages)
|
const uint64_t allleaf_pages = dbi->pages.leaf + dbi->pages.leaf_dupfixed;
|
||||||
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n", "all-leaf",
|
if (ms.ms_leaf_pages != allleaf_pages)
|
||||||
ms.ms_leaf_pages, allleaf_pages);
|
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n",
|
||||||
if (ms.ms_overflow_pages != dbi->pages.large_volume)
|
"all-leaf", ms.ms_leaf_pages, allleaf_pages);
|
||||||
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n",
|
if (ms.ms_overflow_pages != dbi->pages.large_volume)
|
||||||
"large/overlow", ms.ms_overflow_pages, dbi->pages.large_volume);
|
error("%s pages mismatch (%" PRIu64 " != walked %" PRIu64 ")\n",
|
||||||
|
"large/overlow", ms.ms_overflow_pages, dbi->pages.large_volume);
|
||||||
|
}
|
||||||
rc = mdbx_cursor_open(txn, dbi_handle, &mc);
|
rc = mdbx_cursor_open(txn, dbi_handle, &mc);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
error("mdbx_cursor_open failed, error %d %s\n", rc, mdbx_strerror(rc));
|
error("mdbx_cursor_open failed, error %d %s\n", rc, mdbx_strerror(rc));
|
||||||
@ -913,7 +914,6 @@ int main(int argc, char *argv[]) {
|
|||||||
char *prog = argv[0];
|
char *prog = argv[0];
|
||||||
char *envname;
|
char *envname;
|
||||||
int problems_maindb = 0, problems_freedb = 0, problems_meta = 0;
|
int problems_maindb = 0, problems_freedb = 0, problems_meta = 0;
|
||||||
bool dont_traversal = false;
|
|
||||||
bool locked = false;
|
bool locked = false;
|
||||||
|
|
||||||
double elapsed;
|
double elapsed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user