From 4a3a557827f3ef27a6128994ee064a4bc261615c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 30 Aug 2002 11:37:43 +0000 Subject: [PATCH] Use DB_NODUPDATA when adding IDs. Silence log for DB_NOTFOUND in delete_key, let caller log it if they care. --- servers/slapd/back-bdb/idl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 5843e54760..7a0704bab7 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -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; } -- 2.39.5