在我的创建表脚本中,我将 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)
有什么想法吗?