Bug #54103 Catalog functions return incorrect data if SYSTEM_CHARSET_MBMAXLEN!=3(4 in C/C)
Submitted: 31 May 2010 12:48 Modified: 31 May 2010 12:51
Reporter: Lawrenty Novitsky Email Updates:
Status: Verified Impact on me:
Category:Connector / ODBC Severity:S2 (Serious)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[31 May 2010 12:48] Lawrenty Novitsky
Octet length and display size may be returned incorrectly in many catalog functions(where/when i_s is not used)
That happens because c/odbc uses SYSTEM_CHARSET_MBMAXLEN macro and utf8 charset in constructed fields, but mbmaxlen for the utf8(33) charset is 3. So SYSTEM_CHARSET_MBMAXLEN defined as 4 in the c/c messes columns octet and character sizes.

How to repeat:
Build using c/c and run my_catalog tests

Suggested fix:
Not to use SYSTEM_CHARSET_MBMAXLEN or its dependents in MYODBC_FIELD_NAME and MYODBC_FIELD_STRING macros, but calculated mbmaxlen for UTF8_CHARSET_NUMBER. In this case if c/odbc need to return data(or maybe more correct to say that if server returns data) using different charset(some 4 byte utf), the only thing needed to be change to take care of that problem in catalog functions would be the charset number.

Or we could fix those macros for the c/c version of headers only.
[1 Jun 2010 8:43] Tonci Grgin
Lawrin, could it be that Bug#54088 is side-effect of this one?
[1 Jun 2010 18:51] Louis Breda van
Tonci, Lawrin,

Lawrin for info I did create bug report #54088 and my first impression is that Tonci could be right in his feeling that the two bugs could be related.

Perhaps (I do not know), it is posible for me to verify if the tow bugs are related. Does one of you perhaps have a sugestion how to test this !?

Please read what I did already test.


[1 Jun 2010 19:39] Lawrenty Novitsky
Tonci, Louis
My opinion they are not related. This bug is caused by change in the client library, and not in the server.