Bug #51491 | Reverse Engineer SQL Script wizard: Does not recognise BOOLEAN data types | ||
---|---|---|---|
Submitted: | 25 Feb 2010 8:51 | Modified: | 26 Feb 2010 9:22 |
Reporter: | Kai Sautter (Basic Quality Contributor) | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Workbench: Modeling | Severity: | S2 (Serious) |
Version: | 5.2.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[25 Feb 2010 8:51]
Kai Sautter
[26 Feb 2010 6:31]
Susanne Ebrecht
Many thanks for writing a bug report. This is problem is related to an already known server problem. CREATE TABLE t(b1 boolean, b2 bool); SHOW CREATE TABLE t\G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `b1` tinyint(1) DEFAULT NULL, `b2` tinyint(1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.02 sec) Because server already stores bool and boolean as tinyint Workbench is not able to guess if original wanted data type was tinyint or bool or boolean. I will set this bug here as duplicate of bug #8485 because that is the server bug report for getting a real boolean data type.
[26 Feb 2010 9:22]
Kai Sautter
Thank you for pointing me to this parallelism, which I am not going to argue. Nevertheless, it would be helpful, if WB would then reverse engineer BOOL and BOOLEAN field types to TINYINT(1), as the server currently does (but including a comment, that the script indicated a BOOL or BOOLEAN column): mysql> create table testbool (fieldbool BOOL, fieldboolean BOOLEAN); Query OK, 0 rows affected (0.19 sec) mysql> show create table testbool; +----------+-----------------------------------------------------------------+ | Table | Create Table | +----------+-----------------------------------------------------------------+ | testbool | CREATE TABLE `testbool` ( `fieldbool` tinyint(1) default NULL, `fieldboolean` tinyint(1) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +----------+-----------------------------------------------------------------+ 1 row in set (0.00 sec) This would simplify reverse engineering of manually written scripts, as the server will accept BOOLEAN treatment of TINYINT columns when actually using the database.