Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 41247 invoked from network); 13 Dec 2007 18:26:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Dec 2007 18:26:06 -0000 Received: (qmail 33377 invoked by uid 500); 13 Dec 2007 18:25:55 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 33339 invoked by uid 500); 13 Dec 2007 18:25:55 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 33321 invoked by uid 99); 13 Dec 2007 18:25:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2007 10:25:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2007 18:25:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 04114714201 for ; Thu, 13 Dec 2007 10:25:43 -0800 (PST) Message-ID: <242227.1197570343007.JavaMail.jira@brutus> Date: Thu, 13 Dec 2007 10:25:43 -0800 (PST) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3257) SELECT with HAVING clause containing OR conditional incorrectly return 1 row - should return 2 rows - works correctly with 10.2 DB In-Reply-To: <9099950.1196902783049.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551569 ] Mamta A. Satoor commented on DERBY-3257: ---------------------------------------- My trunk client is at revision 603368 $ svn info Path: . URL: https://svn.apache.org/repos/asf/db/derby/code/trunk Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 Revision: 603368 Node Kind: directory Schedule: normal Last Changed Author: kmarsden Last Changed Rev: 603301 Last Changed Date: 2007-12-11 09:03:01 -0800 (Tue, 11 Dec 2007) Properties Last Updated: 2007-11-26 09:22:05 -0800 (Mon, 26 Nov 2007) When I run the attached test case with revision 603368, I get incorrect results, ie only one count is returned back. $ java org.apache.derbyTesting.functionTests.tests.lang.DERBY_3257_Repro Database product: Apache Derby Database version: 10.4.0.0 alpha - (1) Driver name: Apache Derby Embedded JDBC Driver Driver version: 10.4.0.0 alpha - (1) result: 2 > SELECT with HAVING clause containing OR conditional incorrectly return 1 row - should return 2 rows - works correctly with 10.2 DB > ---------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3257 > URL: https://issues.apache.org/jira/browse/DERBY-3257 > Project: Derby > Issue Type: Bug > Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0 > Reporter: Stan Bradbury > Attachments: TestHaving.java > > > Attached program demonstrates the problem. Only one count is returned (matching CODE= GBR) - the count of CODE=CHA is not returned. Works fine with versions 10.1 and 10.2 or if program is run using 10.3 jars and 10.2 database (soft upgrade). > Query: > SELECT COUNT(t0.ID) FROM CTS1.TEST_TABLE t0 > GROUP BY t0.CODE > HAVING (t0.CODE = 'GBR' OR t0.CODE = 'CHA') AND t0.CODE IS NOT NULL > Incorrect results (see last line): > Database product: Apache Derby > Database version: 10.3.1.5 - (579866) > Driver name: Apache Derby Embedded JDBC Driver > Driver version: 10.3.1.5 - (579866) > result: 2 > Correct results: > Database product: Apache Derby > Database version: 10.2.2.0 - (485682) > Driver name: Apache Derby Embedded JDBC Driver > Driver version: 10.2.2.0 - (485682) > result: 4 > result: 2 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.