MySQL Reference Manual for version 4.0.18.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.8.6.3 Constraint ENUM and SET

In MySQL 4.x, ENUM is not a real constraint, but is a more efficient way to define columns that can only contain a given set of values. This is because of the same reasons NOT NULL is not honored. See section 1.8.6.2 Constraint NOT NULL and DEFAULT values.

If you insert an incorrect value into an ENUM column, it will be set to the reserved enumeration value 0, which will be displayed as an empty string in string context. See section 11.3.3 The ENUM Type.

If you insert an incorrect value into a SET column, the incorrect value is ignored. For example, if the column can contain the values 'a', 'b', and 'c', an attempt to assign 'a,x,b,y' results in a value of 'a,b'. See section 11.3.4 The SET Type.



This document was generated by rdg (Feb 25 2004) using texi2html