AttributeType *at;
slap_mask_t mask = 0;
- /* we do not support indexing of binary attributes */
- if( slap_ad_is_binary( desc ) ) return 0;
-
- bdb_attr_mask( be->be_private, desc->ad_cname->bv_val, &mask );
+ bdb_attr_mask( be->be_private, desc->ad_cname.bv_val, &mask );
if( mask ) {
- *atname = desc->ad_cname->bv_val;
- *dbname = desc->ad_cname->bv_val;
+ *atname = desc->ad_cname.bv_val;
+ *dbname = desc->ad_cname.bv_val;
return mask;
}
bdb_attr_mask( be->be_private, desc->ad_type->sat_cname, &mask );
if( mask & SLAP_INDEX_AUTO_LANG ) {
- *atname = desc->ad_cname->bv_val;
+ *atname = desc->ad_cname.bv_val;
*dbname = desc->ad_type->sat_cname;
return mask;
}
}
done:
- ad_free( ad, 1 );
return rc;
}
Backend *be,
DB_TXN *txn,
AttributeType *type,
- const char *lang,
+ struct berval *lang,
struct berval **vals,
ID id,
int op,
if( rc ) return rc;
}
- if( lang ) {
+ if( lang->bv_len ) {
char *dbname = NULL;
size_t tlen = strlen( type->sat_cname );
- size_t llen = strlen( lang );
+ size_t llen = lang->bv_len;
char *lname = ch_malloc( tlen + llen + sizeof(";") );
- sprintf( lname, "%s;%s", type->sat_cname, lang );
+ sprintf( lname, "%s;%s", type->sat_cname, lang->bv_val );
bdb_attr_mask( be->be_private, lname, &tmpmask );
char *dbname = NULL;
slap_mask_t mask;
- if( slap_ad_is_binary( desc ) ) {
- /* binary attributes have no index capabilities */
- return LDAP_SUCCESS;
- }
-
rc = index_at_values( be, txn,
- desc->ad_type, desc->ad_lang,
+ desc->ad_type, &desc->ad_lang,
vals, id, op,
&dbname, &mask );