]> git.sur5r.net Git - openldap/commitdiff
Don't use indices to support not [!] filters.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 5 Nov 2001 17:25:44 +0000 (17:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 5 Nov 2001 17:25:44 +0000 (17:25 +0000)
Use pres indices to support LE/GE [<=,>=] filters.

servers/slapd/back-bdb/filterindex.c
servers/slapd/back-bdb/idl.c

index df28e10753fb1c9554758ad28393ad9b40d776c8..3ea8a06cb1584d304b5667dfa5a222a0ffbd7301 100644 (file)
@@ -85,27 +85,24 @@ bdb_filter_candidates(
                Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
                rc = substring_candidates( be, range, f->f_sub, ids );
                break;
-#endif
 
        case LDAP_FILTER_GE:
+               /* no GE index, use pres */
                Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
-               rc = 0;
+               rc = presence_candidates( be, range, f->f_desc, ids );
                break;
 
        case LDAP_FILTER_LE:
+               /* no LE index, use pres */
                Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
-               rc = 0;
+               rc = presence_candidates( be, range, f->f_desc, ids );
                break;
+#endif
 
-       case LDAP_FILTER_NOT: {
-                       ID tmp[BDB_IDL_UM_SIZE];
-
-                       Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
-                       rc = bdb_filter_candidates( be, range, f->f_not, tmp );
-                       if( rc == 0 ) {
-                               rc = bdb_idl_notin( range, tmp, ids );
-                       }
-               } break;
+       case LDAP_FILTER_NOT:
+               /* no indexing to support NOT filters */
+               Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
+               break;
 
        case LDAP_FILTER_AND:
                Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
index 4f096e911eeda2a07957a62c9af00ee18acad674..59d311a3aab83ba129cf84273637cc34a1d9f6ef 100644 (file)
@@ -555,6 +555,7 @@ bdb_idl_union(
 }
 
 
+#if 0
 /*
  * bdb_idl_notin - return a intersection ~b (or a minus b)
  */
@@ -606,6 +607,7 @@ bdb_idl_notin(
 
        return 0;
 }
+#endif
 
 ID bdb_idl_first( ID *ids, ID *cursor )
 {