从我的创建表脚本,我已经将hasMultipleColors字段定义为BIT:
hasMultipleColors BIT NOT NULL,
运行INSERT时,不会为此或其他BIT字段抛出警告,但是选择行会显示所有BIT值都为空。
手动尝试从命令行更新这些记录给出奇怪的效果 – 显示记录匹配和更改(如果适用),但仍始终显示为空白。
服务器版本:5.5.24-0ubuntu0.12.04.1(Ubuntu)
mysql> update pumps set hasMultipleColors = 1 where id = 1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> select hasMultipleColors from pumps where id = 1;
+-------------------+
| hasMultipleColors |
+-------------------+
| |
+-------------------+
1 row in set (0.00 sec)
mysql> update pumps set hasMultipleColors = b'0' where id = 1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select hasMultipleColors from pumps where id = 1;
+-------------------+
| hasMultipleColors |
+-------------------+
| |
+-------------------+
1 row in set (0.00 sec)
有什么想法吗?