Why historically do people use 255 not 256 for database field magnitudes?

前端 未结 12 732
北荒
北荒 2020-12-07 07:17

You often see database fields set to have a magnitude of 255 characters, what is the traditional / historic reason why? I assume it\'s something to do with paging / memory l

12条回答
  •  伪装坚强ぢ
    2020-12-07 08:20

    255 was the varchar limit in mySQL4 and earlier.

    Also 255 chars + Null terminator = 256

    Or 1 byte length descriptor gives a possible range 0-255 chars

提交回复
热议问题