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 2009/01/06 22:13:44 UTC

[jira] Resolved: (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 ]

Emmanuel Lecharny resolved DIRSERVER-1296.
------------------------------------------

    Resolution: Fixed

Patch applied, and fix done : a IntegerOrderingComparator has been added and registred.

> 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, patch_SearchIT.txt, 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.


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

Posted by Emmanuel Lecharny <el...@gmail.com>.
On Wed, Jan 7, 2009 at 5:40 PM, Alex Karasulu <ak...@gmail.com> wrote:
> So with this comparator missing we were defaulting to the use of lexographic
> comparisons on the INTEGER syntax when an index was built on the syntax?

yes, and also if we don't have index. In fact, the comparison was done
against the selected values.

If an index is built, then I guess that the optimizer would only
return values matching the filter (to be checked. in any case, that
would be an interesting optimization if it's not already implemented,
as we would not have to do another check against the filter)

> Makes sense since the index needs to be ordered using the ORDERING
> comparator for the integerMatch matching rule.  Just curious if this is your
> conclusion as well.

So far, I can say that the IntegerOrderingComparator is used to
compare the filter value with the selected values from the backend. I
don't know if those returned values are already matched against the
filter by the underlying optimizer...

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

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

Posted by Alex Karasulu <ak...@gmail.com>.
So with this comparator missing we were defaulting to the use of lexographic
comparisons on the INTEGER syntax when an index was built on the syntax?

Makes sense since the index needs to be ordered using the ORDERING
comparator for the integerMatch matching rule.  Just curious if this is your
conclusion as well.

Thanks,
Alex

On Tue, Jan 6, 2009 at 4:13 PM, Emmanuel Lecharny (JIRA) <ji...@apache.org>wrote:

>
>     [
> https://issues.apache.org/jira/browse/DIRSERVER-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Emmanuel Lecharny resolved DIRSERVER-1296.
> ------------------------------------------
>
>    Resolution: Fixed
>
> Patch applied, and fix done : a IntegerOrderingComparator has been added
> and registred.
>
> > 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, patch_SearchIT.txt,
> 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.
>
>