List:General Discussion« Previous MessageNext Message »
From:Rick James Date:May 22 2013 9:17pm
Subject:RE: Version 5.6.2-m5 Boolean Datatype
View as plain text  
In query syntax, TRUE is the same as 1; FALSE is the same as 0.

A minor syntax note:  ENUM('FALSE', 'TRUE') would require quotes when using it.

If you have multiple 'flags', consider the SET datatype.  (Yeah, it is somewhat clumsy.)

If you have installed 5.6, simply try BOOL or BOOLEAN.  I suspect (without proof) that it works the same as it has for more than a decade.


> -----Original Message-----
> From: Wm Mussatto [mailto:mussatto@csz.com]
> Sent: Wednesday, May 22, 2013 1:57 PM
> To: mysql@stripped
> Subject: Re: Version 5.6.2-m5 Boolean Datatype
> 
> Why not use ENUM with True|False or Y|N  Only issue is it doesn't throw
> and error of you enter an illegal value but I don't think I've ever
> flagged the field as NOT NULL.
> On Wed, May 22, 2013 11:32, Darryle Steplight wrote:
> > Hey Neil,
> >  Why not just store it as a TINYINT, that's what I do when I only
> care
> > about 0 or 1 values?
> >
> >
> > On Wed, May 22, 2013 at 2:19 PM, Neil Tompkins
> > <neil.tompkins@googlemail.com
> >> wrote:
> >
> >> Hi Shawn
> >>
> >> I plan in installing the latest MySQL version tomorrow.   Does MySQL
> not
> >> support Bool eg true and false
> >>
> >> Neil
> >>
> >> On 22 May 2013, at 19:05, shawn green <shawn.l.green@stripped>
> wrote:
> >>
> >> > Hello Neil,
> >> >
> >> > On 5/22/2013 1:05 PM, Neil Tompkins wrote:
> >> >> Hi, Like the link states
> >> >>
> >> >> "For clarity: a TINYINT(1) datatype does NOT ENFORCE a boolean
> >> >> value
> >> data
> >> >> entry. For instance, it's still possible to insert a value of "2"
> >> (any
> >> >> integer up to the TINYINT max value). I personally don't see the
> >> added
> >> >> value of a 'BOOLEAN' synonym type which infact behaves unlike a
> >> boolean
> >> >> should."
> >> >>
> >> >> Has BOOL, BOOLEAN been taken out of MySQL 5.6 ?
> >> >>
> >> >>
> >> >> On Wed, May 22, 2013 at 6:01 PM, Ian Simpson
> >> >> <ian@stripped
> >> >wrote:
> >> >>
> >> >>> BOOLEAN is a synonym for TINYINT(1) in MySQL:
> >> >>>
> >> >>> http://dev.mysql.com/doc/refman/5.6/en/numeric-type-
> overview.html
> >> >>>
> >> >>>
> >> >>> On 22 May 2013 17:55, Neil Tompkins
> >> >>> <neil.tompkins@stripped>
> >> wrote:
> >> >>>
> >> >>>> Hi,
> >> >>>>
> >> >>>> I've just created some tables that I designed using the MySQL
> >> Workbench
> >> >>>> Model.  However, the database type BOOLEAN which was in my
> >> >>>> models
> >> has
> >> been
> >> >>>> converted to TINYINT(1);  I'm currently running MySQL Version
> >> 5.6.2-m5 on
> >> >>>> Windows 2008 server.
> >> >>>>
> >> >>>> Any ideas why this has been removed ?
> >> >>>>
> >> >
> >> > This is exactly the same behavior that MySQL has had for over a
> >> decade.
> >> Nothing has been added or removed since release 4.1.0 (2003-04-03)
> >> > http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html
> >> > http://dev.mysql.com/doc/refman/4.1/en/news-4-1-x.html
> >> >
> >> > Also, why are you using a pre-release (milestone) version of 5.6
> >> > when
> >> the full release (GA) versions of 5.6 are available?
> >> > http://dev.mysql.com/doc/relnotes/mysql/5.6/en/
> >> >
> >> > Regards,
> >> > --
> >> > Shawn Green
> 
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql

Thread
Version 5.6.2-m5 Boolean DatatypeNeil Tompkins22 May
  • Re: Version 5.6.2-m5 Boolean DatatypeHartmut Holzgraefe22 May
Re: Version 5.6.2-m5 Boolean DatatypeNeil Tompkins22 May
  • Re: Version 5.6.2-m5 Boolean Datatypeshawn green22 May
    • Re: Version 5.6.2-m5 Boolean DatatypeNeil Tompkins22 May
      • Re: Version 5.6.2-m5 Boolean DatatypeDarryle Steplight22 May
Re: Version 5.6.2-m5 Boolean DatatypeWm Mussatto22 May
  • RE: Version 5.6.2-m5 Boolean DatatypeRick James22 May
    • RE: Version 5.6.2-m5 Boolean Datatypehsv23 May