Bug #70405 Getting MySQL Error Trace from Procedure
Submitted: 24 Sep 2013 6:40
Reporter: Sachin Vyas Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.5.17 MySQL Community Server (GPL) OS:Windows
Assigned to: CPU Architecture:Any
Tags: Error trace from Procedure, Error trace from Procedure in front end

[24 Sep 2013 6:40] Sachin Vyas
Description:
Hello, 
I am currently using : 
Server version: 5.5.17 MySQL Community Server (GPL) 

I need to get error trace from stored procedures/functions, which give me atleast the procedure name that caused the error. 
(more info like line no. etc as it is displayed in Oracle would be great 
ORACLE 
======= 

Error report: 
ORA-06502: PL/SQL: numeric or value error: character to number conversion error 
ORA-06512: at "HR.TEST", line 6 
ORA-06512: at line 2 

MySQL 
===== 
ERROR 1146 (42S02): Table 'test_db.a' doesn't exist 
) 
As we can see, MySQL does not returns the line no. & procedure name that caused the exception/error. 

It becomes difficult to debug where the error actually occured in case of nested procedure calls. 

Regards, 
Sachin Vyas.

How to repeat:
1) Create any procedure & introduce an error, the error trace (in an application server - Tomcat etc) does not display enough error trace to resolve it. 

2) Create nested procedures & introduce an error in any of the nested procedure, the error trace (in an application server - Tomcat etc) does not display enough error trace to resolve it.

Suggested fix:
MySQL Should return the appropriate error trace with correct procedure name & line no. as mentioned under "Description". This is important to get to the root cause of error.
This becomes more trivial in case an error has occurred in a nested procedure call.