]> git.sur5r.net Git - openldap/commitdiff
Deleted autosubtypes support.
authorHoward Chu <hyc@openldap.org>
Tue, 15 Jan 2002 01:50:09 +0000 (01:50 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 15 Jan 2002 01:50:09 +0000 (01:50 +0000)
servers/slapd/back-bdb/index.c
servers/slapd/back-ldbm/index.c

index 70cefa145a9d0e6ca44361417602d361fa67270d..a69e66f85e450638110605642b8c246714b75cf0 100644 (file)
@@ -57,12 +57,6 @@ static slap_mask_t index_mask(
 
                bdb_attr_mask( be->be_private, at->sat_ad, &mask );
 
-               if ( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
-                       *atname = desc->ad_type->sat_cname;
-                       *dbname = at->sat_cname.bv_val;
-                       return mask;
-               }
-
                if ( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) {
                        *atname = at->sat_cname;
                        *dbname = at->sat_cname.bv_val;
@@ -271,21 +265,16 @@ static int index_at_values(
        struct berval *lang,
        BerVarray vals,
        ID id,
-       int op,
-       char ** dbnamep,
-       slap_mask_t *maskp )
+       int op )
 {
        int rc;
        slap_mask_t mask = 0;
-       slap_mask_t tmpmask = 0;
-       int lindex = 0;
 
        if( type->sat_sup ) {
                /* recurse */
                rc = index_at_values( be, txn,
                        type->sat_sup, lang,
-                       vals, id, op,
-                       dbnamep, &tmpmask );
+                       vals, id, op );
 
                if( rc ) return rc;
        }
@@ -296,50 +285,30 @@ static int index_at_values(
        }
 
        if( mask ) {
-               *dbnamep = type->sat_cname.bv_val;
-       } else if ( tmpmask & SLAP_INDEX_AUTO_SUBTYPES ) {
-               mask = tmpmask;
-       }
-
-       if( mask ) {
-               rc = indexer( be, txn, *dbnamep,
+               rc = indexer( be, txn, type->sat_cname.bv_val,
                        &type->sat_cname,
                        vals, id, op,
                        mask );
 
                if( rc ) return rc;
-               if( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
-                       *maskp = mask;
-               }
        }
 
        if( lang->bv_len ) {
-               char *dbname = NULL;
-               struct berval lname;
                AttributeDescription *desc;
 
-               tmpmask = 0;
-               lname.bv_val = NULL;
+               mask = 0;
 
                desc = ad_find_lang( type, lang );
                if( desc ) {
-                       bdb_attr_mask( be->be_private, desc, &tmpmask );
+                       bdb_attr_mask( be->be_private, desc, &mask );
                }
 
-               if( tmpmask ) {
-                       dbname = desc->ad_cname.bv_val;
-                       lname = desc->ad_cname;
-                       mask = tmpmask;
-               }
-
-               if( dbname != NULL ) {
-                       rc = indexer( be, txn, dbname, &lname,
+               if( mask ) {
+                       rc = indexer( be, txn, desc->ad_cname.bv_val,
+                               &desc->ad_cname,
                                vals, id, op,
                                mask );
 
-                       if( !tmpmask ) {
-                               ch_free( lname.bv_val );
-                       }
                        if( rc ) {
                                return rc;
                        }
@@ -358,13 +327,10 @@ int bdb_index_values(
        int op )
 {
        int rc;
-       char *dbname = NULL;
-       slap_mask_t mask;
 
        rc = index_at_values( be, txn,
                desc->ad_type, &desc->ad_lang,
-               vals, id, op,
-               &dbname, &mask );
+               vals, id, op );
 
        return rc;
 }
index 3d715d71cf48462ee6456b6e62690af8ecfba11e..fc8e85059ed8f97fc064f676d34d7e156db6669d 100644 (file)
@@ -54,12 +54,6 @@ static slap_mask_t index_mask(
                
                attr_mask( be->be_private, at->sat_ad, &mask );
 
-               if( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
-                       *atname = desc->ad_type->sat_cname;
-                       *dbname = at->sat_cname.bv_val;
-                       return mask;
-               }
-
                if( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) {
                        *atname = at->sat_cname;
                        *dbname = at->sat_cname.bv_val;
@@ -241,19 +235,15 @@ static int index_at_values(
        struct berval *lang,
        BerVarray vals,
        ID id,
-       int op,
-       char ** dbnamep,
-       slap_mask_t *maskp )
+       int op )
 {
        slap_mask_t mask = 0;
-       slap_mask_t tmpmask = 0;
 
        if( type->sat_sup ) {
                /* recurse */
                (void) index_at_values( be,
                        type->sat_sup, lang,
-                       vals, id, op,
-                       dbnamep, &tmpmask );
+                       vals, id, op );
        }
 
        /* If this type has no AD, we've never used it before */
@@ -262,47 +252,26 @@ static int index_at_values(
        }
 
        if( mask ) {
-               *dbnamep = type->sat_cname.bv_val;
-       } else if ( tmpmask & SLAP_INDEX_AUTO_SUBTYPES ) {
-               mask = tmpmask;
-       }
-
-       if( mask ) {
-               indexer( be, *dbnamep,
+               indexer( be, type->sat_cname.bv_val,
                        &type->sat_cname,
                        vals, id, op,
                        mask );
-               if ( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
-                       *maskp = mask;
-               }
        }
 
        if( lang->bv_len ) {
-               char *dbname = NULL;
-               struct berval lname;
                AttributeDescription *desc;
 
-               tmpmask = 0;
-               lname.bv_val = NULL;
+               mask = 0;
 
                desc = ad_find_lang(type, lang);
                if( desc ) {
-                       attr_mask( be->be_private, desc, &tmpmask );
-               }
-
-               if( tmpmask ) {
-                       dbname = desc->ad_cname.bv_val;
-                       lname = desc->ad_cname;
-                       mask = tmpmask;
+                       attr_mask( be->be_private, desc, &mask );
                }
 
-               if( dbname != NULL ) {
-                       indexer( be, dbname, &lname,
+               if( mask ) {
+                       indexer( be, desc->ad_cname.bv_val, &desc->ad_cname,
                                vals, id, op,
                                mask );
-                       if( !tmpmask ) {
-                               ch_free( lname.bv_val );
-                       }
                }
        }
 
@@ -316,13 +285,9 @@ int index_values(
        ID id,
        int op )
 {
-       char *dbname = NULL;
-       slap_mask_t mask;
-
        (void) index_at_values( be,
                desc->ad_type, &desc->ad_lang,
-               vals, id, op,
-               &dbname, &mask );
+               vals, id, op );
 
        return LDAP_SUCCESS;
 }