db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: extra column in DatabaseMetaData.getColumns() with group by in view
Date Thu, 14 May 2009 19:17:23 GMT
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 
select column_name
from table ( getColumns( null, null, 'V', null ) ) s;


View raw message