I wrote:
>
> Bruce Momjian wrote:
> >
> > Here is the submitted patch so everyone can see it.
> >
>
> I agree to the first change but am suspicious about the
> second change.
>
> > > > 2) I had issues with some utilities that, when casting from string to
> > > > boolean, and having
> > > > the global 'bools as char' set, require that -1 = True, and 0 = false.
> > > >
>
> Though Aidan is right, is -1 guaranteed to be true in
> any application conversely ? It seems also different
> from the ODBC spec. I don't have the solution now.
>
Please never apply the second part.
I would propose another idea instead soon(hopefully).
regards,
Hiroshi Inoue
-- 425,452 ----
break;
case PG_TYPE_BOOL:
!
if (cbValueMax > len)
<<<<<<< len isn't set at this point. >>>>>>>
{
! /* Aidan Mountford
(aidan@oz.to) 1/08/2001:
!
! When returning a CHAR
datatype, return -1
! instead of +1.
!
! That way if someone
casts it back to a boolean
! again - it will work.
! */
! if ( *(char *) value = '1')
<<<<<<<< '=' must be '=='. >>>>>>>>