]> git.sur5r.net Git - openldap/commitdiff
ITS#7793/7828
authorHoward Chu <hyc@symas.com>
Wed, 26 Mar 2014 15:59:43 +0000 (08:59 -0700)
committerHoward Chu <hyc@symas.com>
Wed, 26 Mar 2014 15:59:43 +0000 (08:59 -0700)
Fix md_entries count, test for insert on md_entries increment

libraries/liblmdb/mdb.c

index 487999abe0f4d44d415c8367cfa9463367879350..4e9162f2e2eafd00cab72f87161fe4d87eea5dc1 100644 (file)
@@ -6157,7 +6157,6 @@ current:
                        goto done;
                }
                mdb_node_del(mc, 0);
-               mc->mc_db->md_entries--;
        }
 
        rdata = data;
@@ -6250,7 +6249,7 @@ put_sub:
                /* sub-writes might have failed so check rc again.
                 * Don't increment count if we just replaced an existing item.
                 */
-               if (!rc && !(flags & MDB_CURRENT))
+               if (!rc && insert)
                        mc->mc_db->md_entries++;
                if (flags & MDB_MULTIPLE) {
                        if (!rc) {