Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97ab49b

Browse files
author
Barry Lind
committed
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
1 parentbd39e0c commit97ab49b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* This class provides information about the database as a whole.
1515
*
16-
* $Id: DatabaseMetaData.java,v 1.33 2001/09/29 03:08:01 momjian Exp $
16+
* $Id: DatabaseMetaData.java,v 1.34 2001/10/24 04:31:48 barry Exp $
1717
*
1818
* <p>Many of the methods here return lists of information in ResultSets. You
1919
* can use the normal ResultSet methods such as getString and getInt to
@@ -2713,7 +2713,8 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
27132713
"a.amname, " +
27142714
"x.indkey, " +
27152715
"c.reltuples, " +
2716-
"c.relpages " +
2716+
"c.relpages, " +
2717+
"x.indexrelid " +
27172718
"FROM pg_index x, pg_class c, pg_class i, pg_am a " +
27182719
"WHERE ((c.relname = '" +tableName.toLowerCase() +"') " +
27192720
" AND (c.oid = x.indrelid) " +
@@ -2747,7 +2748,7 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
27472748
Integer.toString(tableIndexHashed).getBytes() :
27482749
Integer.toString(tableIndexOther).getBytes();
27492750
tuple[7] =Integer.toString(i +1).getBytes();
2750-
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute a, pg_class cWHERE (a.attnum = " +columnOrdinals[i] +") AND (a.attrelid = " +r.getInt(8) +")");
2751+
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute aWHERE (a.attnum = " +columnOrdinals[i] +") AND (a.attrelid = " +r.getInt(9) +")");
27512752
columnNameRS.next();
27522753
tuple[8] =columnNameRS.getBytes(1);
27532754
tuple[9] =null;// sort sequence ???

‎src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* This class provides information about the database as a whole.
1515
*
16-
* $Id: DatabaseMetaData.java,v 1.37 2001/09/29 03:08:01 momjian Exp $
16+
* $Id: DatabaseMetaData.java,v 1.38 2001/10/24 04:31:50 barry Exp $
1717
*
1818
* <p>Many of the methods here return lists of information in ResultSets. You
1919
* can use the normal ResultSet methods such as getString and getInt to
@@ -2716,7 +2716,8 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
27162716
"a.amname, " +
27172717
"x.indkey, " +
27182718
"c.reltuples, " +
2719-
"c.relpages " +
2719+
"c.relpages, " +
2720+
"x.indexrelid " +
27202721
"FROM pg_index x, pg_class c, pg_class i, pg_am a " +
27212722
"WHERE ((c.relname = '" +tableName.toLowerCase() +"') " +
27222723
" AND (c.oid = x.indrelid) " +
@@ -2750,7 +2751,7 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
27502751
Integer.toString(tableIndexHashed).getBytes() :
27512752
Integer.toString(tableIndexOther).getBytes();
27522753
tuple[7] =Integer.toString(i +1).getBytes();
2753-
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute a, pg_class cWHERE (a.attnum = " +columnOrdinals[i] +") AND (a.attrelid = " +r.getInt(8) +")");
2754+
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute aWHERE (a.attnum = " +columnOrdinals[i] +") AND (a.attrelid = " +r.getInt(9) +")");
27542755
columnNameRS.next();
27552756
tuple[8] =columnNameRS.getBytes(1);
27562757
tuple[9] =null;// sort sequence ???

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp