/* index.c - routines for dealing with attribute indexes */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
return mask;
}
- /* If there is a language tag, did we ever index the base
+ /* If there is a tagging option, did we ever index the base
* type? If so, check for mask, otherwise it's not there.
*/
- if( slap_ad_is_lang( desc ) && desc != desc->ad_type->sat_ad ) {
- /* has language tag */
+ if( slap_ad_is_tagged( desc ) && desc != desc->ad_type->sat_ad ) {
+ /* has tagging option */
bdb_attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
- if ( mask && ( mask ^ SLAP_INDEX_NOLANG ) ) {
+ if ( mask && ( mask ^ SLAP_INDEX_NOTAGS ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = desc->ad_type->sat_cname.bv_val;
return mask;
switch( ftype ) {
case LDAP_FILTER_PRESENT:
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
+ *prefixp = presence_key;
goto done;
}
break;
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ERR,
- "bdb_index_read: Could not open DB %s\n", dbname));
+ LDAP_LOG( INDEX, ERR,
+ "bdb_index_read: Could not open DB %s\n", dbname, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_index_read NULL (could not open %s)\n",
Backend *be,
DB_TXN *txn,
AttributeType *type,
- struct berval *lang,
+ struct berval *tags,
BerVarray vals,
ID id,
int op )
if( type->sat_sup ) {
/* recurse */
rc = index_at_values( be, txn,
- type->sat_sup, lang,
+ type->sat_sup, tags,
vals, id, op );
if( rc ) return rc;
if( rc ) return rc;
}
- if( lang->bv_len ) {
+ if( tags->bv_len ) {
AttributeDescription *desc;
mask = 0;
- desc = ad_find_lang( type, lang );
+ desc = ad_find_tags( type, tags );
if( desc ) {
bdb_attr_mask( be->be_private, desc, &mask );
}
int rc;
rc = index_at_values( be, txn,
- desc->ad_type, &desc->ad_lang,
+ desc->ad_type, &desc->ad_tags,
vals, id, op );
return rc;
int rc;
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: %s (%s) %ld\n",
- op == SLAP_INDEX_ADD_OP ? "add" : "del",
- e->e_dn, (long) e->e_id ));
+ LDAP_LOG( INDEX, ENTRY, "index_entry: %s (%s) %ld\n",
+ op == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_dn, (long) e->e_id );
#else
Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
- rc = bdb_index_values( be, txn,
- ap->a_desc, ap->a_vals, e->e_id, op );
+#ifdef SLAP_NVALUES
+ rc = bdb_index_values( be, txn, ap->a_desc,
+ ap->a_nvals ? ap->a_nvals : ap->a_vals,
+ e->e_id, op );
+#else
+ rc = bdb_index_values( be, txn, ap->a_desc,
+ ap->a_vals, e->e_id, op );
+#endif
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: success\n" ));
+ LDAP_LOG( INDEX, ENTRY,
+ "index_entry: failure (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
- "<= index_entry_%s( %ld, \"%s\" ) success\n",
+ "<= index_entry_%s( %ld, \"%s\" ) failure\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",
(long) e->e_id, e->e_dn );
#endif
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
- "index_entry: success\n" ));
+ LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
op == SLAP_INDEX_ADD_OP ? "add" : "del",