This issue has been raised as far back as two years ago[1] before, but
has been consistently closed with invalid information.

#3903[2] contains this comment:

> This is intentional. MySQL does not support boolean field types (up until 
> BIT),
> so Cake uses tinyint(1) to "fake" boolean field support.

However it is slightly incorrect; MySQL has had a BIT type since even
before 4.1[4], and while MySQL does treat BIT as a TINYINT(1) until
5.0.3, that is not true in the reverse; nothing in MySQL has ever
treated TINYINT(1) as how CakePHP currently treats it. Using BIT
instead of TINYINT(1) would result in the forced conversion to 0 or 1
making far more sense, as even though MySQL converts a BIT to
TINYINT(1) in older versions, the intent there is clear - not so with
a true TINYINT(1).

#4026[3] states that conventions turn a TINYINT(1) into a boolean, but
I would argue that it's a convention which should be changed -
booleans should be stored in a BIT column, and TINYINT(1) should not
be handled as a boolean/BIT, since it is not treated as such
elsewhere.

[1] https://trac.cakephp.org/ticket/1253
[2] https://trac.cakephp.org/ticket/3903
[3] https://trac.cakephp.org/ticket/4026
[4] http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html#id4426984

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to