To reproduce the bug:
1) create a node which has a DOUBLE property and a LONG property. Let's say the
property names are dp and lp
2) use SQL queries below to select the node.
a. select .... where dp > nnn
b. select .... where dp > nnn.0
c. select .... where lp > nnn
d. select .... shere lp > nnn.0
Thanks,
Kevin
----- Original Message ----
From: Cheng Zhang <[email protected]>
To: [email protected]
Sent: Friday, January 16, 2009 8:48:48 PM
Subject: A bug? Query returns wrong records
Hi,
I have a node type oag:CustomerReviews. Below is the dump from NodeTypeManager.
{http://www.openandgreen.com/oag/1.0}CustomerReviews
Supertypes
{http://www.jcp.org/jcr/nt/1.0}unstructured
Mixin false
OrderableChildNodes false
PrimaryItemName <null>
PropertyDefinition (declared in
{http://www.openandgreen.com/oag/1.0}CustomerReviews) id=1471555952
Name {}AverageRating
RequiredType Double
ValueConstraints
DefaultValue
AutoCreated false
Mandatory false
OnVersion COPY
Protected false
Multiple false
PropertyDefinition (declared in
{http://www.openandgreen.com/oag/1.0}CustomerReviews) id=-1454872483
Name {}TotalReviewPages
RequiredType Long
ValueConstraints
DefaultValue
AutoCreated false
Mandatory false
OnVersion COPY
Protected false
Multiple false
PropertyDefinition (declared in
{http://www.openandgreen.com/oag/1.0}CustomerReviews) id=-1820687444
Name {}TotalReviews
RequiredType Long
ValueConstraints
DefaultValue
AutoCreated false
Mandatory false
OnVersion COPY
Protected false
Multiple false
NodeDefinition (declared in
{http://www.openandgreen.com/oag/1.0}CustomerReviews) id=-1424822435
Name {}Review
RequiredPrimaryType {http://www.openandgreen.com/oag/1.0}Review
AutoCreated false
Mandatory false
OnVersion COPY
Protected false
AllowsSameNameSiblings true
I created a node for this type. Below is the document view export result.
<?xml version="1.0" encoding="UTF-8"?>
<CustomerReviews jcr:primaryType="oag:CustomerReviews" AverageRating="4.5"
TotalReviewPages="37" TotalReviews="182"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:oag="http://www.openandgreen.com/oag/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
<Review jcr:primaryType="oag:Review"/>
</CustomerReviews>
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?
Thanks a lot,
Kevin