PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
ENUM andSET columns provide an efficient way to define columns that can contain only a given set of values. SeeSection 13.3.6, “The ENUM Type”, andSection 13.3.7, “The SET Type”.
Unless strict mode is disabled (not recommended, but seeSection 7.1.11, “Server SQL Modes”), the definition of aENUM orSET column acts as a constraint on values entered into the column. An error occurs for values that do not satisfy these conditions:
An
ENUMvalue must be one of those listed in the column definition, or the internal numeric equivalent thereof. The value cannot be the error value (that is, 0 or the empty string). For a column defined asENUM('a','b','c'), values such as'','d', or'ax'are invalid and are rejected.A
SETvalue must be the empty string or a value consisting only of the values listed in the column definition separated by commas. For a column defined asSET('a','b','c'), values such as'd'or'a,b,c,d'are invalid and are rejected.
Errors for invalid values can be suppressed in strict mode if you useINSERT IGNORE orUPDATE IGNORE. In this case, a warning is generated rather than an error. ForENUM, the value is inserted as the error member (0). ForSET, the value is inserted as given except that any invalid substrings are deleted. For example,'a,x,b,y' results in a value of'a,b'.
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb