diff options
author | Barry Lind <barry@xythos.com> | 2001-10-09 20:47:35 +0000 |
---|---|---|
committer | Barry Lind <barry@xythos.com> | 2001-10-09 20:47:35 +0000 |
commit | 839b9bc0117946afd62ee385a4c8a36c01b3053b (patch) | |
tree | e79216ae693ea1f7e5e7eda0072280622a4f8662 /src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | |
parent | ffb8f73890a9998a7737434aefe190926369ee80 (diff) | |
download | postgresql-839b9bc0117946afd62ee385a4c8a36c01b3053b.tar.gz |
This patch fixes a bug introduced in the jdbc bytea support patch.
That patch broke the ability to read data from binary cursors.
--Barry Lind
Modified Files:
pgsql/src/interfaces/jdbc/org/postgresql/Connection.java
pgsql/src/interfaces/jdbc/org/postgresql/ResultSet.java
pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java
pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Connection.java
pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java
pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index feec8d08c2..3d39f6461a 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -74,9 +74,9 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu * @param updateCount the number of rows affected by the operation * @param cursor the positioned update/delete cursor name */ - public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount,int insertOID) + public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount,int insertOID, boolean binaryCursor) { - super(conn,fields,tuples,status,updateCount,insertOID); + super(conn,fields,tuples,status,updateCount,insertOID,binaryCursor); } /** @@ -90,10 +90,10 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu * @param updateCount the number of rows affected by the operation * @param cursor the positioned update/delete cursor name */ - public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount) - { - super(conn,fields,tuples,status,updateCount,0); - } + public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount) + { + super(conn,fields,tuples,status,updateCount,0,false); + } /** * A ResultSet is initially positioned before its first row, @@ -313,6 +313,9 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu if (columnIndex < 1 || columnIndex > fields.length) throw new PSQLException("postgresql.res.colrange"); + //If the data is already binary then just return it + if (binaryCursor) return this_row[columnIndex - 1]; + if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports the bytea datatype for byte arrays return PGbytea.toBytes(getString(columnIndex)); |