• Luis Soares's avatar
    Fix for BUG#51716 and BUG#51787. · 2c368f05
    Luis Soares authored
    In BUG#51787 we were using the wrong charset to print out the
    data. We were using the field charset for the string that would
    hold the information. This caused the assertion, because the
    string length was not aligned with UTF32 bytes requirements for
    storage.
    
    We fix this by using &my_charset_latin1 in the string object
    instead of the field->charset(). As a side-effect, we needed to
    extend the show_sql_type interface so that it took the field
    charset is now passed as a parameter, so that one is able to
    calculate the correct field size.
    
    In BUG#51716 we had issues with Field_string::pack and
    Field_string::unpack. When packing, the length was incorrectly
    calculated. When unpacking, the padding the string would be
    padded with the wrong bytes (a few bytes less than it should).
    
    We fix this by resorting to charset abstractions (functions) that
    calculate the correct length when packing and pad correctly the
    string when unpacking.
    2c368f05
field.cc 282 KB