Bug #34272 | SQLColumns from ODBCTE32 returns wrong value for database and several other flds | ||
---|---|---|---|
Submitted: | 4 Feb 2008 12:04 | Modified: | 7 Apr 2010 15:47 |
Reporter: | Tonci Grgin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | OS: | Windows | |
Assigned to: | Lawrenty Novitsky | CPU Architecture: | Any |
[4 Feb 2008 12:04]
Tonci Grgin
[4 Feb 2008 12:04]
Tonci Grgin
DM trace
Attachment: DMtrace.zip (application/x-zip-compressed, text), 3.42 KiB.
[7 Mar 2010 21:26]
Lawrenty Novitsky
Patch for the bug(rev#867)
Attachment: bug34272.patch (text/x-patch), 2.74 KiB.
[23 Mar 2010 21:14]
Jim Winstead
I'm pretty sure it is actually the 5.1+ version of the MYSQL_FIELD_STRING() macro that is wrong, not the values being changed here.
[25 Mar 2010 3:22]
Bogdan Degtyariov
Lawrin, Here is the definition of MYODBC_FIELD_STRING: /* we use 3 here as SYSTEM_CHARSET_MBMAXLEN is not defined in v5.0 mysql_com.h */ # define MYODBC_FIELD_STRING(name, len, flags) \ {(name), (name), NullS, NullS, NullS, NullS, NullS, (len) * 3, 0, 0, 0, 0, \ 0, 0, 0, 0, (flags), 0, UTF8_CHARSET_NUMBER, MYSQL_TYPE_VAR_STRING} As you can see the length is already multiplied by 3: ((len) * 3) Why should it be done outside as MYODBC_FIELD_STRING("TYPE_NAME", 20*SYSTEM_CHARSET_MBMAXLEN, NOT_NULL_FLAG),?
[25 Mar 2010 3:28]
Bogdan Degtyariov
With the above implementation of MYODBC_FIELD_STRING the problem is not longer happening. I think the bug just should be closed.
[25 Mar 2010 18:40]
Jim Winstead
Bogdan, look again. There are three implementations of MYODBC_FIELD_STRING() -- for servers >= 5.1, for servers >= 4.1 and < 5.1, and one for earlier servers. The implementation for servers >= 5.1 is missing the * 3 (or * SYSTEM_CHARSET_MBMAXLEN), which may be a source of problems.
[25 Mar 2010 19:41]
Lawrenty Novitsky
Yes, we discussed that with Bogdan today. Actually in my first try to fix this or other similar bug, I changed MYODBC_FIELD_STRING macro. But in resulted in many test fails. The reason is that NAME_LEN macro used for len parameter of MYODBC_FIELD_STRING in many places does multiplication by SYSTEM_CHARSET_MBMAXLEN. So instead of changing NAME_LEN as well, I added multiplication of problematic parameter values. BUt probably you are right - to change both macros is better idea.