Bug #110968 | Table rewrite happens when increasing a varchar length past 63 | ||
---|---|---|---|
Submitted: | 9 May 2023 16:58 | Modified: | 10 May 2023 12:24 |
Reporter: | James ODonnell | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 8.0.32 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[9 May 2023 16:58]
James ODonnell
[10 May 2023 12:24]
MySQL Verification Team
Hi Mr. ODonell, Thank you very much for your bug report. However, this is documented. We suppose you used InnoDB storage engine. The problem is in the magical number of 255. With a default character set, VARCHAR(64) is larger then 255 bytes. Hence, for 256 until 65535 bytes of length, you require two bytes for the actual length of the string. Hence , that is why a rebuild is necessary. To add one more byte for the actual length of the variable-length strings. Not a bug.
[11 May 2023 12:23]
MySQL Verification Team
Hi, It is actually explained in our Manual: https://dev.mysql.com/doc/refman/8.0/en/char.html in the first 4-5 paragraphs.