Red Hat Bugzilla – Bug 149552
ResultSet.getInt alters numbers >= 2^24
Last modified: 2013-07-02 23:03:52 EDT
Description of problem:
ResultSet.getInt loses precision for values larger than 2^24.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Use the JDBC driver to select an int4 column containing the value
16777217, retrieve it with ResultSet.getInt(1), and observe that
the returned value is 16777216.
Returned int is 16777216.
Returned int is 16777217.
string values by converting to a Float and then rounding to an
int. Float cannot exactly represent 16777217 (and many other
useful values of int4). A similar bug exists in the toLong method
for large values of long. Appears to be fixed in 7.3.9 and 7.4.6,
but it should be documented somewhere that the 7.3.4 driver is
Since we're already shipping 7.3.9 as a security erratum for RHEL3,
shouldn't I just close this report as RESOLVED ERRATA? AFAIK there
isn't any place to document historical bugs. Or were you just
interested in creating a bugzilla entry for it?
Yes, I was just trying to create a bugzilla entry, as it would have
saved me a day of work. There may be others out there who haven't
upgraded to the latest version yet or who are trying to balance the
risk of an upgrade against the risk of not applying the errata.
Fair enough, though we seldom try to make bugzilla entries for every
single upstream patch included in an update ...