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

Reply via email to