Bug #62207 Table comments are truncated to 66 characters rather than the 2048 the db allows
Submitted: 19 Aug 2011 8:05 Modified: 22 Jun 2012 0:39
Reporter: Gareth Blain Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.34 OS:Any
Assigned to: CPU Architecture:Any

[19 Aug 2011 8:05] Gareth Blain
Description:
In the past it apears MySQL only aloud 60 odd characters in the table comments fields but now (at least version 5.5.11 that we are using) lets 2048 characters but Workbench V5.2.34 auto truncates them to 60 characters still.

This also has the same affect when forward engineering from an "EER Diagram" when the full 2048 comments (or at least more than 60 odd) have been added (which is stored fine in EER Diagrams).

How to repeat:
Create a new schema,
Right click on the table section and click "Create Table",
Enter table comment > 66 characters (not sure why 66) and click "Apply"

The next screen will show the SQL that will be run like:

"CREATE  TABLE `new_schema`.`new_table` ()
COMMENT = '12345678 12345678 12345678 12345678 12345678 12345678 123456' /* comment truncated */ ;"

As you can see it's been truncated to 66 characters. You CAN edit the SQL and add paste the full comment back in (upto 2048 characters) and it WILL work fine.

Suggested fix:
Ether:
- Pull out the correct limit from the connected DB
- Or at least allow the user to adjust the limit to the correct number for the DB they are currently using (would need to be database connection specific ;)).
[20 Aug 2011 6:49] Valeriy Kravchuk
Please, check if the same problem still happens with a newer version, 5.2.34.
[22 Aug 2011 11:02] Gareth Blain
Hi Valeriy Kravchuk, Thanks for looking at this. Sorry that is the version I am using. Just a typo when I put "5.2.32" :)

Regards,

Zas
[22 Aug 2011 20:24] Rafael Antonio Bedoy Torres
This bug has been verified
[3 Jan 2012 13:21] Kevin Swift
Please, when fixing this consider...

Truncation of comments is fair enough to support the server but is useless as a form of documentation.

Might I suggest that when a comment is truncated the remaining text is exported as a text comment e.g. 

(shortened example)

Given text "This table holds data for that is used to record logins"

COMMENT = 'This table holds data for that' /* comment truncated */ /* is used to record logins */
[3 Jan 2012 13:27] Gareth Blain
@Kevin: That sounds like a great idea but where would that data be stored? The column is truncated as it is to big to store in the DB or am I missing something.  :-)
[4 Mar 2012 14:40] David Eyre
this is a frustrating problem that seems to still be present in 5.2.37 when forward engineering from a model.
[22 Jun 2012 0:39] Philip Olson
Fixed as of 5.2.41 , and here's the changelog entry:

MySQL Workbench would sometimes be unable to save changes that were only to
comments. It used a hard limit, but now uses the MySQL Server limit for
maximum comment lengths. For example, it would compare the first 60
characters of a table comment change, and generate an error if the
change did not affect the first 60 characters. 

From the MySQL
Server 5.5.3 changelog: the maximum length of table comments was
extended from 60 to 2048 characters. The maximum length of column
comments was extended from 255 to 1024 characters. Index definitions now
can include a comment of up to 1024 characters.