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

Commit0786c61

Browse files
author
Dave Cramer
committed
Patch from Cormac Twomey
fixes getIndexInfo throwing NullPointerExceptionfixes getIndexInfo improper results when multiple key indexs are used
1 parent178961a commit0786c61

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/*
1616
* This class provides information about the database as a whole.
1717
*
18-
* $Id: DatabaseMetaData.java,v 1.48 2002/01/1817:21:31 davec Exp $
18+
* $Id: DatabaseMetaData.java,v 1.49 2002/02/22 02:17:13 davec Exp $
1919
*
2020
* <p>Many of the methods here return lists of information in ResultSets. You
2121
* can use the normal ResultSet methods such as getString and getInt to
@@ -2919,6 +2919,8 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
29192919
{
29202920
columnOrdinals[o++] =Integer.parseInt(stok.nextToken());
29212921
}
2922+
2923+
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute a WHERE a.attrelid = " +r.getInt(9));
29222924
for (inti =0;i <columnOrdinals.length;i++)
29232925
{
29242926
byte [] []tuple =newbyte [13] [];
@@ -2934,12 +2936,11 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
29342936
Integer.toString(tableIndexHashed).getBytes() :
29352937
Integer.toString(tableIndexOther).getBytes();
29362938
tuple[7] =Integer.toString(i +1).getBytes();
2937-
java.sql.ResultSetcolumnNameRS =connection.ExecSQL("select a.attname FROM pg_attribute a WHERE (a.attnum = " +columnOrdinals[i] +") AND (a.attrelid = " +r.getInt(9) +")");
29382939
if (columnNameRS.next())
29392940
tuple[8] =columnNameRS.getBytes(1);
29402941
else
29412942
tuple[8] ="".getBytes();
2942-
tuple[8] =columnNameRS.getBytes(1);
2943+
29432944
tuple[9] =null;// sort sequence ???
29442945
tuple[10] =r.getBytes(7);// inexact
29452946
tuple[11] =r.getBytes(8);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp