Bug #83099 Editing "bit" column in MySql Workbench 6.3.7 Result Grid produces invalid SQL
Submitted: 22 Sep 2016 14:26 Modified: 22 Sep 2016 16:48
Reporter: Michael Hogue Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:Version 6.3.7 build 1199 CE (64 bits) OS:Windows (Windows 7)
Assigned to: CPU Architecture:Any

[22 Sep 2016 14:26] Michael Hogue
Description:
When executing a SQL statement that selects rows from a table which contains a column with type "bit", then editing the results in the result grid (either an insert or an update), workbench produces a sql statement that is rejected by the database.

Have tried both "true" and "1" as the value. In prior versions of workbench, "1" and "0" both worked for bit columns. In this version, it is placing the 1 into a string literal... as in 

SET `bit_column`='0' instead of SET `bit_column`=0

How to repeat:
create table test_changing_bit_column
(
	pk int auto_increment not null primary key,
	is_happy bit not null
) engine=InnoDb;

select * from test_changing_bit_column;

In the "Result Grid" attempt to insert a row and type the value "1" into the is_happy field.

An error is received:

Operation failed: There was an error while applying the SQL script to the database.
Executing:
INSERT INTO `[dbnamehere]`.`test_changing_bit_column` (`is_happy`) VALUES ('1');

ERROR 1406: 1406: Data too long for column 'is_happy' at row 1
SQL Statement:
INSERT INTO `[dbnamehere]`.`test_changing_bit_column` (`is_happy`) VALUES ('1')
[22 Sep 2016 16:48] MySQL Verification Team
Thank you for the bug report. Duplicate of http://bugs.mysql.com/bug.php?id=79604.