>>>>> "SM" == Sinisa Milivojevic <sinisa@stripped> writes:
SM> Christian Hammers writes:
>> In fact enum allowes me to insert arbitrary values. Everything that is not
>> member of the enum list becomes "". An I mean really "" and not NULL!
>> Also there is no error!
>>
SM> The above is actually expected behaviour.
SM> If you wanted to get a default value, you should have defined one.
That doesn't solve his problem:
mysql> create table vt (ee enum ('a','b','c') default 'a');
Query OK, 0 rows affected (0.01 sec)
mysql> insert into vt values ('a');
Query OK, 1 row affected (0.02 sec)
mysql> select * from vt;
+------+
| ee |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql> insert into vt values ('q');
Query OK, 1 row affected (0.00 sec)
mysql> select * from vt;
+------+
| ee |
+------+
| a |
| |
+------+
2 rows in set (0.02 sec)
The default value is *not* used when you insert a value that is not
from the enum list, unlike your implication that it would be.
This is on
mysql Ver 11.6 Distrib 3.23.28-gamma, for -freebsd4.2 (i386)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@stripped Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/