Searched the docs, but to no avail.
What is the maximum length for an enumeration value, i.e. the string literal?
Searched the docs , but to no avail. What is the maximum length for
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The limit isn’t on the length of the literal string, but rather on the table definition.
The MySQL documentation states that
which is then followed by an ad-hoc equation expressing the approximate size of a table definition.
For a simple test, in a table with a couple fields already, I got my enum up to 63136 characters long, and the .frm was 71775 bytes big (slightly larger than 70KB), so the limit is approximate. At that point, MySQL complained
#1117 - Too many columns, which is misleading to say the least.Interestingly/oddly/worthwhile to note, the character set of the enum will change the maximum length. — even if you’re using normal characters which should only require 1 byte each.