Menu

#51 MySQL/MariaDB: Treat TINYINT(1) as Boolean instead of BIT(1)

open
nobody
None
2024-08-08
2024-08-08
No

In Zeos 8.0 Zeos creates a Booelan field for fields of type BIT(1). abonic suggests to treat TINYINT(1) fields as boolean because newer versions of MariaDB create a field of that type when instructed to create a boolean field.
See https://zeoslib.sourceforge.io/viewtopic.php?t=212304:

When using the Boolean type in the sql create table statement, MariaDb (and I assume MySql) will produce a TINYINT(1) type. ZEOS has a MySQL_FieldType_Bit_1_IsBoolean option that allows BIT(1) to be mapped to a TZBooleanField, but nothing similar for TINYINT(1), which would be more useful these days.

We could decide to treat both field types (TINYINT(1) and BIT(1)) as boolean? Opinions? Note: Adding this by default would be a breaking change.

Discussion


Log in to post a comment.