Bug #92548 Cannot Reverse Engineer When Table Comment Contains Single Quote
Submitted: 24 Sep 2018 18:26 Modified: 25 Sep 2018 11:01
Reporter: Matthew Roberts Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.12 OS:Microsoft Windows (Microsoft Windows 8.1 Enterprise)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[24 Sep 2018 18:26] Matthew Roberts
Description:
Receive error when trying to reverse engineer a table that contains a TABLE comment that contains a single quote:

ERROR: (102, 92) Extraneous input 's clock is set to.' found, expecting: EOF, ';'

As a minor, entering in a field comment will cause the comment to be overly escaped when the table is then altered. (i.e. "The timezone the data source''s clock is set to.")

How to repeat:
CREATE TABLE `TimeZone` (
 `TimeZoneID` TINYINT     UNSIGNED             NOT NULL AUTO_INCREMENT,
 `TimeZone`   VARCHAR(29) CHARACTER SET LATIN1 NOT NULL,
  UNIQUE INDEX `TimeZone_TimeZone` (`TimeZone`),
 PRIMARY KEY (`TimeZoneID`)
) COMMENT = 'The timezone the data source\'s clock is set to.';

Then select Database->Reverse Engineer. Select the table and continue. Error will occur.

If the user was to enter this as a field comment when going to alter the table again duplicate quotes will be visible and making a minor change (removing a full stop) will cause the comment to have a further quote (3 quotes).

Suggested fix:
Escape the single quote.
[24 Sep 2018 19:22] Miguel Solorzano
Thank you for the bug report.
[25 Sep 2018 10:04] Mike Lischke
Duplicate of Bug #92191
[25 Sep 2018 11:01] Matthew Roberts
Referenced duplicate is explicitly for ALTER TABLE, this is for Reverse Engineer Errors.. can you please confirm both are fixed :)?