Selecting BIT(1) or BIT(N) fields from a table yields back a value that can not by printed, it's just a RAW 0 byte buffer, impossible to read.
I tried to select CAST( fieldname as char) but that does not return anything meaningful, neither in my code or in mysql shell:
mysql> SELECT name, owner, species, sex, CAST(birth as char) as casted_birth, CAST(bit as char), CAST(nibble as char) FROM pet;
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| name | owner | species | sex | casted_birth | CAST(bit as char) | CAST(nibble as char) |
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| Puffball | Diane | hamster | f | 1999-03-30 00:00:00 | |
|
+----------+-------+---------+------+---------------------+-------------------+----------------------+
1 row in set (0.00 sec)
mysql>
How does one use mysql c++connector to interpret BIT(N) values, please?
I tried to select CAST( fieldname as char) but that does not return anything meaningful, neither in my code or in mysql shell:
mysql> SELECT name, owner, species, sex, CAST(birth as char) as casted_birth, CAST(bit as char), CAST(nibble as char) FROM pet;
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| name | owner | species | sex | casted_birth | CAST(bit as char) | CAST(nibble as char) |
+----------+-------+---------+------+---------------------+-------------------+----------------------+
| Puffball | Diane | hamster | f | 1999-03-30 00:00:00 | |
|
+----------+-------+---------+------+---------------------+-------------------+----------------------+
1 row in set (0.00 sec)
mysql>
How does one use mysql c++connector to interpret BIT(N) values, please?