Showing entries 1 to 2
Displaying posts with tag: bool (reset)
How to Map MySQL’s TINYINT(1) to Boolean in jOOQ

MySQL 8 does not yet support the BOOLEAN type as specified in the SQL standard. There is a DDL “type” called BOOL, which is just an alias for TINYINT:

create table t(b bool);

from information_schema.columns
where table_name = 't';

The above produces:

t         |b          |tinyint  |tinyint(1) |

Notice that BOOL translates to a specific “type” of TINYINT, a TINYINT(1), where we might be inclined to believe that the (1) corresponds to some sort of precision, as with …

[Read more]
Are bools bools in MySQL?

Are bools bools in MySQL - no they're not! Lets show this:

mysql> CREATE TABLE healthcheck ( isworking bool ) ENGINE=MEMORY;Query OK, 0 rows affected (0.14 sec)

mysql> show create table healthcheck\G

*************************** 1. row ***************************

Table: healthcheck

Create Table: CREATE TABLE `healthcheck` (

`isworking` tinyint(1) DEFAULT NULL


1 row in set (0.00 sec)

So a 'bool' in MySQL is actually a signed tinyint that has range -128 to 127. This information is actually hidden away in the bowels of the MySQL documentation at:"[bool] These types are synonyms for TINYINT(1). A value …

[Read more]
Showing entries 1 to 2