diff options
author | Bruce Momjian | 2001-05-17 04:10:02 +0000 |
---|---|---|
committer | Bruce Momjian | 2001-05-17 04:10:02 +0000 |
commit | f107174e8c722b791678a2f46da7164a9e2e1920 (patch) | |
tree | 6c8c1cd46e32b30ddee95a8697b7ea6f782b5f20 /src | |
parent | 2e3c56a0eac55d813e93c38aeabb98822c6d3519 (diff) |
Included is a patch that fixes a bug introduced in the lastest version
(1.22) of interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java. That
change removed a line that set the variable s to the value of the
stringbuffer. This fix changes the following if checks to check the
length of the stringbuffer instead of s, since s no longer contains the
string the if conditions are expecting.
The bug manifests itself in getTimestamp() loosing the timezone
information of timestamps selected from the database, thereby causing
the time to be incorrect.
Barry Lind
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java | 8 | ||||
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java index aae8cf6ff26..467476f833c 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java @@ -488,13 +488,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu SimpleDateFormat df = null; - if (s.length()>23 && subsecond) { + if (sbuf.length()>23 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz"); - } else if (s.length()>23 && !subsecond) { + } else if (sbuf.length()>23 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz"); - } else if (s.length()>10 && subsecond) { + } else if (sbuf.length()>10 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - } else if (s.length()>10 && !subsecond) { + } else if (sbuf.length()>10 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } else { df = new SimpleDateFormat("yyyy-MM-dd"); diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 54865d8e3f7..7aebd950b00 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -499,13 +499,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu // could optimize this a tad to remove too many object creations... SimpleDateFormat df = null; - if (s.length()>23 && subsecond) { + if (sbuf.length()>23 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz"); - } else if (s.length()>23 && !subsecond) { + } else if (sbuf.length()>23 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz"); - } else if (s.length()>10 && subsecond) { + } else if (sbuf.length()>10 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - } else if (s.length()>10 && !subsecond) { + } else if (sbuf.length()>10 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } else { df = new SimpleDateFormat("yyyy-MM-dd"); |