1
0
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:
Barry Lind
2001-11-12 19:59:46 +00:00
parent 3c879e3738
commit 7a9ef7ee09
2 changed files with 46 additions and 3 deletions

View File

@ -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);
}
}
/**