List:General Discussion« Previous MessageNext Message »
From:Hartmut Holzgraefe Date:May 22 2013 10:14pm
Subject:Re: Version 5.6.2-m5 Boolean Datatype
View as plain text  
On 05/22/2013 06:55 PM, Neil Tompkins 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.

BOOLEAN has been a simple alias for TINYINT in MySQL ever since,
for a more "true boolean" you may want to try BIT(1)

   http://dev.mysql.com/doc/refman/5.6/en/bit-type.html

The BIT type was introduced in 5.6.

For example:

   create table b1 (id int primary key, b bit(1));
   insert into b1 values(1, true);
   insert into b1 values(2, false);
   select * from b1 WHERE b = true;

   ==>

   +----+------+
   | id | b    |
   +----+------+
   |  1 | [00 01]    |
   +----+------+
   1 row in set (0.00 sec)

Note that the BIT column value is actually returned as a
VARBINARY string though ...

-- 
hartmut

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