Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf107174

Browse files
committed
Included is a patch that fixes a bug introduced in the lastest version
(1.22) of interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java. Thatchange removed a line that set the variable s to the value of thestringbuffer. This fix changes the following if checks to check thelength of the stringbuffer instead of s, since s no longer contains thestring the if conditions are expecting.The bug manifests itself in getTimestamp() loosing the timezoneinformation of timestamps selected from the database, thereby causingthe time to be incorrect.Barry Lind
1 parent2e3c56a commitf107174

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,13 @@ public Timestamp getTimestamp(int columnIndex) throws SQLException
488488

489489
SimpleDateFormatdf =null;
490490

491-
if (s.length()>23 &&subsecond) {
491+
if (sbuf.length()>23 &&subsecond) {
492492
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz");
493-
}elseif (s.length()>23 && !subsecond) {
493+
}elseif (sbuf.length()>23 && !subsecond) {
494494
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz");
495-
}elseif (s.length()>10 &&subsecond) {
495+
}elseif (sbuf.length()>10 &&subsecond) {
496496
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
497-
}elseif (s.length()>10 && !subsecond) {
497+
}elseif (sbuf.length()>10 && !subsecond) {
498498
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss");
499499
}else {
500500
df =newSimpleDateFormat("yyyy-MM-dd");

‎src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,13 @@ public Timestamp getTimestamp(int columnIndex) throws SQLException
499499
// could optimize this a tad to remove too many object creations...
500500
SimpleDateFormatdf =null;
501501

502-
if (s.length()>23 &&subsecond) {
502+
if (sbuf.length()>23 &&subsecond) {
503503
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz");
504-
}elseif (s.length()>23 && !subsecond) {
504+
}elseif (sbuf.length()>23 && !subsecond) {
505505
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz");
506-
}elseif (s.length()>10 &&subsecond) {
506+
}elseif (sbuf.length()>10 &&subsecond) {
507507
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
508-
}elseif (s.length()>10 && !subsecond) {
508+
}elseif (sbuf.length()>10 && !subsecond) {
509509
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss");
510510
}else {
511511
df =newSimpleDateFormat("yyyy-MM-dd");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp