Cannot see bit (1) of fields in mysql

I have a Java application and mapped a boolean field to a bit (1) field in MySql.

I know for sure that some lines have a value equal to true and some have a false value, however I do not see it in the mysql console - which is annoying when you try to debug things and understand what is going on.

Is it possible to configure mysql to display bit (1) fields in a friendly way?

mysql> select ignored from table;
+ --------- +
| ignored |
+ --------- +
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+ --------- +
10 rows in set (0.00 sec)
+3
source share
2 answers
select ignored+0 from table;
+5
source
select cast(ignored as unsigned) from table;
+1
source

Source: https://habr.com/ru/post/1719271/


All Articles