Supported corwersions. Supported conversions between different but similar data types are
shown in the following list:
• Between any of the integer types TINYINT, SMALLINT, MEDIUMINT, INT, and BIGINT.
This includes conversions between the signed and unsigned versions of these types. Lossy conversions are madę by truncating the source value to the maximum (or minimum) permitted
by the target column. For insuring non-lossy conversions when going from unsigned to signed types,
the target column must be large enough to accommodate the rangę of values in the source column.
For example, you can demote TINYINT UNSIGNED non-lossily to SMALLINT, but not to TINYINT.
• Between any of the decimal types DECIMAL, FLOAT, DOUBLE, and NUMERIC.
FLOAT to DOUBLE is a non-lossy conversion; DOUBLE to FLOAT can only be handled lossily. A
conversion from DEC IMAŁ {M,D) to DECIMAL [M' ,D') where M' =>M andD'
=>D is non-lossy;
for any case where M' <M,D' <D, or both, only a lossy conversion can be madę.
For any of the decimal types, if a value to be stored cannot be fit in the target type, the value
is rounded down according to the rounding rules defined for the server elsewhere in the
documentation. See Section 12.19.4, “Rounding Behavior", for information about how this is done for decimal types.
• Between any of the string types CHAR, VARCHAR, and TEXT, including conversions between different
widths.
Conversion of a CHAR, VARCHAR, or TEXT to a CHAR, VARCHAR, or TEXT column the same size or
larger is never lossy. Lossy conversion is handled by inserting only the first N characters of the string
on the slave, where N is the width of the target column.