From dc12b458079779aa7d3ab79d9348bd3da6701315 Mon Sep 17 00:00:00 2001 From: "Vanilla I. Shu" Date: Wed, 9 May 2001 06:00:37 +0000 Subject: Upgrade to 7.1.1 PR: ports/27220 Submitted by: maintainer --- databases/postgresql73/files/patch-jdbc-getdate | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 databases/postgresql73/files/patch-jdbc-getdate (limited to 'databases/postgresql73/files/patch-jdbc-getdate') diff --git a/databases/postgresql73/files/patch-jdbc-getdate b/databases/postgresql73/files/patch-jdbc-getdate new file mode 100644 index 000000000000..744407ae14b5 --- /dev/null +++ b/databases/postgresql73/files/patch-jdbc-getdate @@ -0,0 +1,34 @@ +--- src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java~ Fri Feb 23 19:12:23 2001 ++++ src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java Wed May 9 04:31:11 2001 +@@ -423,8 +423,13 @@ + 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); ++ } + } + + /** +@@ -441,8 +446,13 @@ + + if(s==null) + return null; // SQL NULL +- +- return java.sql.Time.valueOf(s); ++ // length == 8: SQL Time ++ // length > 8: SQL Timestamp ++ try { ++ return java.sql.Time.valueOf((s.length() == 8) ? s : s.substring(11,19)); ++ } catch (NumberFormatException e) { ++ throw new PSQLException("postgresql.res.badtime",s); ++ } + } + + /** -- cgit v1.2.3