Alex, 

Thanks for your information. And I would suggest we improve Jackrabbit 
implementation by converting the number formats automatically. Or just simply 
throw out an exception if the input format is not the same as property format. 
I personally don't think current implementation makes sense.

Best,
Kevin




----- Original Message ----
From: Alexander Klimetschek <[email protected]>
To: [email protected]
Sent: Tuesday, January 20, 2009 1:25:58 AM
Subject: Re: A bug? Query returns wrong records

On Sat, Jan 17, 2009 at 5:48 AM, Cheng Zhang <[email protected]> wrote:
> Problem: query below returns one row which is wrong.
>
>  select * from oag:CustomerReviews where AverageRating > 5
>
> but query below is ok:
>
>  select * from oag:CustomerReviews where AverageRating > 5.0
>
> A bug?

AFAIK a double value (such as AverageRating) must be compared against
a double literal in sql/xpath queries, ie. include a dot like "5.0".
The JCR spec does not mandate long<->double conversion in that case:
"In case of type mismatches in a comparison LONGs can be converted to
DOUBLEs".

[1] http://www.day.com/specs/jcr/1.0/8.5.4.3_WHERE.html

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to