]> git.sur5r.net Git - openldap/commitdiff
Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e
authorHoward Chu <hyc@symas.com>
Thu, 4 Apr 2013 14:25:21 +0000 (07:25 -0700)
committerHoward Chu <hyc@symas.com>
Thu, 4 Apr 2013 14:25:21 +0000 (07:25 -0700)
In APPEND don't immediately reject matching key, since this
is valid for APPENDDUP.

libraries/liblmdb/mdb.c

index 513706d83e144887fc6ca739914cbcf0886d1a82..4b79e154efb426c06b805d75b385ca6ab1972331 100644 (file)
@@ -4938,8 +4938,8 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
                                if (rc > 0) {
                                        rc = MDB_NOTFOUND;
                                        mc->mc_ki[mc->mc_top]++;
-                               } else {
-                                       /* new key is <= last key */
+                               } else if (rc < 0) {
+                                       /* new key is < last key */
                                        rc = MDB_KEYEXIST;
                                }
                        }