Bug #94298 Workbench generating incorrect SQL after copying row with bit(1) column
Submitted: 12 Feb 2019 19:09 Modified: 12 Feb 2019 20:14
Reporter: James Asher Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[12 Feb 2019 19:09] James Asher
Description:
Copying and pasting a row from Result Set grid with Bit(1) column incorrectly applies 'b' on every column after the bit column when generating the insert statement after pressing Apply.

How to repeat:
Example table creation: 
CREATE TABLE `test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `col1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `col2` bit(1) DEFAULT NULL,
  `col3` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Add a row:
INSERT INTO `test`
(`id`, `col1`, `col2`, `col3`)
VALUES
(null, 'abc', b'1', 'def');

Copy row and paste it to insert new row. Delete the copied id column value. Press Apply. Workbench generates this SQL:
INSERT INTO `test` (`id`, `col1`, `col2`, `col3`) VALUES (NULL, 'abc', b'1', b'def');

The "b'def'" is wrong.

Suggested fix:
Don't apply the bit flag to every other column after the initial bit column
[12 Feb 2019 20:14] MySQL Verification Team
Thank you for the bug report. Duplicate of: https://bugs.mysql.com/bug.php?id=93060.