无法在MariaDB中显示位域类型的值

时间:2019-04-23 14:28:08

标签: mysql mariadb

我正在使用MariaDB 10.1.37。我有一个Test表,其中包含一个名为delete的字段,其类型为bit

+---------+------------------+------+-----+---------+----------------+
| Field   | Type             | Null | Key | Default | Extra          |
+---------+------------------+------+-----+---------+----------------+
| id      | int(11) unsigned | NO   | PRI | NULL    | auto_increment |
| user_id | int(11) unsigned | NO   | MUL | NULL    |                |
| email   | varchar(255)     | NO   |     |         |                |
| delete  | bit(1)           | NO   |     | b'0'    |                |
+---------+------------------+------+-----+---------+----------------+

根据https://mariadb.com/kb/en/library/bit/,delete + 0应该显示值。但事实并非如此。

select delete+0 from Test;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'delete+0 from blacklist' at line 1```

如果有人能告诉我如何显示位字段类型,将不胜感激。

0 个答案:

没有答案