From: Howard Chu Date: Mon, 23 Jul 2012 00:41:58 +0000 (-0700) Subject: Append mode still needs to detect duplicates X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~57^2~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=05ec98d11927a5148bbea8ed5672fdf61609b6cd;p=openldap Append mode still needs to detect duplicates --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index ad9ff44802..21fa97792c 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -4247,8 +4247,11 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_val k2; rc = mdb_cursor_last(mc, &k2, &d2); if (rc == 0) { - rc = MDB_NOTFOUND; - mc->mc_ki[mc->mc_top]++; + rc = mc->mc_dbx->md_cmp(key, &k2); + if (rc) { + rc = MDB_NOTFOUND; + mc->mc_ki[mc->mc_top]++; + } } } else { rc = mdb_cursor_set(mc, key, &d2, MDB_SET, &exact);