diff --git a/mdbx.h b/mdbx.h index 99afd799..c9c00506 100644 --- a/mdbx.h +++ b/mdbx.h @@ -1063,7 +1063,19 @@ enum MDBX_db_flags_t { MDBX_REVERSEDUP = UINT32_C(0x40), /** Create DB if not already existing */ - MDBX_CREATE = UINT32_C(0x40000) + MDBX_CREATE = UINT32_C(0x40000), + + /** Opens an existing sub-database created with unknown flags. + * + * The `MDBX_DB_ACCEDE` flag is intend to open a existing sub-database which + * was created with unknown flags (\ref MDBX_REVERSEKEY, \ref MDBX_DUPSORT, + * \ref MDBX_INTEGERKEY, \ref MDBX_DUPFIXED, \ref MDBX_INTEGERDUP and + * \ref MDBX_REVERSEDUP). + * + * In such cases, instead of returning the \ref MDBX_INCOMPATIBLE error, the + * sub-database will be opened with flags which it was created, and then an + * application could determine the actual flags by \ref mdbx_dbi_flags(). */ + MDBX_DB_ACCEDE = MDBX_ACCEDE }; #ifndef __cplusplus /** \ingroup c_dbi */ diff --git a/src/mdbx_chk.c b/src/mdbx_chk.c index c43d88f2..b0693a69 100644 --- a/src/mdbx_chk.c +++ b/src/mdbx_chk.c @@ -575,7 +575,7 @@ static int process_db(MDBX_dbi dbi_handle, char *dbi_name, visitor *handler, if (dbi_handle == ~0u) { rc = mdbx_dbi_open_ex( - txn, dbi_name, MDBX_ACCEDE, &dbi_handle, + txn, dbi_name, MDBX_DB_ACCEDE, &dbi_handle, (dbi_name && ignore_wrong_order) ? equal_or_greater : nullptr, (dbi_name && ignore_wrong_order) ? equal_or_greater : nullptr); if (rc) {