The other day I needed to figure out why the heck my mysql stored procedure wasn't working. I poked around for a way to do the most fundamental debugging possible: print out a log message.
Postgres accomplishes this by using the RAISE keyword, but mysql didn't seem to have a comparable function.
After a bit of Googling around I came across this article where the author recommends a technique for doing just this kind of debugging.
The technique is embarrassingly simple, and I wish I had thought of it: simply create a debug_log table that contains a text field in it. Then write a debug function that inserts into that table.
Duh. Now, why didn't I think of that?
It's a simple and brilliant way to get around the fact that mysql doesn't seem to provide any other debugging facilities.
Get all the details here.
May be it can help
ReplyDeletehttp://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-898.html. Illatis StepIn is Eclipse based debugger for stored procedures in MySQL.
Core Lab MySql Developer Studio 2.0 http://crlab.com/mysqldev/ has an integrated debugger for mysql stored procedures, with stepping facilities, breakpoints and watches.
ReplyDeleteI recommend great tool for this - mysql debugger - http://www.mydebugger.com.
ReplyDeleteDebugging MySQL Stored Routines is available in dbForge Studio for MySQL, v4.50 as well as debug mysql triggers:
ReplyDeletehttp://www.devart.com/dbforge/mysql/studio/
http://www.devart.com/dbforge/mysql/studio/demostutorials/debugging.html