MySQL always returning BIT values as blank

后端 未结 4 579
耶瑟儿~
耶瑟儿~ 2020-12-09 07:21

From my create table script, I\'ve defined the hasMultipleColors field as a BIT:

hasMultipleColors BIT NOT NULL,

When running an INSERT, th

4条回答
  •  甜味超标
    2020-12-09 08:09

    You need to cast the bit field to an integer.

    mysql> select hasMultipleColors+0 from pumps where id = 1;
    

    This is because of a bug, see: http://bugs.mysql.com/bug.php?id=43670. The status says: Won't fix.

提交回复
热议问题