]> git.sur5r.net Git - openldap/commitdiff
clarify hasSubordinate filtering
authorPierangelo Masarati <ando@openldap.org>
Wed, 16 Apr 2003 20:54:56 +0000 (20:54 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 16 Apr 2003 20:54:56 +0000 (20:54 +0000)
servers/slapd/back-sql/search.c

index f1cc0ada09a14f7a0729b4962b110d9a295c7603..feee0efcd874cad05de716d6af603d34a10ef78e 100644 (file)
@@ -400,15 +400,19 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                 * Note however that hasSubordinates is boolean, 
                 * so a more appropriate filter would be 
                 * '(hasSubordinates=FALSE)'
+                *
+                * A more robust search for hasSubordinates
+                * would * require joining the ldap_entries table
+                * selecting if there are descendants of the
+                * candidate.
                 */
                backsql_strfcat( &bsi->flt_where, "l",
                                (ber_len_t)sizeof( "1=1" ) - 1, "1=1" );
                if ( ad == slap_schema.si_ad_hasSubordinates ) {
                        /*
-                        * We use this flag since we need to parse
-                        * the filter anyway; we should have used
-                        * the frontend API function
-                        * filter_has_subordinates()
+                        * instruct candidate selection algorithm
+                        * and attribute list to try to detect
+                        * if an entry has subordinates
                         */
                        bsi->bsi_flags |= BSQL_SF_FILTER_HASSUBORDINATE;
 
@@ -448,20 +452,6 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                                &at->join_where );
        }
 
-#if 0
-       /*
-        * FIXME: this is not required any more; however, note that
-        * attribute name syntax might collide with SQL legal aliases
-        */
-       if ( at != &oc_attr ) {
-               backsql_strfcat( &bsi->sel, "cblb",
-                               ',',
-                               &at->sel_expr,
-                               (ber_len_t)sizeof( " AS " ) - 1, " AS ", 
-                               &at->name );
-       }
-#endif
-
        switch ( f->f_choice ) {
        case LDAP_FILTER_EQUALITY:
                filter_value = &f->f_av_value;