mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
fixed bug in ResultSet. Version 1.29 backed out two previous fixes (1.26 and 1.25). This checkin add back those two previous fixes. Problem reported by Daniel Germain
This commit is contained in:
@ -445,7 +445,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
|
||||
String s = getString(columnIndex);
|
||||
if (s == null)
|
||||
return null;
|
||||
return java.sql.Date.valueOf(s);
|
||||
// length == 10: SQL Date
|
||||
// length > 10: SQL Timestamp, assumes PGDATESTYLE=ISO
|
||||
try {
|
||||
return java.sql.Date.valueOf((s.length() == 10) ? s : s.substring(0,10));
|
||||
} catch (NumberFormatException e) {
|
||||
throw new PSQLException("postgresql.res.baddate", s);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user