[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5173) hql - average returns double but looses the decimal part
Sébastien Peters (JIRA)
noreply at atlassian.com
Sat May 1 06:15:28 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36817#action_36817 ]
Sébastien Peters commented on HHH-5173:
---------------------------------------
Not the case on mysql database - this is only on hsqldb
Also, we are not the only ones having this problem:
http://www.jezzper.com/jezzper/Discussions.nsf/f72637182738a22ec1257082007010ef/8cd3ba95f022cb95c12576ee005e0f47!OpenDocument
According to hsqldb documentation the AVG function returns a value in the type of the column on which the AVG is calculated.
http://www.hsqldb.org/doc/guide/ch09.html
> hql - average returns double but looses the decimal part
> --------------------------------------------------------
>
> Key: HHH-5173
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5173
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.5.0-Final
> Environment: Database driver: hsqldb
> OS: Mac-Os
> Hibernate: 3.5.0-Final
> Reporter: Sébastien Peters
> Attachments: patch_unit_test.txt
>
>
> HQL:
> select avg(r.rating) from Review r
> for the values 2,2,2,1,2 it should return 1.8 instead of 1.0
> type of rating: integer
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list