]> git.sur5r.net Git - openldap/commitdiff
Use DB_NODUPDATA when adding IDs. Silence log for DB_NOTFOUND in delete_key,
authorHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 11:37:43 +0000 (11:37 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 11:37:43 +0000 (11:37 +0000)
let caller log it if they care.

servers/slapd/back-bdb/idl.c

index 5843e54760659122789c68b3848358428ead7ae7..7a0704bab7583f06f39f79f596c4ecbe454668af 100644 (file)
@@ -572,7 +572,7 @@ bdb_idl_insert_key(
                }
        } else if ( rc == DB_NOTFOUND ) {
 put1:          data.data = &id;
-               rc = cursor->c_put( cursor, key, &data, DB_KEYFIRST );
+               rc = cursor->c_put( cursor, key, &data, DB_NODUPDATA );
                /* Don't worry if it's already there */
                if ( rc != 0 && rc != DB_KEYEXIST ) {
                        err = "c_put id";
@@ -827,6 +827,7 @@ bdb_idl_delete_key(
        } else {
                /* initial c_get failed, nothing was done */
 fail:
+               if ( rc != DB_NOTFOUND ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( INDEX, ERR, 
                        "bdb_idl_delete_key: %s failed: %s (%d)\n", 
@@ -835,6 +836,7 @@ fail:
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
                        "%s failed: %s (%d)\n", err, db_strerror(rc), rc );
 #endif
+               }
                cursor->c_close( cursor );
                return rc;
        }