]> git.sur5r.net Git - openldap/commitdiff
Don't mask DB_KEYEXIST errors in bdb_idl_insert_key, let dn2id see them.
authorHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 10:41:46 +0000 (10:41 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 10:41:46 +0000 (10:41 +0000)
Ignore DB_KEYEXIST and DB_NOTFOUND errors in key_change.

servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/key.c

index df4ec8f5f06296a869af92815bf7325d4b0e55cc..f9b99a5f63cb86cd8a98e7041fd3465029422cec 100644 (file)
@@ -657,9 +657,7 @@ fail:
        /* store the key */
        rc = db->put( db, tid, key, &data, 0 );
 #endif
-       if( rc == DB_KEYEXIST ) rc = 0;
-
-       if( rc != 0 ) {
+       if( rc != 0 && rc != DB_KEYEXIST ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( INDEX, ERR, 
                        "bdb_idl_insert_key: put failed: %s (%d)\n", 
index 46371dc519125a00ceb0e0b604787f1bda7c1662..20f59088a3848c06e4470d3534ae95d39d84c7d3 100644 (file)
@@ -92,10 +92,11 @@ bdb_key_change(
        if (op == SLAP_INDEX_ADD_OP) {
                /* Add values */
                rc = bdb_idl_insert_key( be, db, txn, &key, id );
-
+               if ( rc == DB_KEYEXIST ) rc = 0;
        } else {
                /* Delete values */
                rc = bdb_idl_delete_key( be, db, txn, &key, id );
+               if ( rc == DB_NOTFOUND ) rc = 0;
        }
 
 #ifdef NEW_LOGGING