Harald Fuchs wrote:


<snip>

Even better, in this case you can use BOOL as the column type. Although that's just a synonym of TINYINT, it makes the intended usage clearer.

I suppose, except that mysql (4.0.17, anyway) doesn't remember that you used BOOL.


mysql> CREATE TABLE bt (flag BOOL);
Query OK, 0 rows affected (0.00 sec)

mysql> DESCRIBE bt;
+-------+------------+------+-----+---------+-------+
| Field | Type       | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| flag  | tinyint(1) | YES  |     | NULL    |       |
+-------+------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> SHOW CREATE TABLE bt;
+-------+----------------------------------------------------+
| Table | Create Table                                                       |
+-------+----------------------------------------------------+
| bt    | CREATE TABLE `bt` (
  `flag` tinyint(1) default NULL
) TYPE=MyISAM |
+-------+----------------------------------------------------+
1 row in set (0.00 sec)


Which is probably just as well, I think. Otherwise, you might be surprised to find that 13, for example, is a legal BOOL value.


Michael


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to