OSDN Git Service

This patch fixes a bug reported by Graham Leggett (minfrin@sharp.fm).
authorBarry Lind <barry@xythos.com>
Sun, 25 Nov 2001 23:26:59 +0000 (23:26 +0000)
committerBarry Lind <barry@xythos.com>
Sun, 25 Nov 2001 23:26:59 +0000 (23:26 +0000)
commit4bc8c8dd95367a1dd0e9af3f1805bb85018ec307
treecb1ae41232cde0100e91e4c74e382f0db1de497a
parent23b5ca91aa92abf518fe1e86eb2b7b478414192b
This patch fixes a bug reported by Graham Leggett (minfrin@sharp.fm).
The bug was that any insert or update would fail if the returned oid was
larger than a signed int.  Since OIDs are unsigned int's it was
a bug that the code used a java signed int to deal with the values.  The bug
would result in the error message: "Unable to fathom update count".
While fixing the bug, it became apparent that other code made a similar
assumption about OIDs being signed ints.  Therefore some methods that returned
or took OIDs are arguements also needed to be changed.
Since we are so close to the 7.2 release I have added new methods that
return longs and deprecated the old methods returning ints.  Therefore all
old code should still work without requiring a code change to cast from long to int.  Also note that the methods below are PostgreSQL specific extensions to
the JDBC api are are not part of the spec from Sun, thus it is unlikely that
they are used much or at all.

The deprecated methods are:
  ResultSet.getInsertedOID()
  Statement.getInsertedOID()
  Serialize.store()
  Connection.putObject()
and are replaced by:
  ResultSet.getLastOID()
  Statement.getLastOID()
  Serialize.storeObject()
  Connection.storeObject()
All the deprecated methods returned int, while their replacements return long

This patch also fixes two comments in MD5Digest that the author Jeremy Wohl
submitted.

--Barry
14 files changed:
src/interfaces/jdbc/example/basic.java
src/interfaces/jdbc/org/postgresql/Connection.java
src/interfaces/jdbc/org/postgresql/ResultSet.java
src/interfaces/jdbc/org/postgresql/Statement.java
src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java
src/interfaces/jdbc/org/postgresql/jdbc1/Connection.java
src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java
src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java
src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java
src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
src/interfaces/jdbc/org/postgresql/util/MD5Digest.java
src/interfaces/jdbc/org/postgresql/util/Serialize.java