• Mats Kindahl's avatar
    Bug #52131: SET and ENUM stored endian-dependent in binary log · 9d249079
    Mats Kindahl authored
    Replication SET and ENUM fields from a big-endian to a little-
    endian machine (or the opposite) that are represented using
    more than 1 byte (SET fields with more than 8 members or ENUM
    fields with more than 256 constants) will fail to replicate
    correctly when using row-based replication.
    
    The reason is that there are no pack() or unpack() functions
    for Field_set or Field_enum, which make them rely on Field::pack
    and Field::unpack. These functions pack data as strings, but
    since Field_set and Field_enum use integral types for
    representation, the fields are stored incorrectly on big-endian
    machines.
    
    This patch adds Field_enum::pack and Field_enum::unpack
    functions that store the integral value correctly in the binary
    log even on big-endian machines. Since Field_set inherits from
    Field_enum, it will use the same functions for packing and
    unpacking the field.
    9d249079
field.cc 284 KB