From: Howard Chu Date: Mon, 17 Jun 2013 20:26:11 +0000 (+0200) Subject: ITS#7623 Clear P_SUBP on conversion from fake page X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~36^2~15 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d94ea5b55e5bce58502b3c0065cf40983eee9a8;p=openldap ITS#7623 Clear P_SUBP on conversion from fake page --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index df2e888c61..3c8db7eefc 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5189,6 +5189,7 @@ more: MDB_page *mp; unsigned int offset; unsigned int i; + uint16_t fp_flags; fp = NODEDATA(leaf); if (flags == MDB_CURRENT) { @@ -5208,6 +5209,7 @@ reuse: offset = NODESIZE + sizeof(indx_t) + data->mv_size; } offset += offset & 1; + fp_flags = fp->mp_flags; if (NODESIZE + sizeof(indx_t) + NODEKSZ(leaf) + NODEDSZ(leaf) + offset >= mc->mc_txn->mt_env->me_nodemax) { /* yes, convert it */ @@ -5231,6 +5233,7 @@ reuse: offset = mc->mc_txn->mt_env->me_psize - NODEDSZ(leaf); flags |= F_DUPDATA|F_SUBDATA; dummy.md_root = mp->mp_pgno; + fp_flags &= ~P_SUBP; } else { /* no, just grow it */ rdata = &xdata; @@ -5240,7 +5243,7 @@ reuse: mp->mp_pgno = mc->mc_pg[mc->mc_top]->mp_pgno; flags |= F_DUPDATA; } - mp->mp_flags = fp->mp_flags | P_DIRTY; + mp->mp_flags = fp_flags | P_DIRTY; mp->mp_pad = fp->mp_pad; mp->mp_lower = fp->mp_lower; mp->mp_upper = fp->mp_upper + offset;