[ 
https://issues.apache.org/jira/browse/OPENJPA-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128582#comment-14128582
 ] 

ASF subversion and git services commented on OPENJPA-1794:
----------------------------------------------------------

Commit 1624026 from [~jpaheath] in branch 'openjpa/branches/2.0.x'
[ https://svn.apache.org/r1624026 ]

OPENJPA-1794: Return null, rather than 0, on MAX function - back ported to 
2.0.x Jeremy Bauer's commit to trunk.

> Result of aggregate function MAX is 0 on empty table (instead of NULL).
> -----------------------------------------------------------------------
>
>                 Key: OPENJPA-1794
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1794
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>            Reporter: Vera Filippova
>            Assignee: Jeremy Bauer
>             Fix For: 2.1.2, 2.2.1.1, 2.2.3, 2.3.0
>
>         Attachments: OPENJPA-1794.patch
>
>
> Below is a snippet of a test case... the max should be null, but is zero.
>             Object count = em.createQuery("Select count(p.pk) from Entity1 p 
> where 1=1").getSingleResult();
>             Object max = em.createQuery("Select max(p.pk) from Entity1 p 
> where 1=1").getSingleResult();
>             System.out.println("count:"+count+ " max:"+max);
>             > count:0 max:0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to