patch for ResultSet.java - Mailing list pgsql-patches

From Alexander Litvinov
Subject patch for ResultSet.java
Date
Msg-id 200204190656.g3J6ubt01688@gw.ac-sw.com
Whole thread Raw
List pgsql-patches
If I try to fetch timestamp using rs,getTimestamp("name") I got:

java.lang.StringIndexOutOfBoundsException: String index out of range: 22
        at java.lang.String.charAt(String.java(Compiled Code))
        at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653)
        at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:398)
        at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:617)

Later I tried to do rs.getString("name") I got: "1903-12-29 18:00:12.68"

Using PostgreSQL v7.1.3 (JDBC from 7.2.1)

I have added some bounds check to ResultSet.java. See attached patch.
Attachment

pgsql-patches by date:

Previous
From: Olivier PRENANT
Date:
Subject: Re: [HACKERS] build of 7.2.1 on SCO Openserver andUnixware
Next
From: Dmitry Tkach
Date:
Subject: Patch for memory leaks in index scan