Bug #70244 "Error getting DDL for object" on alter table with triggers
Submitted: 4 Sep 2013 20:44 Modified: 13 Dec 2013 2:47
Reporter: Michael N Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:6.0.7.11215 OS:Windows (Windows 7)
Assigned to: CPU Architecture:Any
Tags: ALTER TABLE, DDL, error, triggers

[4 Sep 2013 20:44] Michael N
Description:
The full error is:
Error getting DDL for object
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER `mark`.`evaluation_insert`'

Explanation:
I have a table that has 3 triggers on INSERT/UPDATE. I originally created the triggers in HeidiSQL, but I have since moved to MySQL Workbench. I know for sure that a version of Workbench 2 updates ago would load these tables and the triggers upon clicking Alter Table (I can't recall the version number. Something in the 6.0 series). However, now I only get this error. HeidiSQL can still open the triggers and alter the table just fine. The triggers are still functioning correctly as well. My other tables without triggers will open the alter table view just fine.

Table create code is included in private comment section.

How to repeat:
Clicking alter table on this table containing 3 triggers.

Suggested fix:
I read somewhere that possible I needed to change the Preferences > SQL Editor > Non-standard SQL delimiter from $$ to ; or ;; but that did not work.

The version that I downloaded and installed on August 7th 2013 had this functionality working.
[4 Sep 2013 22:59] MySQL Verification Team
Thank you for the bug report. I couldn't repeat on Windows 7 and 8 both 64-bit however that issue was already reported so I guess something I am missing to repeat: The MySQL Server version, my.ini file, some actions prior to right click/alter table?. Thanks.
[5 Sep 2013 15:55] Michael N
MySQL Server version: 5.0.56-enterprise-gpl-log
Version Compile OS: redhat-linux-gnu

Config file /etc/my.cnf:
[MYSQLD]
log-bin=mysql-bin
server-id=1
user=mysql
datadir=/var/lib/mysql
skip-grant-tables
old-passwords
skip-name-resolve
back_log = 75
skip-innodb
max_connections = 500
key_buffer = 384M
myisam_sort_buffer_size = 2048M
myisam_max_sort_file_size = 10240M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 300
thread_cache_size = 384
connect_timeout = 10
tmp_table_size = 4096M
tmpdir=/var/tmp
max_heap_table_size = 512M
max_allowed_packet = 64M
max_connect_errors = 1000
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 4M
query_cache_size =512M
query_cache_type = 1
query_prealloc_size = 65536
query_alloc_block_size = 131072
default-storage-engine = MyISAM
log-slow-queries 
long_query_time=5
expire_logs_days = 30

No special actions prior to right clicking and going to Alter table, it happens anytime I do it, even after restarting the app and doing it as the first action, and even after updating to the latest 6.0.7 version and doing it as the first action.
[9 Sep 2013 22:10] MySQL Verification Team
trigger error

Attachment: trigger_error_wb.png (image/png, text), 67.45 KiB.

[9 Sep 2013 22:17] MySQL Verification Team
Thank you for the feedback.
[13 Dec 2013 2:47] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.0.9 release, and here's the changelog entry:

Clicking "Alter Table" on a table with multiple triggers would
sometimes generate an error. Trigger handling was improved to avoid such
errors.

Thank you for the bug report.