You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2013/11/28 00:26:36 UTC

[jira] [Commented] (DIRSERVER-1921) Indexes dont work on distinguishedNameMatch attributeType

    [ https://issues.apache.org/jira/browse/DIRSERVER-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13834333#comment-13834333 ] 

Emmanuel Lecharny commented on DIRSERVER-1921:
----------------------------------------------

The perfect JIRA !

Thanks !

I confirm this is a bug. The DnComparator is actually just checking if 2 DNs are equals, instead of telling if one is below or above another one. This leads to some trouble when finding a DN into the BTree :

    public int compare( Object obj0, Object obj1 )
    {
        Dn dn0 = null;
        Dn dn1 = null;

        try
        {
            dn0 = getDn( obj0 );
            dn1 = getDn( obj1 );
        }
        catch ( LdapException e )
        {
            // -- what do we do here ?
            return -1;
        }

        if ( dn0.equals( dn1 ) )
        {
            return 0;
        }
        else
        {
            return -1;
        }
    }


We need to implement a smarter DN comparator, which is a challenge..

> Indexes dont work on distinguishedNameMatch attributeType
> ---------------------------------------------------------
>
>                 Key: DIRSERVER-1921
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1921
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0-M15
>            Reporter: lucas theisen
>            Priority: Critical
>              Labels: patch, test
>         Attachments: patch.txt
>
>
> When attempting to add an index for an attribute that uses distinguishedNameMatch, items are not found.  I will attach a patch for the JdbmIndexTest that demonstrates the issue.



--
This message was sent by Atlassian JIRA
(v6.1#6144)