mdbx: avoid empty and unneeded large/overflow pages.

Change-Id: I388a60180b999889fc15a1f3f3243c007a15edc6
This commit is contained in:
Leonid Yuriev 2018-09-13 10:22:01 +03:00 committed by Leo Yuriev
parent e08409d209
commit bf22699fb3

View File

@ -8229,7 +8229,10 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
if (F_ISSET(leaf->mn_flags, F_BIGDATA)) {
MDBX_page *omp;
pgno_t pg;
int level, ovpages, dpages = OVPAGES(env, data->iov_len);
int level, ovpages,
dpages = (LEAFSIZE(key, data) > env->me_nodemax)
? OVPAGES(env, data->iov_len)
: 0;
memcpy(&pg, olddata.iov_base, sizeof(pg));
if (unlikely((rc2 = mdbx_page_get(mc, pg, &omp, &level)) != 0))