mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
ITS#7176 fix slapindex -q -t
This commit is contained in:
parent
33f6bc4fe6
commit
164e738878
@ -764,22 +764,6 @@ int mdb_tool_entry_reindex(
|
||||
mi->mi_nattrs = i;
|
||||
}
|
||||
|
||||
if ( slapMode & SLAP_TRUNCATE_MODE ) {
|
||||
int i;
|
||||
for ( i=0; i < mi->mi_nattrs; i++ ) {
|
||||
rc = mdb_drop( txn, mi->mi_attrs[i]->ai_dbi, 0 );
|
||||
if ( rc ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
LDAP_XSTRING(mdb_tool_entry_reindex)
|
||||
": (Truncate) mdb_drop(%s) failed: %s (%d)\n",
|
||||
mi->mi_attrs[i]->ai_desc->ad_type->sat_cname.bv_val,
|
||||
mdb_strerror(rc), rc );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
slapMode ^= SLAP_TRUNCATE_MODE;
|
||||
}
|
||||
|
||||
e = mdb_tool_entry_get( be, id );
|
||||
|
||||
if( e == NULL ) {
|
||||
@ -801,6 +785,22 @@ int mdb_tool_entry_reindex(
|
||||
}
|
||||
}
|
||||
|
||||
if ( slapMode & SLAP_TRUNCATE_MODE ) {
|
||||
int i;
|
||||
for ( i=0; i < mi->mi_nattrs; i++ ) {
|
||||
rc = mdb_drop( txi, mi->mi_attrs[i]->ai_dbi, 0 );
|
||||
if ( rc ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
LDAP_XSTRING(mdb_tool_entry_reindex)
|
||||
": (Truncate) mdb_drop(%s) failed: %s (%d)\n",
|
||||
mi->mi_attrs[i]->ai_desc->ad_type->sat_cname.bv_val,
|
||||
mdb_strerror(rc), rc );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
slapMode ^= SLAP_TRUNCATE_MODE;
|
||||
}
|
||||
|
||||
/*
|
||||
* just (re)add them for now
|
||||
* Use truncate mode to empty/reset index databases
|
||||
|
Loading…
Reference in New Issue
Block a user