Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320120 - On MaxDB, query returns sum of BigDecimal atrribute as Double
Summary: On MaxDB, query returns sum of BigDecimal atrribute as Double
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: maxdb submitted_patch
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 11:41 EDT by Adrian Goerler CLA
Modified: 2022-06-09 10:20 EDT (History)
5 users (show)

See Also:


Attachments
proposed patch (4.45 KB, patch)
2011-06-10 08:53 EDT, Konstantin Schwed CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Goerler CLA 2010-07-16 11:41:17 EDT
In the test suite eclipselink.jpa.wdf.test, the test 
org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestSetFunctions.testSum 
fails on MaxDB. 

The test executes the following query

select sum(e.salary) from Employee e.

The attribute has the type BigDecimal. The test assumes that the return type of the query is BigDecimal. However, a Double value is returned. 

This violates ยง4.8.4:

SUM returns [...] and BigDecimal when applied to state fields of type BigDecimal

Likely, this issue does not affect MaxDB only.
Comment 1 Adrian Goerler CLA 2010-07-16 11:53:04 EDT
Same applies to test 

org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestSelectListTypes.testSumBigDecimal.
Comment 2 Tom Ware CLA 2010-08-09 13:55:38 EDT
Setting target and priority.  See the following page for details of the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 3 Adrian Goerler CLA 2011-06-08 04:18:00 EDT
assigning this to Konstantin as he is working on this issue
Comment 4 Konstantin Schwed CLA 2011-06-10 08:53:25 EDT
Created attachment 197769 [details]
proposed patch

Tested on MaxDB and MySQL for test-core, test-jpa and test-wdf -> ok, no regression, but please double-check

This patch solves the problem described above. Two of the wdf tests (TestSetFunctions.testSum() and TestSelectListTypes.testSumBigDecimal()) can now be used.
Comment 5 Tom Ware CLA 2013-05-16 14:32:53 EDT
Checked into 2.5.1
Comment 6 Tom Ware CLA 2013-05-16 14:56:35 EDT
Fix checked into 2.5.1, master

Reviewed by: Tom Ware reviewed user submitted fix

Tested with JPA LRG
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:20:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink