pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Clark <davidclark@tx.rr.com>
To: pgsql-jdbc@postgresql.org
Subject: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet?
Date: Mon, 30 Apr 2007 16:45:37 -0500
Message-ID: <200704301645.37898.davidclark@tx.rr.com> (raw)

There seems to be a bug in internalGetObject(int, Field) in 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.  I am using the 
postgresql-jdbc-8.0-319.src sources.  I am placing the patch file inline 
below in case the mailing list does not accept attachments.  The bug (?) is 
that for TINYINT and SMALLINT columns a java.lang.Short should be returned 
from internalGetObject, but an Integer is returned instead.

Patch:

inline patch 1: AbstractJdbc2ResultSet.java.patched (+1/-0 lines) download inline-1.patch--- AbstractJdbc2ResultSet.java 2007-04-16 11:37:04.000000000 -0500 +++ AbstractJdbc2ResultSet.java.patched 2007-04-30 15:52:51.000000000 -0500 @@ -117,6 +117,7 @@ return getBoolean(columnIndex) ? Boolean.TRUE : Boolean.FALSE; case Types.TINYINT: case Types.SMALLINT: + return new Short(getShort(columnIndex)); case Types.INTEGER: return new Integer(getInt(columnIndex)); case Types.BIGINT:
David Clark

view thread (4+ messages)  latest in thread

Message-ID: <200704301645.37898.davidclark@tx.rr.com>
Permalink:  ../200704301645.37898.davidclark@tx.rr.com/
Also on:    postgresql.org/message-id/200704301645.37898.davidclark@tx.rr.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: davidclark@tx.rr.com
  Subject: Re: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet?
  In-Reply-To: <200704301645.37898.davidclark@tx.rr.com>
  References: <200704301645.37898.davidclark@tx.rr.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox