Обсуждение: Driver not returning the type for TYPEs
Hi, I just noticed a minor glitchin the driver (8.4) When creating types using e.g.: CREATE TYPE my_tabpe AS (some_data varchar(100)); DatabaseMetaData.getTables() will return that type, but the value for the column TABLE_TYPE is null. I think if the driver returns non-table objects (which is fine, a lot of drivers are doing that), the TABLE_TYPE column ofthe result set should contain a proper value. Regards Thomas
Thomas Kellerer wrote on 07.03.2010 22:45: > Hi, > > I just noticed a minor glitchin the driver (8.4) > > When creating types using e.g.: > > CREATE TYPE my_tabpe AS (some_data varchar(100)); > > DatabaseMetaData.getTables() will return that type, but the value for > the column TABLE_TYPE is null. > > I think if the driver returns non-table objects (which is fine, a lot of > drivers are doing that), the TABLE_TYPE column of the result set should > contain a proper value. > > Regards > Thomas I had a quick look at the source code, and it seems quite simple to fix. I have attached a patch agains CVS head which (as far as I can tell) fixes this. It also supports getTables() passing "TYPE" in the String array to select which types to show. I hope the patch is OK, I have not used the diff tool before ;) But the changes are really very minimal, I hope I found all places.... Regards Thomas
Вложения
Thomas Kellerer wrote on 07.03.2010 23:46: > I had a quick look at the source code, and it seems quite simple to fix. > > I have attached a patch agains CVS head which (as far as I can tell) > fixes this. > It also supports getTables() passing "TYPE" in the String array to > select which types to show. > > I hope the patch is OK, I have not used the diff tool before ;) > > But the changes are really very minimal, I hope I found all places.... Any feedback on this? Regards Thomas
On Sun, 7 Mar 2010, Thomas Kellerer wrote: >> When creating types using e.g.: >> >> CREATE TYPE my_tabpe AS (some_data varchar(100)); >> >> DatabaseMetaData.getTables() will return that type, but the value for >> the column TABLE_TYPE is null. >> >> I think if the driver returns non-table objects (which is fine, a lot of >> drivers are doing that), the TABLE_TYPE column of the result set should >> contain a proper value. >> > > I had a quick look at the source code, and it seems quite simple to fix. > > I have attached a patch agains CVS head which (as far as I can tell) > fixes this. It also supports getTables() passing "TYPE" in the String > array to select which types to show. > > I hope the patch is OK, I have not used the diff tool before ;) > I've applied this with additional code to separate out temporary views and temporary sequences. A couple of notes on your patch for future reference: 1) You have it reversed. The patch is taking out your changes rather than adding them. 2) There are two CASE statements that convert relkind to TABLE_TYPE and you only got one of them. Kris Jurka
Kris Jurka wrote on 01.05.2010 18:56: > I've applied this with additional code to separate out temporary views > and temporary sequences. That is good news, thanks > A couple of notes on your patch for future reference: > > 1) You have it reversed. The patch is taking out your changes rather > than adding them. It was the first time I was creating a patch. I will pay more attention in the future :) Thanks for the feedback. Regards Thomas