This very helpful article explains some oddities about how MySQL Enums behave: http://melp.nl/2009/05/mysql-enums-and-booleans/

There is no discussiong about why that behaviour exists. Furthermore, in googling the subject I find only contradictory information and speculation, by 'bloggers' and other blind leading the blind.

Can someone please describe why MySQL Enums suffer from the behaviour outlined in the post. Here is one example of Enum oddities presented in the post, but there are many more:

mysql> insert into t values('1'),('0');
mysql> select b,b=1,b=0 from t;
+---+-----+-----+
| b | b=1 | b=0 |
+---+-----+-----+
| 1 |   0 |   0 |
| 0 |   1 |   0 |
+---+-----+-----+
2 rows in set (0.00 sec)

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top