*cr = a != NULL ? a->ai_cr : 0 ;
}
+void
+bdb_attr_mask_cr(
+ struct bdb_info *bdb,
+ AttributeDescription *desc,
+ slap_mask_t *indexmask,
+ ComponentReference** cr )
+{
+ AttrInfo *a;
+
+ a = (AttrInfo *) avl_find( bdb->bi_attrs, desc, ainfo_type_cmp );
+ if ( a ) {
+ *indexmask = a->ai_indexmask;
+ *cr = a->ai_cr;
+ } else {
+ *indexmask = NULL;
+ *cr = NULL;
+ }
+}
#endif
void
if( rc ) return rc;
}
-#ifdef LDAP_COMP_MATCH
- /* component indexing */
- bdb_attr_comp_ref ( op->o_bd->be_private, type->sat_ad, &cr_list );
- if ( cr_list ) {
- for( cr = cr_list ; cr ; cr = cr->cr_next ) {
- rc = indexer( op, txn, cr->cr_ad, &type->sat_cname,
- cr->cr_nvals, id, opid,
- cr->cr_indexmask );
- }
- }
-#endif
/* If this type has no AD, we've never used it before */
if( type->sat_ad ) {
+#ifdef LDAP_COMP_MATCH
+ /* component indexing */
+ bdb_attr_mask_cr( op->o_bd->be_private, type->sat_ad, &mask, &cr_list );
+ if ( cr_list ) {
+ for( cr = cr_list ; cr ; cr = cr->cr_next ) {
+ rc = indexer( op, txn, cr->cr_ad, &type->sat_cname,
+ cr->cr_nvals, id, opid,
+ cr->cr_indexmask );
+ }
+ }
+#else
bdb_attr_mask( op->o_bd->be_private, type->sat_ad, &mask );
+#endif
ad = type->sat_ad;
}
#ifdef LDAP_COMP_MATCH
#define bdb_attr_comp_ref BDB_SYMBOL(attr_comp_ref)
+#define bdb_attr_mask_cr BDB_SYMBOL(attr_mask_cr)
void bdb_attr_comp_ref( struct bdb_info *bdb,
AttributeDescription *desc,
ComponentReference **cr );
+void bdb_attr_mask_cr( struct bdb_info *bdb,
+ AttributeDescription *desc,
+ slap_mask_t *indexmask,
+ ComponentReference **cr );
#endif
void bdb_attr_mask( struct bdb_info *bdb,