From: Dave Cramer Date: Wed, 14 Nov 2001 20:04:00 +0000 (+0000) Subject: fixes getIndex to work with forte's transparent persistence X-Git-Tag: REL7_2_BETA3~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80c029190ff72b81e0c86a66a6d8ff4b0608860b;p=postgresql fixes getIndex to work with forte's transparent persistence --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java index 431823631f..395cbadbe4 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java @@ -15,7 +15,7 @@ import org.postgresql.util.PSQLException; /** * This class provides information about the database as a whole. * - * $Id: DatabaseMetaData.java,v 1.44 2001/11/09 02:57:50 davec Exp $ + * $Id: DatabaseMetaData.java,v 1.45 2001/11/14 20:04:00 davec Exp $ * *

Many of the methods here return lists of information in ResultSets. You * can use the normal ResultSet methods such as getString and getInt to @@ -2903,8 +2903,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData tuple[0] = "".getBytes(); tuple[1] = "".getBytes(); tuple[2] = r.getBytes(1); - tuple[3] = r.getBoolean(2) ? "f".getBytes() : "t".getBytes(); - tuple[4] = null; + tuple[3] = r.getBoolean(2) ? "false".getBytes() : "true".getBytes(); + tuple[4] = null; tuple[5] = r.getBytes(3); tuple[6] = r.getBoolean(4) ? Integer.toString(tableIndexClustered).getBytes() : @@ -2913,7 +2913,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData Integer.toString(tableIndexOther).getBytes(); tuple[7] = Integer.toString(i + 1).getBytes(); java.sql.ResultSet columnNameRS = connection.ExecSQL("select a.attname FROM pg_attribute a WHERE (a.attnum = " + columnOrdinals[i] + ") AND (a.attrelid = " + r.getInt(9) + ")"); - columnNameRS.next(); + if(columnNameRS.next()) + tuple[8] = columnNameRS.getBytes(1); + else + tuple[8] = "".getBytes(); tuple[8] = columnNameRS.getBytes(1); tuple[9] = null; // sort sequence ??? tuple[10] = r.getBytes(7); // inexact