ldap/servers/slapd/back-ldbm/index.c | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit b1b3ff7cb8b74bd588d196ffb51963c7789de4df Author: Mark Reynolds mreynolds@redhat.com Date: Wed Aug 28 16:55:18 2013 -0400
Ticket 47306 - execute index_add_mods only for indexed attributes
Description: Check if the attribute being updated is actually indexed, before doing all the pre-index processing of the attribute/value.
https://fedorahosted.org/389/ticket/47306
Reviewed by: Noriko(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index 4b2b13a..3957099 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -518,6 +518,7 @@ index_add_mods( char *basetype = NULL; char *tmp = NULL; Slapi_Attr *curr_attr = NULL; + struct attrinfo *ai = NULL; Slapi_ValueSet *all_vals = NULL; Slapi_ValueSet *mod_vals = NULL; Slapi_Value **evals = NULL; /* values that still exist after a @@ -537,6 +538,11 @@ index_add_mods( if(tmp != NULL) { basetype = tmp; /* basetype was malloc'd */ } + ainfo_get( be, basetype, &ai ); + if ( ai == NULL || ai->ai_indexmask == 0 || ai->ai_indexmask == INDEX_OFFLINE ) { + /* this attribute is not being indexed, skip it. */ + goto error; + }
/* Get a list of all remaining values for the base type * and any present subtypes.
389-commits@lists.fedoraproject.org