Fixed bug #29251.
Sometimes special 0 ENUM values was ALTERed to normal empty string ENUM values. Special 0 ENUM value has the same string representation as normal ENUM value defined as '' (empty string). The do_field_string function was used to convert ENUM data at an ALTER TABLE request, but this function doesn't care about numerical "indices" of ENUM values, i.e. do_field_string doesn't distinguish a special 0 value from an empty string value. A new copy function called do_field_enum has been added to copy special 0 ENUM values without conversion to an empty string. sql/field_conv.cc: Fixed bug #29251. The Copy_field::get_copy_func method has been modified to return a pointer to the do_field_enum function if a conversion between two columns of incompatible enum types is required. The do_field_enum function has been added for the correct conversion of special 0 enum values. mysql-test/t/type_enum.test: Updated test case for bug #29251. mysql-test/r/type_enum.result: Updated test case for bug #29251.
Showing
Please register or sign in to comment