>>>>> "Russ" == Russ Southern <russ@stripped> writes:
Russ> According to the manual:
Russ> If you insert an invalid value into an ENUM (that is, a string not
Russ> present in the list of allowed values), the empty string is
Russ> inserted instead as a special error value. If an ENUM is declared
Russ> NULL, NULL is also a legal value for the column, and the default
Russ> value is NULL. If an ENUM is declared NOT NULL, the default
Russ> value is the first element of the list of allowed values.
Russ> I want to make the empty string ('') the default value.
Russ> Yes, I could add it to the list of valid values, but I want the empty
Russ> string to have index=0.
Russ> I am running servers 3.22.20a and 3.22.25. One is under my control and
Russ> the other is under my advisability. It looks like this is not a
Russ> version-specific issue, however.
Russ> Any ideas?
Monty> Sorry; The only way to fix this is to extend the MySQL syntax with
Monty> something like:
Monty> create table t1 (a enum ('a','b','c') default ERROR);
Monty> (One can't use '' in the above syntax as '' may be a allowed value)
Russ> So, could it work without modifying the syntax by allowing the default to
Russ> be indicated by the index? Like:
Russ> create table t1 (a enum ('a','b','c') default 1);
Russ> Therefore, default 0 would work as well?
This is a good idea; I shall look into this!
Russ> Many kudos to you and your development team. Hope your vacation was relaxing
Russ> and enjoyable.
Yes, it was!