From: Howard Chu Date: Wed, 28 Mar 2012 17:34:35 +0000 (-0700) Subject: Fix entry counts in cursor_put X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~24 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ac0b18911b73e7ca5da3f239e6f388ed60ed6b6c;p=openldap Fix entry counts in cursor_put when replacing an existing item --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 6eff56cdbf..3e0c0e21b3 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -4232,6 +4232,7 @@ more: (dkey.mv_size & 1) + (data->mv_size & 1); } mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], 0); + mc->mc_db->md_entries--; do_sub = 1; rdata = &xdata; xdata.mv_size = fp->mp_upper; @@ -4306,6 +4307,7 @@ more: mp->mp_ptrs[i] = fp->mp_ptrs[i] + offset; } mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], 0); + mc->mc_db->md_entries--; do_sub = 1; goto new_sub; } @@ -4324,6 +4326,7 @@ current: goto done; } mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], 0); + mc->mc_db->md_entries--; } else { DPRINTF("inserting key at index %i", mc->mc_ki[mc->mc_top]); }