mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +08:00
mdbx-test: чтение актуальных флагов режима работы БД.
This commit is contained in:
parent
23d236f70e
commit
db83bd34d2
@ -158,12 +158,17 @@ void testcase::db_open() {
|
|||||||
if (config.params.random_writemap && flipcoin())
|
if (config.params.random_writemap && flipcoin())
|
||||||
mode ^= MDBX_WRITEMAP;
|
mode ^= MDBX_WRITEMAP;
|
||||||
|
|
||||||
actual_env_mode = mode;
|
|
||||||
int rc = mdbx_env_open(db_guard.get(), config.params.pathname_db.c_str(),
|
int rc = mdbx_env_open(db_guard.get(), config.params.pathname_db.c_str(),
|
||||||
mode, 0640);
|
mode, 0640);
|
||||||
if (unlikely(rc != MDBX_SUCCESS))
|
if (unlikely(rc != MDBX_SUCCESS))
|
||||||
failure_perror("mdbx_env_open()", rc);
|
failure_perror("mdbx_env_open()", rc);
|
||||||
|
|
||||||
|
unsigned env_flags_proxy;
|
||||||
|
rc = mdbx_env_get_flags(db_guard.get(), &env_flags_proxy);
|
||||||
|
if (unlikely(rc != MDBX_SUCCESS))
|
||||||
|
failure_perror("mdbx_env_get_flags()", rc);
|
||||||
|
actual_env_mode = MDBX_env_flags_t(env_flags_proxy);
|
||||||
|
|
||||||
rc = mdbx_env_set_syncperiod(db_guard.get(), unsigned(0.042 * 65536));
|
rc = mdbx_env_set_syncperiod(db_guard.get(), unsigned(0.042 * 65536));
|
||||||
if (unlikely(rc != MDBX_SUCCESS) && rc != MDBX_BUSY)
|
if (unlikely(rc != MDBX_SUCCESS) && rc != MDBX_BUSY)
|
||||||
failure_perror("mdbx_env_set_syncperiod()", rc);
|
failure_perror("mdbx_env_set_syncperiod()", rc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user