For MySQL ENUM data-type user is suppose to create table with some
pre-defined values for ENUM.
CREATE TABLE sizes (
name ENUM('small', 'medium', 'large')
MySQL meta-data registers enum values viz. small/medium/large
If user inserts a value which is not found in this cache and MySQL is operating
in non-strict mode, MySQL will handover an empty string to Storage Engine.
But now if user tries to select from this table using "select *", SE will again
handover an empty string as done by MySQL during insert time but this
handing over fails as MySQL refuses to accept this value.
(MySQL tries to verify if value is register value but couldn't find it
as part of its internal list maintained using typelib->type_names)
MyISAM doesn't hit this as MyISAM doesn't feed value using store method from
This looks like a MySQL bugs. For now I can always use '' string during
create DDL but that is kind of more restrictive.
Is there a way to register this automatically within MySQL ?