summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2001-10-24 04:31:50 +0000
committerBarry Lind <barry@xythos.com>2001-10-24 04:31:50 +0000
commit97ab49beb02e73c4e29eab21edefd887183496ad (patch)
tree737941310435a8dafee6cafd23a0a274f905b4bc /src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
parentbd39e0c0d76e730981754f7c299bbcc65462dc22 (diff)
downloadpostgresql-97ab49beb02e73c4e29eab21edefd887183496ad.tar.gz
fix for a bug in DatabaseMetaData.getIndexInfo(). This fixes a bug reported by tom_falconer@lineone.net. On Sept 7th, he sent a test case to the list demonstrating the bug. His test case now works successfully with this patch
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
index e6f558fb55..6cb522466c 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
@@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException;
/**
* This class provides information about the database as a whole.
*
- * $Id: DatabaseMetaData.java,v 1.37 2001/09/29 03:08:01 momjian Exp $
+ * $Id: DatabaseMetaData.java,v 1.38 2001/10/24 04:31:50 barry Exp $
*
* <p>Many of the methods here return lists of information in ResultSets. You
* can use the normal ResultSet methods such as getString and getInt to
@@ -2716,7 +2716,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
"a.amname, " +
"x.indkey, " +
"c.reltuples, " +
- "c.relpages " +
+ "c.relpages, " +
+ "x.indexrelid " +
"FROM pg_index x, pg_class c, pg_class i, pg_am a " +
"WHERE ((c.relname = '" + tableName.toLowerCase() + "') " +
" AND (c.oid = x.indrelid) " +
@@ -2750,7 +2751,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
Integer.toString(tableIndexHashed).getBytes() :
Integer.toString(tableIndexOther).getBytes();
tuple[7] = Integer.toString(i + 1).getBytes();
- java.sql.ResultSet columnNameRS = connection.ExecSQL("select a.attname FROM pg_attribute a, pg_class c WHERE (a.attnum = " + columnOrdinals[i] + ") AND (a.attrelid = " + r.getInt(8) + ")");
+ 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();
tuple[8] = columnNameRS.getBytes(1);
tuple[9] = null; // sort sequence ???