#47306 execute index_add_mods only for indexed attributes
Closed: wontfix None Opened 11 years ago by lkrispen.

index_add_mods is called by ldbm_back_modify to update the indexes. It handles every mod, searching the attribute, checking the attribute before and after the modify to determine the valid updates which should be applied to the index - and then calls index add_or_delete_values, where a check is done if the attribute is indexed. This check should be done at the beginning of index_add_mods


Your fix looks good.

I'm just curious. The following "ai" also had better check "ai->ai_indexmask == 0" and "ai->ai_indexmask == INDEX_OFFLINE" as in your patch?
890 index_read_ext_allids(
931 ainfo_get( be, basetype, &ai );
932 if (ai == NULL) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
933 index_free_prefix( prefix );
934 slapi_ch_free_string( &basetmp );
935 return NULL;
936 }

Replying to [comment:4 nhosoi]:

Your fix looks good.

I'm just curious. The following "ai" also had better check "ai->ai_indexmask == 0" and "ai->ai_indexmask == INDEX_OFFLINE" as in your patch?
890 index_read_ext_allids(
931 ainfo_get( be, basetype, &ai );
932 if (ai == NULL) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
933 index_free_prefix( prefix );
934 slapi_ch_free_string( &basetmp );
935 return NULL;
936 }

It gets correctly checked slightly further down at:

970 if ( !is_indexed( indextype, ai->ai_indexmask, ai->ai_index_rules ) ) {

git merge ticket47306
Updating 5bbd365..b1b3ff7
Fast-forward
ldap/servers/slapd/back-ldbm/index.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

git push origin master
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 870 bytes, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
5bbd365..b1b3ff7 master -> master

commit b1b3ff7
Author: Mark Reynolds mreynolds@redhat.com
Date: Wed Aug 28 16:55:18 2013 -0400

Metadata Update from @mreynolds:
- Issue assigned to mreynolds
- Issue set to the milestone: 1.3.2 - 09/13 (September)

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/643

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata