13
13
/*
14
14
* This class provides information about the database as a whole.
15
15
*
16
- * $Id: DatabaseMetaData.java,v 1.41 2002/01/18 17:21:51 davec Exp $
16
+ * $Id: DatabaseMetaData.java,v 1.42 2002/02/22 02:40:09 davec Exp $
17
17
*
18
18
* <p>Many of the methods here return lists of information in ResultSets. You
19
19
* can use the normal ResultSet methods such as getString and getInt to
@@ -2791,13 +2791,14 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
2791
2791
{
2792
2792
columnOrdinals [o ++] = Integer .parseInt (stok .nextToken ());
2793
2793
}
2794
+ java .sql .ResultSet columnNameRS = connection .ExecSQL ("select a.attname FROM pg_attribute a WHERE a.attrelid = " + r .getInt (9 ));
2794
2795
for (int i = 0 ; i < columnOrdinals .length ; i ++)
2795
2796
{
2796
2797
byte [] [] tuple = new byte [13 ] [];
2797
2798
tuple [0 ] = "" .getBytes ();
2798
2799
tuple [1 ] = "" .getBytes ();
2799
2800
tuple [2 ] = r .getBytes (1 );
2800
- tuple [3 ] = r .getBoolean (2 ) ? "f " .getBytes () : "t " .getBytes ();
2801
+ tuple [3 ] = r .getBoolean (2 ) ? "false " .getBytes () : "true " .getBytes ();
2801
2802
tuple [4 ] = null ;
2802
2803
tuple [5 ] = r .getBytes (3 );
2803
2804
tuple [6 ] = r .getBoolean (4 ) ?
@@ -2806,9 +2807,14 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
2806
2807
Integer .toString (tableIndexHashed ).getBytes () :
2807
2808
Integer .toString (tableIndexOther ).getBytes ();
2808
2809
tuple [7 ] = Integer .toString (i + 1 ).getBytes ();
2809
- java .sql .ResultSet columnNameRS = connection .ExecSQL ("select a.attname FROM pg_attribute a WHERE (a.attnum = " + columnOrdinals [i ] + ") AND (a.attrelid = " + r .getInt (9 ) + ")" );
2810
- columnNameRS .next ();
2811
- tuple [8 ] = columnNameRS .getBytes (1 );
2810
+ if (columnNameRS .next ())
2811
+ {
2812
+ tuple [8 ] = columnNameRS .getBytes (1 );
2813
+ }
2814
+ else
2815
+ {
2816
+ tuple [8 ] = "" .getBytes ();
2817
+ }
2812
2818
tuple [9 ] = null ; // sort sequence ???
2813
2819
tuple [10 ] = r .getBytes (7 ); // inexact
2814
2820
tuple [11 ] = r .getBytes (8 );
0 commit comments