diff --git a/src/core.c b/src/core.c index ecd34972..0efcb928 100644 --- a/src/core.c +++ b/src/core.c @@ -8371,7 +8371,12 @@ static int __cold mdbx_read_header(MDBX_env *env, MDBX_meta *dest, (!META_IS_STEADY(dest) && !meta_weak_acceptable(env, dest, lck_exclusive))) { mdbx_error("%s", "no usable meta-pages, database is corrupted"); - return rc ? rc : MDBX_CORRUPTED; + if (rc == MDBX_SUCCESS) { + /* TODO: try to restore the database by fully checking b-tree structure + * for the each meta page, if the corresponding option was given */ + return MDBX_CORRUPTED; + } + return rc; } return MDBX_SUCCESS;