tool_reindex now regenerates the dn2id index as well as the others.

This commit is contained in:
Howard Chu 2001-12-05 01:36:18 +00:00
parent 999b3dad7b
commit 19c7fd49ca
2 changed files with 14 additions and 3 deletions

View File

@ -229,8 +229,18 @@ int bdb_tool_entry_reindex(
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 );
@ -250,6 +260,5 @@ int bdb_tool_entry_reindex(
}
}
done:
return rc;
}

View File

@ -271,8 +271,10 @@ int ldbm_tool_entry_reindex(
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 );