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.
This commit is contained in:
Howard Chu 2002-08-30 10:41:46 +00:00
parent d11b134709
commit f32803e738
2 changed files with 3 additions and 4 deletions

View File

@ -657,9 +657,7 @@ fail:
/* store the key */ /* store the key */
rc = db->put( db, tid, key, &data, 0 ); rc = db->put( db, tid, key, &data, 0 );
#endif #endif
if( rc == DB_KEYEXIST ) rc = 0; if( rc != 0 && rc != DB_KEYEXIST ) {
if( rc != 0 ) {
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR, LDAP_LOG( INDEX, ERR,
"bdb_idl_insert_key: put failed: %s (%d)\n", "bdb_idl_insert_key: put failed: %s (%d)\n",

View File

@ -92,10 +92,11 @@ bdb_key_change(
if (op == SLAP_INDEX_ADD_OP) { if (op == SLAP_INDEX_ADD_OP) {
/* Add values */ /* Add values */
rc = bdb_idl_insert_key( be, db, txn, &key, id ); rc = bdb_idl_insert_key( be, db, txn, &key, id );
if ( rc == DB_KEYEXIST ) rc = 0;
} else { } else {
/* Delete values */ /* Delete values */
rc = bdb_idl_delete_key( be, db, txn, &key, id ); rc = bdb_idl_delete_key( be, db, txn, &key, id );
if ( rc == DB_NOTFOUND ) rc = 0;
} }
#ifdef NEW_LOGGING #ifdef NEW_LOGGING