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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.2, 2.1.2, 2.2.1.1, 2.2.3, 2.3.0
    • query
    • 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

        1. OPENJPA-1794.patch
          30 kB
          Jeremy Bauer

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: