Data with a length greater than the specified varchar (n) appears in the mysql table

Today, the operator reported that there is a data in the backend that cannot be modified. I checked the error for a long time, and finally found that the value of the url field of this data is greater than the varchar (100) I defined. It is very simple to solve the problem. Just change it. But I would like to ask you how did this data come from?

Aug.18,2021

you can take a look at this article Portal


length () and char_length () there is still a difference. I don't know how you calculate the length of url field values. Varchar refers to fields that can be inserted into char_length=100, while length may be more than that, if it contains Chinese characters.

Menu