From derby-dev-return-11185-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Fri Dec 02 02:24:18 2005 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 34032 invoked from network); 2 Dec 2005 02:24:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Dec 2005 02:24:06 -0000 Received: (qmail 96574 invoked by uid 500); 2 Dec 2005 02:23:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 96544 invoked by uid 500); 2 Dec 2005 02:23:59 -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 96535 invoked by uid 99); 2 Dec 2005 02:23:58 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2005 18:23:56 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 8046DDE for ; Fri, 2 Dec 2005 03:23:35 +0100 (CET) Message-ID: <1518650699.1133490215523.JavaMail.jira@ajax.apache.org> Date: Fri, 2 Dec 2005 03:23:35 +0100 (CET) From: "Satheesh Bandaram (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-280) Wrong result from select when aliasing to same name as used in group by In-Reply-To: <635945000.1115971694156.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-280?page=comments#action_12359116 ] Satheesh Bandaram commented on DERBY-280: ----------------------------------------- Thanks Kathey... Your comment explains what you were refering to. There was a potential regression that was found and fixed during the review/commit process, so I thought you were refering to that. About the SQL: select a+1 as a, a+1 as a from bug280 group by a, the patch does prevent its use now. But the statement is so (likely) rare and with the patch it gives a nice error message on what to change, I think it might be sufficient. Also Rick only marked this incomplete, keeping it open for improvement, I think. If you still have an itch to file a bug, go ahead! > Wrong result from select when aliasing to same name as used in group by > ----------------------------------------------------------------------- > > Key: DERBY-280 > URL: http://issues.apache.org/jira/browse/DERBY-280 > Project: Derby > Type: Bug > Components: SQL > Reporter: Bernt M. Johnsen > Assignee: Rick Hillegas > Priority: Minor > Attachments: bug280.diff > > Wrong result from select when aliasing to same name as used in group by. Example: > If we have the following table: > ij> select * from tt; > I |J > ----------------------- > 1 |2 > 2 |3 > 1 |2 > 2 |3 > 2 |3 > > 5 rows selected > The following select is ok: > ij> select i, count(*) as cnt from tt group by i; > I |CNT > ----------------------- > 1 |2 > 2 |3 > > 2 rows selected > But this one returns wrong result in the aliased column: > ij> select i, count(*) as i from tt group by i; > I |I > ----------------------- > 1 |1 > 2 |2 > > 2 rows selected > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira