You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Lorenz Breu (JIRA)" <ji...@apache.org> on 2009/01/05 11:25:44 UTC

[jira] Updated: (DIRSERVER-1296) integer attribute types are not compared correctly

     [ https://issues.apache.org/jira/browse/DIRSERVER-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lorenz Breu updated DIRSERVER-1296:
-----------------------------------

    Attachment: SearchIT.java
                ComparableComparator.java

apacheds-trunk/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java
Tracked the integer comparison to the "ComparableComparator" which treats them as Strings, so I added a quick fix to first try to parse arguments as integers. There may be a more elegant solution, but at least now it works correctly ;)

apacheds-trunk/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
I also added 4 quick tests to SearchIT as the two existing tests fail to spot the error as they stay below 10. I did a fresh install of mina and apacheds without the fix -> fail. I then applied the fix and ran the complete set of integration tests on the whole apacheds project -> success. Tests I use in my ADS-based project, which spotted the problem in the first place, now also pass. So I guess this does actually work...



> integer attribute types are not compared correctly
> --------------------------------------------------
>
>                 Key: DIRSERVER-1296
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1296
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.4
>            Reporter: Lorenz Breu
>             Fix For: 1.5.5
>
>         Attachments: ComparableComparator.java, SearchIT.java
>
>
> When searching for entries that have attributes with the INTEGER syntax, the values are compared lexicographically, not numerically. This happens even if the ordering and equality types are explicitly set to their integer versions when injecting the attribute types into ADS.
> Example:
> dn: cn = foo, dc = example
> cn: foo
> integerAttribute: 435
> now a search using "(integerAttribute<=500)" will correctly return the entry....
> but a search using "(integerAttribute<=44)" will ALSO return the entry, which it clearly should not.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.