Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n",
(long) id, e->e_dn, 0 );
+ /* add dn2id indices */
+ rc = bdb_dn2id_add( be, tid, e->e_ndn, e->e_id );
+ if( rc != 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n",
+ db_strerror(rc), rc, 0 );
+ goto done;
+ }
+
rc = bdb_index_entry_add( be, tid, e, e->e_attrs );
+done:
if( bi->bi_txn ) {
if( rc == 0 ) {
rc = txn_commit( tid, 0 );
}
}
-done:
return rc;
}
id, e->e_dn, 0 );
#endif
-
- rc = index_entry_add( be, e, e->e_attrs );
+ rc = dn2id_add( be, e->e_ndn, e->e_id );
+ if( rc == 0 ) {
+ rc = index_entry_add( be, e, e->e_attrs );
+ }
entry_free( e );