Thread: ODBC Patch to deal with poor boolean handling.

ODBC Patch to deal with poor boolean handling.

From
Aidan Mountford
Date:
The following patch (against 7.1.2)  rectifies an issue relating to handling
of booleans.

Was first noticed when using pgAdmin -- The first booleans in the first row
of a query result
were always false...

Some more digging found that it broke a few of our other products.

Testing has shown booleans to return correctly unconditionally now :)

Cheers for making a great product...

Aidan



cvs diff convert.c (in directory C:\CVS-POSTGRES\pgsql\src\interfaces\odbc\)
Index: convert.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/odbc/convert.c,v
retrieving revision 1.44
diff -r1.44 convert.c
295c295,308
<                 if (s[0] == 'T' || s[0] == 't')
---
>                 /*  Aidan Mountford (aidan@oz.to) 1/08/2001:

>
>                     >> if (s[0] == 'T' || s[0] == 't')
<<< This wont work...
>
>                     Quick Hack ...
>                     If 2 consecutive calls are placed to
FETCH_FIRST,
>                     the first time will report correctly
(Because s[0] = 't')
>                     s[0] is then set to '1'...
>                     The second time s[0] = 1 and it gets
set to '0'...
>                     Not too friendly :)
>                 */
>
>
>                 if (s[0] == 'T' || s[0] == 't' || s[0] ==
'1')



.....................................................
.  Cisco Certified Network Associate
.  Microsoft Certified Professional
.  3Com 3Wizard
.
.  Technical Director
.  MindVision Interactive Pty. Ltd.
.  http://www.mindvision.com.au
.  PH: +61-8-8212-9544
.  FAX: +61-8-8212-9644
.  48 Light Square
.  Adelaide SA
.  AUSTRALIA  5000
.....................................................

"Remember, There is always scope for things to be worse"