Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 10283 invoked from network); 14 May 2009 19:18:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 May 2009 19:18:31 -0000 Received: (qmail 19750 invoked by uid 500); 14 May 2009 19:18:31 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19707 invoked by uid 500); 14 May 2009 19:18:31 -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 19698 invoked by uid 99); 14 May 2009 19:18:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 19:18:29 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.43.133] (HELO sca-es-mail-2.sun.com) (192.18.43.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 19:18:18 +0000 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n4EJHu8V010444 for ; Thu, 14 May 2009 12:17:56 -0700 (PDT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KJN00E00ETLIK00@fe-sfbay-09.sun.com> for derby-dev@db.apache.org; Thu, 14 May 2009 12:17:56 -0700 (PDT) Received: from richard-hillegas-computer.local ([unknown] [129.150.16.183]) by fe-sfbay-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) with ESMTPSA id <0KJN00CL5EWZDY80@fe-sfbay-09.sun.com> for derby-dev@db.apache.org; Thu, 14 May 2009 12:17:24 -0700 (PDT) Date: Thu, 14 May 2009 12:17:23 -0700 From: Rick Hillegas Subject: Re: extra column in DatabaseMetaData.getColumns() with group by in view In-reply-to: <4A0C6163.5090105@amberpoint.com> Sender: Richard.Hillegas@Sun.COM To: derby-dev@db.apache.org Message-id: <4A0C6E43.1090400@sun.com> References: <4A0C58CB.4020905@sbcglobal.net> <4A0C6163.5090105@amberpoint.com> User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) X-Virus-Checked: Checked by ClamAV on apache.org Bryan Pendleton wrote: >> This sounds very familiar so I was wondering if there is already an >> issue filed. The closest thing I could find was >> https://issues.apache.org/jira/browse/DERBY-3141 > > Also might have some similarities with DERBY-3997. > > thanks, > > bryan > I have pushed the view definition around a little. In order to reproduce the problem I needed both the expression in the SELECT list (data2 + 2) and the GROUP BY clause. Note that a query against the view returns the correct number of columns, it is only the metadata which is wrong. The following simpler script demonstrates the problem: drop view v; drop table a; create table A (data2 integer); create view V (num) as select data2 + 2 from A group by data2; -- returns only 1 column, as expected select * from v; -- reports that v has 2 columns, which is not true -- -- here we use the metadata vtis from DBMDWrapper, attached to http://issues.apache.org/jira/browse/DERBY-3973 select column_name from table ( getColumns( null, null, 'V', null ) ) s; Regards, -Rick