The MEDIUMINT type has the following characteristics depending on signess:
But these characteristics are not taken into account precisely:
For INT-alike data types, the specified length does not constrain the supported type range. So MEDIUMINT(2) still supports the entire MEDIUMINT range (as mentioned above). But in all cases, the maximum possible length on conversion to string is 8, for both signed and unsigned variants.
The column corresponding to the MEDIUMINT SIGNED erroneously creates a varchar(9) on conversion to string. The expected result is varchar(8).