Bug #61110 'Create Table ' and 'Alter Table...' option in pop up menu does nothing
Submitted: 10 May 2011 7:26 Modified: 13 Jun 2013 6:33
Reporter: Stian Brattland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:5.2.44 OS:Linux (Ubuntu 10.04)
Assigned to: CPU Architecture:Any
Tags: ALTER TABLE, workbench
Triage: Needs Triage: D1 (Critical)

[10 May 2011 7:26] Stian Brattland
Description:
The 'Alter Table...' option in the pop up menu that appears when you right click on any table silently dies. It appears that this error only occurs when one or more triggers are present on the table. 

In other words, the 'Alter Table...' dialog appears fine when no triggers are present on tables, but on tables with one or more triggers the dialog never appears.

How to repeat:
Create a trigger on a table, right click on that table and select 'Alter Table...'. In my scenario, the dialog box never appears.

I'm using Ubuntu 10.04 LTS with the default MySQL database (Version: 5.1.41-3ubuntu12.10)
[10 May 2011 7:55] Valeriy Kravchuk
Verified on 32-bit Ubuntu 10.04 (with stock 5.1.41 server). Not repeatable on Windows with recent 5.1.x and 5.5.x server versions.
[24 May 2011 19:01] moua jeg
I have the same trouble with windows 7 
MySQL server 5.5.11
[1 Dec 2011 19:02] Philip Olson
Fixed as of 5.2.36:
+        The <guimenu>Alter Table...</guimenu> option did not function on
+        tables with triggers.
[8 Dec 2011 18:08] Sasha Mitich
I also have a problem that Alter Table from context menu doesn't work. Create Table and Create View works but Send to SQL Editor ... and Send to Clipboard doesn't!!!
This is case on MySQL server on Ubuntu 10.04 LTS. I use several version of Workbench (5.2.34, 5.2.35 and 5.2.36 ) on WinXP and Win7 with same result. All options works if I access MySQL server on Windows!
But I'm sure that in the beginning, all options from context menu works! I'm not sure when problems started but in the meantime Workbench lose connections with server several time (during the long time operations - Update one field in table with 60000 records- take more than 600 secs !!!). Maybe that's the root of the problem. 
I don't use triger in the tables.
[1 Feb 2012 2:51] Marc Cardinal
I am experiencing this bug on Ubuntu 10.04 running "MySQL Workbench CE for Linux/Unix version 5.2.37  revision 8576" (taken from Help/System Info).
[28 May 2012 13:25] Armando Lopez Valencia
Not reproducible on WB 5.2.40.
[24 Oct 2012 17:21] Stian Brattland
DDL for table which can't be altered.

Attachment: table.ddl (application/octet-stream, text), 12.10 KiB.

[24 Oct 2012 17:22] Stian Brattland
This bug still appears in version 5.2.44.

Whenever there's a trigger on a table, I can't alter the table. Thus, when I attempt to right click a table and select 'Alter Table...' from the menu, all I get is an error message saying :

Error parsing DDL for [database].[table] : there was an error while parsing the DDL retrieved from the server. Do you want to view the DDL or cancel processing it?

The log says the following:

19:05:58 [ERR][             UI]: editor index 1 is unknown
19:06:00 [ERR][SqlEditorSchemaTree]: Unhandled live schema tree action: edit_dataeditor index 1 is unknown
19:06:33 [WRN][SqlEditorSchemaTree]: Error parsing DDL for trackerdatabase_production.report: delimiter $$

I've attached a file which is a cut'n'paste of the DDL in question.

This bug has prevented me from using MySQL workbench for a year and a half.
[7 Dec 2012 17:12] Armando Lopez Valencia
Hello.
Can you please attach a dump of a DB where you can reproduce this issue?
Thanks.
[10 Dec 2012 6:24] Stian Brattland
Hi,

I've added a schema dump of the database which triggers the behaviour.
[10 Dec 2012 17:09] Armando Lopez Valencia
Thanks a lot for your report Valeriy.
Reproduced with the data attached.
Verified in:
Ubuntu 10.04x86
WB 5.2.44 rev.9933
MySQL Server 5.1
Windows 7x64
WB 5.2.45 rev.10183
MySQL Server 5.5
[26 Dec 2012 23:12] Alfredo Kojima
The problem is caused by a server bug. Trigger bodies that contain strings with the \ character are returned unescaped by the information_schema or show triggers.
[13 Jun 2013 6:33] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.0.2 public beta release, and here's the changelog entry:

The "Alter Table..." option did not function on tables with triggers. This
was resolved by correctly escaping the data returned by the MySQL Server when
retrieving the triggers.

Thank you for the bug report.