]> git.sur5r.net Git - openldap/commitdiff
Fix entry counts in cursor_put
authorHoward Chu <hyc@symas.com>
Wed, 28 Mar 2012 17:34:35 +0000 (10:34 -0700)
committerHoward Chu <hyc@symas.com>
Wed, 28 Mar 2012 17:34:35 +0000 (10:34 -0700)
when replacing an existing item

libraries/libmdb/mdb.c

index 6eff56cdbfc7aacfd7072cdb7991126d249b2f82..3e0c0e21b35fe51260ea21b5b6d2610550971555 100644 (file)
@@ -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]);
        }