SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR:
From: michaelc
To: mysql@stripped
Subject: MyODBC SQLGetTypeInfo() returns incorrect data
>Description:
A lot of data returned by MyODBC SQLGetTypeInfo() is incorrect.
1. The returned resultset is not "ordered by 2,1" (data_type and
type_name) as defined by ODBC API.
2. The literal_prefix column for all binary type should be "0x".
3. Since "Binary" is acceptable as a type name alias, it should
be used to map to SQL_BINARY type in ODBC. Similarly "Varbinary"
should be mapped to SQL_VARBINARY, and "Bit" to SQL_BIT, etc.
4. The precision of signed "Bigint" type should be 19 not 20 as is
for unsigned bigint. Similarly mediumint precision is 7 not 8.
5. The precision of "Decimal" and "Numeric" should not be 15. I get
19 from a SQLDescribeCol() call, but I think 19 is also wrong.
MySQL doc 7.3 says decimal has the same range as double, meaning
"-1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
2.2250738585072014E-308 to 1.7976931348623157E+308." Then the
precision should be 17 not 19 (shouldn't count sign and the
decimal point).
6. I don't see why "Float" type is "unsearchable", probably typo.
7. "Set" and "Enum" type should be "Varchar" and not "Char".
8. Finally, in the source code I submitted, I removed several types
that has no coresponding ODBC data type such as mediumint and
year. It is up to MySQL to make the final decision.
>How-To-Repeat:
Call SQLGetTypeInfo().
>Fix:
See attached source file "info.c" modified from the 2.50.36 release.
>Submitter-Id: <submitter ID>
>Originator: Michael Chen
>Organization:
IDS Software (http://www.idssoftware.com/)
>MySQL support: none
>Synopsis: MyODBC SQLGetTypeInfo() return incorrect data
>Severity: non-critical
>Priority: medium
>Category: myodbc
>Class: sw-bug
>Release: MyODBC-2.50.36
>Environment:
<machine, os, target, libraries (multiple lines)>
System: Linux Penguin 2.2.14-5.0 #1 Tue Mar 7 20:53:41 EST 2000 i586 unknown
Architecture: i586
Some paths: /usr/local/bin/perl /usr/bin/make /usr/bin/gmake
/usr/local/bin/gcc /usr/bin/cc
GCC: Reading specs from
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
Compilation info: CC='gcc' CFLAGS='' CXX='c++' CXXFLAGS='' LDFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 Oct 8 22:41 /lib/libc.so.6 ->
libc-2.1.3.so
-rwxr-xr-x 1 root root 4101324 Feb 29 2000 /lib/libc-2.1.3.so
-rw-r--r-- 1 root root 20272704 Feb 29 2000 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 Feb 29 2000 /usr/lib/libc.so
Configure command: configure --without-server --without-docs --without-bench
Perl: This is perl, version 5.005_03 built for i386-linux
Attachment: [application/zip] info.zip