ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(255);
This is true as long as the number of length bytes required by a
VARCHAR column remains the same.
VARCHAR values of 0 to
255, one length byte is required to encode the value. For
VARCHAR values of 256 bytes or
more, two length bytes are required. As a result, in-place
ALTER TABLE only supports
VARCHAR size from 0 to
255 bytes or increasing
size from a value equal to or greater than 256 bytes.
ALTER TABLE does not support
VARCHAR size from less
than 256 bytes to a value equal to or greater than 256 bytes. In
this case, the number of required length bytes would change from 1
to 2, which is only supported by a table copy
ALGORITHM=COPY). For example, attempting to
VARCHAR column size from 255
to 256 using in-place
would return an error:
ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(256); ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY.