mdbx: fix mdbx_setup_dxb() for a case when db-size not (pre)configured by user.

Fix https://github.com/leo-yuriev/libmdbx/issues/11

Change-Id: I6fccd4877fed563cfb3a03f887bbba73eff5ac84
This commit is contained in:
Leo Yuriev 2017-08-16 08:44:07 +03:00
parent be5bbea281
commit 9b5e28e8e6

View File

@ -4757,6 +4757,13 @@ static int __cold mdbx_setup_dxb(MDBX_env *env, int lck_rc) {
meta.mm_txnid_a, mdbx_durable_str(&meta));
}
mdbx_ensure(env, meta.mm_geo.now >= meta.mm_geo.next);
} else {
/* geo-params not pre-configured by used, fetch present from meta. */
env->me_dbgeo.now = pgno2bytes(env, meta.mm_geo.now);
env->me_dbgeo.lower = pgno2bytes(env, meta.mm_geo.lower);
env->me_dbgeo.upper = pgno2bytes(env, meta.mm_geo.upper);
env->me_dbgeo.grow = pgno2bytes(env, meta.mm_geo.grow);
env->me_dbgeo.shrink = pgno2bytes(env, meta.mm_geo.shrink);
}
uint64_t filesize_before_mmap;