]> git.sur5r.net Git - openldap/commitdiff
Use allids instead of candidiate negation for !. (ITS#1405)
authorKurt Zeilenga <kurt@openldap.org>
Wed, 24 Oct 2001 21:26:32 +0000 (21:26 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 24 Oct 2001 21:26:32 +0000 (21:26 +0000)
Use presence indices in support of >= and <=.
(Note presence indices could be used to support = and substr in
like fashion where eq and substr indices are not maintained, but
I'll save that for another day.)

servers/slapd/back-ldbm/filterindex.c

index 8732599d74840b7ff0e3b693ef11492ac56a4144..0c39ff454a6fd911942c2b7558ea5d16832f2b1d 100644 (file)
@@ -135,7 +135,7 @@ filter_candidates(
                Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
 #endif
 
-               result = idl_allids( be );
+               result = presence_candidates( be, f->f_desc );
                break;
 
        case LDAP_FILTER_LE:
@@ -146,7 +146,7 @@ filter_candidates(
                Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
 #endif
 
-               result = idl_allids( be );
+               result = presence_candidates( be, f->f_desc );
                break;
 
        case LDAP_FILTER_AND:
@@ -179,11 +179,13 @@ filter_candidates(
                Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
 #endif
 
-               tmp1 = idl_allids( be );
-               tmp2 = filter_candidates( be, f->f_not );
-               result = idl_notin( be, tmp1, tmp2 );
-               idl_free( tmp2 );
-               idl_free( tmp1 );
+               /*
+                * As candidates lists may contain entries which do
+                * not match the assertion, negation of the inner candidate
+                * list could result in matching entries be excluded from
+                * the returned candidate list.
+                */
+               result = idl_allids( be );
                break;
        }