]> git.sur5r.net Git - openldap/commitdiff
ITS#2506 - fix prev patch, don't ignore undefined filters. treat as False,
authorHoward Chu <hyc@openldap.org>
Tue, 13 May 2003 01:16:26 +0000 (01:16 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 13 May 2003 01:16:26 +0000 (01:16 +0000)
test_filter will never match them anyway.

servers/slapd/back-bdb/filterindex.c
servers/slapd/back-bdb/search.c
servers/slapd/back-ldbm/filterindex.c

index 50be97d332d925988ddb9d010ab5ddd53a34c426..1664212466d67fe6f4dba3acf2748fb725ec6eff 100644 (file)
@@ -60,6 +60,11 @@ bdb_filter_candidates(
        switch ( f->f_choice ) {
        case SLAPD_FILTER_COMPUTED:
                switch( f->f_result ) {
+               case SLAPD_COMPARE_UNDEFINED:
+               /* This technically is not the same as FALSE, but it
+                * certainly will produce no matches.
+                */
+               /* FALLTHRU */
                case LDAP_COMPARE_FALSE:
                        BDB_IDL_ZERO( ids );
                        break;
@@ -67,7 +72,8 @@ bdb_filter_candidates(
                        struct bdb_info *bdb = (struct bdb_info *)op->o_bd->be_private;
                        BDB_IDL_ALL( bdb, ids );
                        } break;
-               case SLAPD_COMPARE_UNDEFINED:
+               case LDAP_SUCCESS:
+               /* this is a pre-computed scope, leave it alone */
                        break;
                }
                break;
@@ -232,11 +238,6 @@ list_candidates(
 #endif
 
        for ( f = flist; f != NULL; f = f->f_next ) {
-               /* Ignore undefined filters */
-               if ( f->f_choice == SLAPD_FILTER_COMPUTED &&
-                    f->f_result == SLAPD_COMPARE_UNDEFINED ) {
-                       continue;
-               }
                rc = bdb_filter_candidates( op, f, save, tmp,
                        save+BDB_IDL_UM_SIZE );
 
index 7dd31cbe6553bb996157141be84bdd4efe72ca90..3a0bd7cd09d4ac3f1fb36a0c06c17b837b324782 100644 (file)
@@ -1556,7 +1556,7 @@ static int search_candidates(
        f.f_and = &nf;
        /* Dummy; we compute scope separately now */
        nf.f_choice = SLAPD_FILTER_COMPUTED;
-       nf.f_result = SLAPD_COMPARE_UNDEFINED;
+       nf.f_result = LDAP_SUCCESS;
        nf.f_next = xf.f_or == op->oq_search.rs_filter
                ? op->oq_search.rs_filter : &xf ;
        /* Filter depth increased again, adding dummy clause */
index 378480a5157832841ad720eb38bc95ea13263c82..79a2ee45b6ffe3d2839ae13da898cb4512406b9a 100644 (file)
@@ -51,8 +51,7 @@ filter_candidates(
                switch( f->f_result ) {
                case SLAPD_COMPARE_UNDEFINED:
                /* This technically is not the same as FALSE, but it
-                * certainly will produce no matches. list_candidates
-                * will take care of ignoring this filter.
+                * certainly will produce no matches.
                 */
                /* FALLTHRU */
                case LDAP_COMPARE_FALSE:
@@ -709,10 +708,6 @@ list_candidates(
 
        idl = NULL;
        for ( f = flist; f != NULL; f = f->f_next ) {
-               if ( f->f_choice == SLAPD_FILTER_COMPUTED &&
-                    f->f_result == SLAPD_COMPARE_UNDEFINED ) {
-                       continue;
-               }
                if ( (tmp = filter_candidates( op, f )) == NULL &&
                    ftype == LDAP_FILTER_AND ) {
 #ifdef NEW_LOGGING