Fix getXXX methods when used with CHAR columns or columns with decimals

Lists: pgsql-jdbcpgsql-patches
From: Kim Ho <kho(at)redhat(dot)com>
To: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Fix getXXX methods when used with CHAR columns or columns with decimals
Date: 2003-06-18 17:44:39
Message-ID: 1055958280.13891.40.camel@topanga.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc pgsql-patches

Problem:
- Error parsing input in getByte() and getShort() if input has a decimal or whitespace (from CHAR columns)
- Error parsing CHAR columns in other getXXX methods.

Fix:
- Added trim() to getXXX methods
- In getByte() and getShort(), check the field type and take out the decimal and everything after it. Also check for CHAR and trim if necessary.

Cheers,

Kim

Attachment Content-Type Size
fixgetXXXmethods.diff text/plain 3.4 KB

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Kim Ho <kho(at)redhat(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Fix getXXX methods when used with CHAR columns or
Date: 2003-06-30 21:09:29
Message-ID: 1057007368.3273.92.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc pgsql-patches

patch applied,

Thanks,

Dave
On Wed, 2003-06-18 at 13:44, Kim Ho wrote:
> Problem:
> - Error parsing input in getByte() and getShort() if input has a decimal or whitespace (from CHAR columns)
> - Error parsing CHAR columns in other getXXX methods.
>
> Fix:
> - Added trim() to getXXX methods
> - In getByte() and getShort(), check the field type and take out the decimal and everything after it. Also check for CHAR and trim if necessary.
>
> Cheers,
>
> Kim
>
>
>
> ______________________________________________________________________
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Dave Cramer <Dave(at)micro-automation(dot)net>