I'm trying to constrict a column to specific values, with no luck.
Here's what I have been trying:
mysql> CREATE TABLE my_table (
-> name VARCHAR(20),
-> sex CHAR(1) CHECK (sex IN('F','M'))
-> );
Query OK, 0 rows affected (0.18 sec)
mysql> INSERT INTO my_table VALUES
-> ('John','D');
Query OK, 1 row affected (0.07 sec)
mysql> SELECT * FROM my_table;
+------+------+
| name | sex |
+------+------+
| John | D |
+------+------+
1 row in set (0.00 sec)
mysql>
as you can see, the constraint was not enforced...