Bottom line: MySQL's BOOLEAN is a synonym for TINYINT. If you want to
argue that this convention should be changed you should bring it up
with them. It's much better for Cake core to go along with MySQL on
this, given the the install-base.

There are few simple solutions to this. Note that Postgres (my
favourite) has a BOOLEAN type, yet it returns the chars "t" or "f"
which is kind of sucky, itself.

On Fri, Mar 7, 2008 at 10:57 PM, Collin Grady <[EMAIL PROTECTED]> wrote:
>
>  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