Subject Re: [Firebird-Java] DataBaseMetada.getIndexInfo() does not return all indexes
Author Mark Rotteveel
On 14-1-2012 1:09, Thomas wrote:
> Hi,
>
> consider the following table:
>
> CREATE TABLE T (caption varchar(50));
> CREATE INDEX idx_capt_upper ON t computed by (upper(caption));
>
> When calling
>
> conection.getMetaData().getIndexInfo(null, null, "T", true, false);
>
> the result set will be empty.
>
> I had a look at the driver source and the statement that is being used to return all indizes does an inner join on rdb$indices and rdb$index_segments
>
> An index with "computed by" does not seem to have a row in rdb$index_segments and the join fails.
>
> When changing the statement to use an outer join, the above index will be returned.
>
> Of course the NULL values for rdb$field_position and rdb$field_name from rdb$index_segments needs to be taken into account.

It looks like you are right, I created a tracker ticket:
http://tracker.firebirdsql.org/browse/JDBC-228

As I am currently working on the DatabaseMetaData implementation anyway,
I will probably include this in Jaybird 2.2 if the actual fix is not too
complex.

Thank you for reporting this problem.

Mark
--
Mark Rotteveel