X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-ldbm%2Findex.c;h=6cdec8db7ef9116ce0c61f6ef935fe55f7fda4db;hb=a4d161cff64c74e03e5898eae104d5d52cc54a91;hp=62bfaef46ad477995b33d8de97098ada4302b3f9;hpb=864aea13f740f9129830f2e99b8b2d8e0c3d58d0;p=openldap diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 62bfaef46a..6cdec8db7e 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2003 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,9 +115,14 @@ int index_param( break; case LDAP_FILTER_APPROX: - if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) { - goto done; + if ( desc->ad_type->sat_approx ) { + if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) { + goto done; + } + break; } + + /* Use EQUALITY rule and index for approximate match */ /* fall thru */ case LDAP_FILTER_EQUALITY: @@ -168,14 +173,9 @@ static int indexer( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "index_read: Could not open db %s%s\n", dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= index_read NULL (could not open %s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return LDAP_OTHER; } @@ -307,15 +307,9 @@ index_entry( Entry *e ) { Attribute *ap = e->e_attrs; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "index_entry: %s (%s)%ld\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", - e->e_dn, e->e_id ); -#else Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_id, e->e_dn ); -#endif /* add each attribute to the indexes */ for ( ; ap != NULL; ap = ap->a_next ) { @@ -324,13 +318,9 @@ index_entry( e->e_id, opid ); } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_id, e->e_dn ); -#endif return LDAP_SUCCESS; }