Bug #12303 MyODBC maps BIT values incorrectly
Submitted: 1 Aug 2005 19:42 Modified: 2 Aug 2005 7:45
Reporter: Antonin Blatny Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:MySQL 5.0.6-10, MyODBC 3.51.11 OS:Windows (Windows XP, 2000)
Assigned to: CPU Architecture:Any

[1 Aug 2005 19:42] Antonin Blatny
Description:
I very urgently need to use MySQL in the program VFP7 in the same way as the server MS SQL.  I have not been able to work with the BOOLEAN field types.  This type (type BIT), is returned correctly as the BOOLEAN type to VFP through the MS SQL Server ODBC.  However, it is returned as numeric or char, not logical, type from the server MySQL via MyODBC.  

In MySQL Reference Manual - 25.1.17. MyODBC Data Types: There are TWO rows with maping bit native value: The first row and again the row before last! Which maping is used? I guess second. But in my opinion the first is correct. I dont know, how to resolve this problem.

Thank you for your advice.

How to repeat:
in VFP7

a=SQLCONNECT()
?SQLEXEC(a,[use test])
?SQLEXEC(a,[create TABLE pokus (id char(10), logicka boolean)])
?SQLEXEC(a,[select logicka as pocet from pokus])
?TYPE([logicka])

last function returns 'N' instead of 'L'

Suggested fix:
Maping BIT values to SQL-BIT, not to SQL-CHAR
[2 Aug 2005 7:45] Vasily Kishkin
Sorry...but according to MySQL documentation it is right values for boolean field. Please read MySQL reference manual:

http://dev.mysql.com/doc/mysql/en/boolean-values.html