Bug #17034 Error messages from stored routines should name their source
Submitted: 2 Feb 2006 11:05 Modified: 8 Aug 2007 9:31
Reporter: Beat Vontobel (Silver Quality Contributor) (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.1 OS:Any (any)
Assigned to: CPU Architecture:Any
Tags: SP
Triage: D5 (Feature request)

[2 Feb 2006 11:05] Beat Vontobel
Description:
MySQL doesn't give any hints on where an error occured if stored routines are used. This makes it very difficult to determine the source of an error, for example if many functions are used in one statement or a procedure calls other procedures.

How to repeat:
Just one of thousands of possible examples:

mysql> CREATE FUNCTION f1() RETURNS INT NO SQL DETERMINISTIC RETURN 1;
Query OK, 0 rows affected (0.55 sec)

mysql> CREATE FUNCTION f2() RETURNS INT NO SQL DETERMINISTIC RETURN f2();
Query OK, 0 rows affected (0.06 sec)

mysql> SELECT f1(), f2();
ERROR 1424 (HY000): Recursive stored functions and triggers are not allowed.

Suggested fix:
Add something like "in routine %s" to error messages generated inside stored routines. The message above should read: "ERROR 1424 (HY000): Recursive stored functions and triggers are not allowed (in stored function f2)."
[2 Feb 2006 11:31] Miguel Solorzano
Thank you for the bug report.
[11 Feb 2006 10:45] Konstantin Osipov
I don't think this is at all possible to fix in 5.0.
[25 Aug 2006 18:46] Konstantin Osipov
Note to the implementor: the source should be available in the diagnostics area and in a separate field of the client-server protocol, not encoded in the text of the message itself.
[8 Aug 2007 9:31] Konstantin Osipov
Thank you for a valid feature request.