Forum Moderators: coopster
If I create a column 'product' of type char(4), why does MySQL allow me to do the following:
Insert into tableName (product)
values ('abcdefg');
Then when I look at the results, the data has been truncated to abcd. Am I missing something? It seems like MySQL should tell me that I cannot insert that data because it is beyond the scope of the product columns data type.
Thanks.
If you assign a value to a
CHARor
VARCHARcolumn that exceeds the column's maximum length, the value is truncated to fit.
[dev.mysql.com...]