#453 db2index with -tattrname:type,type fails
Closed: wontfix None Opened 11 years ago by rmeggins.

Run db2index and specify the types of indexes to create e.g.
db2index or db2index.pl -tattr:eq,sub
will not create the eq and sub indexes

db2index_add_indexed_attr should convert the comma delimited list of index types into multiple values for the nsIndexType attribute


Doesn't db2index_add_indexed_attr() need to change in order to parse the comma delimited list into separate attribute values for nsIndexType and nsMatchingRule?

Rich, sorry I missed your original comment... You are right. If multiple index types were specified, only the first one was picked up. :(

Fix Description:
1) db2index and db2index.pl did not handle options with no space
between the option type and the value. This patch properly parses
them.
2) db2index_add_indexed_attr now converts the comma delimited list
of index types into multiple values for the nsIndexType attribute.

still need to handle the comma delimited nsMatchingRule values too

might be easier to just use strtok_r(iptr, " ,", &saveptr) in a loop for the nsIndexType values and another loop using strtok_r(mptr, " ,", &saveptr) in a loop for the nsMatchingRule

Thank you so much, Rich! Here's the take 3 ...

Fix Description:
1) db2index and db2index.pl did not handle options with no space
between the option type and the value. This patch properly parses
them.
2) db2index_add_indexed_attr now converts the comma delimited list
of index types into multiple values for the nsIndexType and
nsMatchingRule.

I think that if you use strtok with a delimiter string of ", " (note that is a comma followed by a space character) then strtok will handle the skipping of leading and trailing spaces for you.

./strtoktest " foo , bar , baz "
token [foo]
token [bar]
token [baz]

Thank you for your patience, Rich... Take 4 is attached...

Reviewed by Rich (Thank you so much!)

Pushed to master.

$ git merge trac453
Updating 7ba65b0..3c6756f
Fast-forward
ldap/admin/src/scripts/template-db2index.in | 2 +-
ldap/admin/src/scripts/template-db2index.pl.in | 89 +++++++++--------------
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 26 +++++--
3 files changed, 55 insertions(+), 62 deletions(-)

$ git push
Counting objects: 23, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 1.73 KiB, done.
Total 12 (delta 9), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
7ba65b0..3c6756f master -> master

move closed tickets to 1.3.0.a1

Metadata Update from @nkinder:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.0.a1

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/453

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