Bug #95592 Malformed Comment Syntax breaks Synchronize Model
Submitted: 1 Jun 2019 20:34 Modified: 6 Jun 2019 5:50
Reporter: Joseph Gold Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:8.0.16 OS:Any
Assigned to: CPU Architecture:Any

[1 Jun 2019 20:34] Joseph Gold
Description:
When running Synchronize Model, a table that needs to update its comment and a row or index will have a malformed ALTER TABLE statement. This causes the synchronization to fail.

Example

ALTER TABLE `WTP_Dev`.`repQuestion_support` 
CHANGE COLUMN `points` `points` INT(10) UNSIGNED NOT NULL COMMENT 'Number of points the user contributed to the question\n' ,
DROP INDEX `ind__id_question` ,
ADD INDEX `ind__id_question` (`id_question` DESC);
, COMMENT = 'TYPE:	TRANSACTIONAL\nDESC:	Record of user points contributed to repQuestions.' ;

It should be:

ALTER TABLE `WTP_Dev`.`repQuestion_support` 
COMMENT = 'TYPE:	TRANSACTIONAL\nDESC:	Record of user points contributed to repQuestions.',
CHANGE COLUMN `points` `points` INT(10) UNSIGNED NOT NULL COMMENT 'Number of points the user contributed to the question\n' ,
DROP INDEX `ind__id_question` ,
ADD INDEX `ind__id_question` (`id_question` DESC);

How to repeat:
Change a table's row or index, and comment, then run Synchronize Model.

Suggested fix:
Move the COMMENT part of the query before other operations.
[6 Jun 2019 5:50] MySQL Verification Team
Hello Joseph Gold,

Thank you for the report.
Verified as described on Win10.

regards,
Umesh