From: Howard Chu Date: Wed, 5 Dec 2001 01:36:18 +0000 (+0000) Subject: tool_reindex now regenerates the dn2id index as well as the others. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~780 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=19c7fd49cab77afbf216bcc02f2210cf6ad5e3dd;p=openldap tool_reindex now regenerates the dn2id index as well as the others. --- diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 2738bf10ee..8514c15ec8 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -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; } diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index 226db043a6..52f0e205c5 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -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 );