Skip to content

Commit

Permalink
Fix ResultSetMetaData retrieval when the oid counter exceeds INT_MAX.
Browse files Browse the repository at this point in the history
Since Java doesn't have unsigned ints we retrieve the values as long
and then truncate to int, so it may have a negative value.

As reported by Owen Tran.
  • Loading branch information
kjurka committed Mar 13, 2012
1 parent 1934bf1 commit d71fa76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ private void fetchFieldMetaData() throws SQLException {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql.toString());
while (rs.next()) {
int table = rs.getInt(1);
int column = rs.getInt(2);
int table = (int)rs.getLong(1);
int column = (int)rs.getLong(2);
String columnName = rs.getString(3);
String tableName = rs.getString(4);
String schemaName = rs.getString(5);
Expand Down

0 comments on commit d71fa76

Please sign in to comment.