Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E085B10445 for ; Thu, 17 Oct 2013 22:17:44 +0000 (UTC) Received: (qmail 30289 invoked by uid 500); 17 Oct 2013 22:17:44 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 30244 invoked by uid 500); 17 Oct 2013 22:17:44 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 30203 invoked by uid 99); 17 Oct 2013 22:17:44 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Oct 2013 22:17:44 +0000 Date: Thu, 17 Oct 2013 22:17:43 +0000 (UTC) From: "Heath Thomann (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (OPENJPA-1794) Result of aggregate function MAX is 0 on empty table (instead of NULL). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Heath Thomann resolved OPENJPA-1794. ------------------------------------ Resolution: Fixed Fix Version/s: 2.2.1.1 2.1.2 > 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 > > 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.1#6144)