You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Jeremy Bauer (JIRA)" <ji...@apache.org> on 2013/07/23 17:42:49 UTC

[jira] [Updated] (OPENJPA-1794) Result of aggregate function MAX is 0 on empty table (instead of NULL).

     [ https://issues.apache.org/jira/browse/OPENJPA-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Bauer updated OPENJPA-1794:
----------------------------------

    Attachment: OPENJPA-1794.patch

Attaching patch for 2.1.x branch for review.  I will be committing the fix to trunk soon.
                
> 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
>         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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira