From: Howard Chu Date: Mon, 9 Apr 2012 11:45:32 +0000 (-0700) Subject: ITS#7229 additional tweaks X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ae027b52141d2748d59dfedcb4feebeda5162476;p=openldap ITS#7229 additional tweaks Should probably compare nsize to pg_size/4 instead... --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 954690e149..724fdf1b2c 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -5711,7 +5711,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno } nkeys = NUMKEYS(mp); - split_indx = nkeys / 2 + 1; + split_indx = (nkeys + 1) / 2; if (IS_LEAF2(rp)) { char *split, *ins; @@ -5765,7 +5765,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno * When the size of the data items is much smaller than * one-half of a page, this check is irrelevant. */ - if (IS_LEAF(mp) && nkeys < 4) { + if (IS_LEAF(mp) && nkeys < 16) { unsigned int psize, nsize; /* Maximum free space in an empty page */ pmax = mc->mc_txn->mt_env->me_psize - PAGEHDRSZ;