Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1794

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.2, 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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: