Hi, Peter!
On May 22, Peter Gulutzan wrote:
> Sergei Golubchik wrote:
> >
> > What about instead of trying to follow exactly what manual says, we
> > instead fix ENUM to be more like other types (and change the manual,
> > of course) ?
>
> Do you mean:
> If column_name is defined with ENUM and NOT NULL,
> and without a DEFAULT clause, then the default is
> no longer the first enumeration value?
In the strict mode - yes, an error. In the non-strict - a warning "no
default" and the first enumeration value is used as a default. For
example:
mysql> create table tt1 (a int not null, b enum('a','b') not null);
Query OK, 0 rows affected (0.04 sec)
mysql> insert tt1 values ();
Query OK, 1 row affected, 1 warning (0.00 sec)
Warning (Code 1364): Field 'a' doesn't have a default value
This shows that ENUM behaves differently from INT.
> Sure. But it's a change in documented user-visible
> behaviour, so it's supposed to have a worklog.
What do you mean by "sure" ? "sure it's possible" ? Or "sure, I prefer
it to be done instead of what I suggested earlier (taking into account
the 'but')" ?
I know that it's possible, it wasn't what I asked. I asked whether you
would prefer the "special" (different from other types) behavior of ENUM
to be removed instead of fixing the code to follow the manual ?
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring