Description:
Looking at old reports about problems with the MySQL ODBC
driver and wxWidgets, and reviewing the source for
SQLGetTypeInfo() in "driver/info.c", it looks like it could
need a cleanup. I tried do some cleanup, but it needs more
work from someone with deeper knowledge about ODBC and the
MySQL data types.
Attached to this bug report is a start of a cleanup of the
table that is the base for this functions current implemen-
tation. The definition and examples I used are at
http://msdn2.microsoft.com/en-us/library/ms714632.aspx
http://msdn2.microsoft.com/en-us/library/ms715410.aspx
The changes compared to the current 3.51.20 version are
- Removed ending whitespace in "binary large object (0-255) "
- Removed "bit auto_increment", BIT is not numeric.
- Set NULL for UNSIGNED_ATTRIBUTE as BIT as not numeric
- Set NULL for other non numeric types where no value applies
- Set NULL for types where auto increment doesn't apply
- Changed NUM_PREC_RADIX for "double" from 2 to 10
Note that the attached table is for v3 only, a separate
one or some handling of ODBC v2 is also needed.
Some questions I could not answer are
- Is it correct that all char types marked as case insensitive?
- There are have two columns with "double", different SQL_*, is that ok?
- Does MySQL have "interval" types that should be added?
- Should there be separate "types" for auto increment, separate rows?
- Are there other types missing?
- What does the COLUMN_SIZE "precision" really mean, and when can it be NULL?
- How can the same DATA_TYPE be used but different COLUMN_SIZE?
How to repeat:
You need to review the source for this function.
Suggested fix:
A review and correction of this table, or maybe
let the server somehow tell the driver what it
can support? Some types has changed from MySQL 4.1
to 5.x, so having a static table is a bit tricky.