OpenJPA
  1. OpenJPA
  2. OPENJPA-1794

Result of aggregate function MAX is 0 on empty table (instead of NULL).

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.3, 2.1.2, 2.2.1.1, 2.2.3, 2.3.0
    • Component/s: query
    • Labels:
      None

      Description

      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

        Activity

        Mark Struberg made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Heath Thomann made changes -
        Fix Version/s 2.0.3 [ 12317143 ]
        Heath Thomann made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.3.0 [ 12319463 ]
        Resolution Fixed [ 1 ]
        Heath Thomann made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Heath Thomann made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.1.2 [ 12317142 ]
        Fix Version/s 2.2.1.1 [ 12323484 ]
        Resolution Fixed [ 1 ]
        Heath Thomann made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Jeremy Bauer made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.2.3 [ 12324305 ]
        Resolution Fixed [ 1 ]
        Jeremy Bauer made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Jeremy Bauer made changes -
        Attachment OPENJPA-1794.patch [ 12593711 ]
        Jeremy Bauer made changes -
        Field Original Value New Value
        Assignee Jeremy Bauer [ techhusky ]
        Vera Filippova created issue -

          People

          • Assignee:
            Jeremy Bauer
            Reporter:
            Vera Filippova
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development