Description:
Unable to right click a table and select "Alter Table..." if table contains a TABLE comment containing a single quote.
Error is raised:
[Window Title]
MySQL Workbench
[Main Instruction]
Error Parsing DDL for `SIEM Data Sources`.`TimeZone`
[Content]
There was an error while parsing the DDL retrieved from the server.
Do you want to view the DDL or cancel processing it?
[View DDL] [Cancel]
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 right click table and select "Alter Table..." error will occur.
Suggested fix:
Handle escaped table and don't error :)
FYI:
mysql> SHOW CREATE TABLE TimeZone;
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table
|
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| TimeZone | CREATE TABLE `TimeZone` (
`TimeZoneID` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`TimeZone` varchar(29) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`TimeZoneID`),
UNIQUE KEY `TimeZone_TimeZone` (`TimeZone`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='The timezone the data source''s clock is set to.' |
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>