-
Notifications
You must be signed in to change notification settings - Fork 442
Bug _mysql.c - binary flag? #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is not a bug, as comment describes. |
Are you really sure about that? |
You're right. But I don't have failing test case. What type do you use? |
I think it depends on the configuration. I use my own converter callbacks with the option "use_unicode=0"
Hope this information is helpful... |
Uh, that's API I hate.... conv waste my hundreds hours. It's broken design. |
Sorry to hear that. We tend to manage any encoding operations on our own. The conv seems to be a reasonable tool. Of course, we can workaround that with use_unicode, but that doesn't solve the bug. |
If you didn't override these types, this switch statement is not used. |
I was already wondering why no others were affected. Thanks for your attention. |
I just hit this same bug today, and have pull request. |
So if this is broken it becomes really hard to deal with databases that have bad charsets or what have you. The example I have is we have some really old db's where the charset is utf8, but some bad C++ code was committing truncated data to the table, and thus was not possible to decode it, The team fixed the C++, but it might be still possible that some of this data still exists, so they have a converter that opens a task for a human to resolve, but returns the value by doing a decode(utf8, 'ignore') |
Even though this bug is fixed, I won't guarantee the callback is supported in such ways. |
Hi,
Thanks for your effort providing us this driver.
However, I think there is a bug in _mysql.c. In the function "_mysql_field_to_python" there is a switch statement. In this statement the binary flag is always overwritten by the default block.
As a consequence I'm getting trouble processing binary data because the binary data is treated as text leading into conversion trouble.
I wanted to let you know about the problem, because you might want to check.
Thanks and regards!
The text was updated successfully, but these errors were encountered: