Bug #89900 | BOOLEAN Datatype automatically switches to TINYINT Alter Table | ||
---|---|---|---|
Submitted: | 4 Mar 2018 23:21 | Modified: | 5 Mar 2018 5:42 |
Reporter: | Hunter Smith | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Workbench | Severity: | S2 (Serious) |
Version: | 6.3.10 | OS: | MacOS (macOS 10.13.x High Sierra x86_64) |
Assigned to: | CPU Architecture: | Any | |
Tags: | WBBugReporter |
[4 Mar 2018 23:21]
Hunter Smith
[5 Mar 2018 5:42]
MySQL Verification Team
Hello Hunter Smith, Thank you for the report. Imho, this is not an WB issue but expected behavior i.e there is no built-in Boolean type and data type mapping occurs at table creation time, after which the original type specifications are discarded. If you create a table with types used by other vendors and then issue a DESCRIBE tbl_name statement, MySQL reports the table structure using the equivalent MySQL types - https://dev.mysql.com/doc/refman/5.7/en/other-vendor-data-types.html Also, quoting from documentation - "BOOL, BOOLEAN These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true" Please refer - https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html -- 5.7.21 mysql> drop table tasks; Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE tasks ( -> id INT PRIMARY KEY AUTO_INCREMENT, -> title VARCHAR(255) NOT NULL, -> completed BOOLEAN -> ); Query OK, 0 rows affected (0.01 sec) mysql> show create table tasks\G *************************** 1. row *************************** Table: tasks Create Table: CREATE TABLE `tasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `completed` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) Thanks, Umesh
[5 Mar 2018 5:44]
MySQL Verification Team
See Bug #66201