You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, b column is returned as a byte string instead of unicode, regardless of the fact that FLAG.BINARY is not set. Unicode decoding works fine for FIELD_TYPE.VAR_STRING (253) and FIELD_TYPE.BLOB (252), but it doesn't for FIELD_TYPE.LONG_BLOB (251), which is returned by ExtractValue.
The workaround also shows that current value converter design needs improvement. Unicode decoders are set in connection constructor in contrast to most that are set in MySQLdb.converters. _get_string_decoder is also defined in constructor. So it's impossible to use conv constructor argument to pass extended decoder dict, and the only way is to patch instances individually.
The text was updated successfully, but these errors were encountered:
Here's the code to illustrate the issue (python 2.7, mysql 5.5.32):
As you can see,
b
column is returned as a byte string instead of unicode, regardless of the fact thatFLAG.BINARY
is not set. Unicode decoding works fine forFIELD_TYPE.VAR_STRING
(253) andFIELD_TYPE.BLOB
(252), but it doesn't forFIELD_TYPE.LONG_BLOB
(251), which is returned byExtractValue
.Here's the workaround.
The workaround also shows that current value converter design needs improvement. Unicode decoders are set in connection constructor in contrast to most that are set in
MySQLdb.converters
._get_string_decoder
is also defined in constructor. So it's impossible to useconv
constructor argument to pass extended decoder dict, and the only way is to patch instances individually.The text was updated successfully, but these errors were encountered: