Bug #42135 Identify Trigger Errors DB Interaction
Submitted: 15 Jan 2009 15:44 Modified: 4 Feb 2009 15:51
Reporter: Brent Devereaux Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:5.1.30 OS:Any
Assigned to: CPU Architecture:Any
Tags: error, messages, Response, triggers

[15 Jan 2009 15:44] Brent Devereaux
I have noticed that when you have a trigger that has an error in it, The error message that comes back does not alert you to the trigger that caused that error.

For Instance I have a main table that has a number of columns with that I have an audit trigger. This Trigger will add a record to an audit table when a record is inserted or updated to the main table.  
Say for instance I had a trigger that I forgot to update that was addressing columns that were not in the audit table anymore. I would get an error something like this.
Unknown column 'SOMECOLUMN' in 'field list'
It would be nice if this error could identify the Trigger that caused it. When I am working with other complexities like J2EE with Hibernate and seeing an error like this caused me a bit of a run around while trying to find it. This time could have been saved with a message more like. 
Error Executing Trigger MYTRIGGER “Unknown column 'SOMECOLUMN' in 'field list’”

How to repeat:
Create two tables, 
Create a trigger to update the second table addressing a field that the second table does not have.
When you execute the trigger you will just see the basic error message.

Suggested fix:
Have a more informative error message for Triggers such as

Error Executing Trigger MYTRIGGER “Unknown column 'SOMECOLUMN' in 'field list’”
[4 Feb 2009 15:51] Susanne Ebrecht
Many thanks for writing a feature request. Our development will discuss this.