Certainly a noobish question, but I got to ask: 🙂 Assuming a column of type varchar and length 255 and the longest string stored in a row at this column shold have length 200. What happens, if I altered the columns length to less then 200? Would the strings all get “cut”?
Share
By default, it will allow you to alter the column, it will truncate strings longer than the new length, and it will generate a warning.
If you have the SQL mode
STRICT_ALL_TABLESorSTRICT_TRANS_TABLESset, the warning becomes an error and the ALTER will fail.