Description:
mysql> create table def_enum(c1 enum('a','b','c') NOT NULL, c2 int default 99);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into def_enum(c2)values(1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into def_enum(c1, c2) values(default, 1);
Query OK, 1 row affected (0.00 sec)
OK, OK, it is quite ok right now.
mysql> insert into def_enum(c1, c2) values(default(c1), 1);
ERROR 1364 (HY000): Field 'c1' doesn't have a default value
After consulting with doc of mysql5.7(http://dev.mysql.com/doc/refman/5.7/en/enum.html), we can find that,
"If an ENUM column is declared NOT NULL, its default value is the first element of the list of permitted values."
So, IHMO, insert into def_enum(c1, c2) values(default(c1), 1); should not have been failed.
How to repeat:
create table def_enum(c1 enum('a','b','c') NOT NULL, c2 int default 99);
insert into def_enum(c1, c2) values(default(c1), 1);
Suggested fix:
insert into def_enum(c1, c2) values(default(c1), 1); succeed and row('a', 1) is inserted.