- ldap_pvt_thread_yield();
-
- /* Debug( LDAP_DEBUG_TRACE, "<= add_value %d\n", rc, 0, 0 ); */
- return( rc );
-}
-
-int
-index_add_values(
- Backend *be,
- char *type,
- struct berval **vals,
- ID id
-)
-{
- char *val, *p, *code, *w;
- unsigned i, j, len;
- int indexmask, syntax;
- char buf[SUBLEN + 1];
- char vbuf[BUFSIZ];
- char *bigbuf;
- struct dbcache *db;
-
- char *at_on; /* Attribute official name */
-
- Debug( LDAP_DEBUG_TRACE, "=> index_add_values( \"%s\", %ld )\n", type,
- id, 0 );
- attr_normalize(type);
- attr_masks( be->be_private, type, &indexmask, &syntax );
- if ( indexmask == 0 ) {
- return( 0 );
- }
- at_on = at_official_name( type );
- if ( (db = ldbm_cache_open( be, at_on, LDBM_SUFFIX, LDBM_WRCREAT ))
- == NULL ) {
- Debug( LDAP_DEBUG_ANY,
- "<= index_add_values -1 (could not open/create %s%s)\n",
- at_on, LDBM_SUFFIX, 0 );
- return( -1 );
+ if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) ) {
+ rc = ad->ad_type->sat_equality->smr_indexer(
+ LDAP_FILTER_EQUALITY,
+ mask,
+ ad->ad_type->sat_syntax,
+ ad->ad_type->sat_equality,
+ atname, vals, &keys, op->o_tmpmemctx );
+
+ if( rc == LDAP_SUCCESS && keys != NULL ) {
+ for( i=0; keys[i].bv_val != NULL; i++ ) {
+ key_change( op->o_bd, db, &keys[i], id, opid );
+ }
+ ber_bvarray_free_x( keys, op->o_tmpmemctx );
+ }