HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

MySQL adds broken comment script after each line

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
commentscriptaftereachlinebrokenmysqladds

Problem

Every time I try to create a table using MySQL Workbench 6.3 CE it adds "broken" comments at the end of the script.

Example:

I am trying to create a table called "user". This is what the table should look like:

However when I click the apply button, the script generates incorrectly:

CREATE TABLE `user` (
  `userid` INT NOT NULL AUTO_INCREMENT COMMENT '',
  `record_status` INT NOT NULL DEFAULT 1 COMMENT '',
  `createdby` VARCHAR(75) NOT NULL COMMENT '',
  `createddate` DATETIME NOT NULL COMMENT '',
  `updatedby` VARCHAR(75) NULL COMMENT '',
  `updateddate` DATETIME NULL COMMENT '',
  `username` INT NOT NULL COMMENT '',
  `password` VARCHAR(75) NULL COMMENT '',
  `firstname` VARCHAR(75) NULL COMMENT '',
  `lastname` VARCHAR(75) NULL COMMENT '',
  `email` VARCHAR(75) NULL COMMENT '',
  `facebook_userid` VARCHAR(75) NULL COMMENT '',
  `email_verified` VARCHAR(75) NULL COMMENT '',
  PRIMARY KEY (`userid`, `username`)  COMMENT '');


The comment in this line should not be there, so the code should be:

PRIMARY KEY (`userid`, `username`));


and the code executes when I paste it into an editor and remove this comment. However I create massive databases daily. (Each with +- 15 tables). I can't keep doing this for each table as it is time consuming.

How can I disable this feature that adds the comments to the script?
I don't need them in my databases

Solution

This is a bug on MySQL Workbench >=6.3.* reported in these cases #76578 and HERE.

This is what ALTER TABLE do:

  • It adds a COMMENT '' on every line of the SQL Script to apply:



I recommended you to downgrade your MySQL Workbench to 6.2.* until they fix this.

Tested in Ubuntu LTS 14.04 and MySQL Workbench 6.3.4.0.

Context

StackExchange Database Administrators Q#111039, answer score: 3

Revisions (0)

No revisions yet.