From f32803e738f1f3a6b638bba51314dbfa2539a8fe Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 30 Aug 2002 10:41:46 +0000 Subject: [PATCH] Don't mask DB_KEYEXIST errors in bdb_idl_insert_key, let dn2id see them. Ignore DB_KEYEXIST and DB_NOTFOUND errors in key_change. --- servers/slapd/back-bdb/idl.c | 4 +--- servers/slapd/back-bdb/key.c | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index df4ec8f5f0..f9b99a5f63 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -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", diff --git a/servers/slapd/back-bdb/key.c b/servers/slapd/back-bdb/key.c index 46371dc519..20f59088a3 100644 --- a/servers/slapd/back-bdb/key.c +++ b/servers/slapd/back-bdb/key.c @@ -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