ToBoolean method return correct Boolean values as per JDBC spec - Mailing list pgsql-patches

From Kim Ho
Subject ToBoolean method return correct Boolean values as per JDBC spec
Date
Msg-id 1055959376.13891.57.camel@topanga.toronto.redhat.com
Whole thread Raw
List pgsql-patches
Problem:
- The toBoolean() method treats all input strings that start with T, t,
or 1 as true. For instance, "The sun is not a star." is evaluated as
true...
However, booleans are only supposed to be true if the
value of the input string is equalsignorecase "True".
I've left in a single character string "1" and
a single character string "t" (or "T") for backwards compatibility.

new Boolean("this is not a boolean") produces a Boolean object that
represents false.

However, when you insert 'this is not a boolean' into a CHAR column and
use getBoolean to extract it, it returns true.

Fix:
 - Different check in toBoolean()

Cheers,

Kim

Attachment

pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Runtime.SGML diff ... please expedite!
Next
From: Rod Taylor
Date:
Subject: System Catalog Foreign Keys (linked)