Bug #5208 Insert Into Enum Field Does Not Return Error
Submitted: 25 Aug 2004 17:44 Modified: 25 Aug 2004 18:30
Reporter: Jeffrey Hayes Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:mysql-standard-4.0.20 OS:Linux (linux i686)
Assigned to: CPU Architecture:Any

[25 Aug 2004 17:44] Jeffrey Hayes
Description:
When inserting into an enum table, mysql reports success with no errors.
However, not only did the data not actually insert the table is left null, and
table is labeled non-null. 

I am not sure if this is a bug or feature, however if data is not properly inserted and the table is left inconsistent(non-null field is null), I feel that some kind
of error status should be reported.

How to repeat:
mysql> describe test;
+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| alive | enum('Yes','No') |      |     | Yes     |       |
+-------+------------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> insert into test values('Yes,No');
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+-------+
| alive |
+-------+
|       |
+-------+
1 row in set (0.00 sec)
[25 Aug 2004 18:30] MySQL Verification Team
Hi

Thank you for writting to us, but this is not a bug. This is documented and expected behavior for ENUM data type. Please check the MySQL manual available at:
http://dev.mysql.com/doc/mysql/en/constraint_enum.html
and
http://dev.mysql.com/doc/mysql/en/ENUM.html
[25 Aug 2004 21:10] Jeffrey Hayes
Thanks for the information, guess I should have RTFM. 
I suppose this was a "Feature Request" more than a bug.
As It would be nice to know(via error or warning) if this 
type of "Data Conversion" had occured, but It seems that
it's in the works with MySql 5.