MySQL stored procedures have been criticized for lack of debugging tools since the birth of MySQL 5.0. Since its acquisition by SUN and ORACLE, MySQL products have experienced many improvements in both functionality and performance. However, in terms of stored procedures, MySQL 5.5 adds an Error Buffer acquisition method. MySQL 5.6 further expands the error buffer to store as many warnings and error messages as possible. Of course, these are only functions of the software. Now ORACLE has integrated the debugging of the stored procedure into Virtual Studio, which can easily debug the stored procedure from Virtual Studio, simplifying the subsequent maintenance of the stored procedure.
Of course, third-party commercial companies have also developed some tools FOR debugging stored procedures, such as dbforge studio for mysql. This tool can debug a small amount of code.
For example, the following stored procedure:
DELIMITER $ USE't _ girl $ drop procedure if exists 'SP _ vs2010 '$ create definer = 'root' @ 'localhost' PROCEDURE 'SP _ vs2010' (OUT p2 INT) BEGINDECLARE I int default 0; loop_label1: LOOPIF I> 10 then leave loop_label1; end if; SET I = I + 1; end loop; SET p2 = I; END $ DELIMITER;
Debugging of dbforge studio for mysql:
Virtual Studio For MySQL debugging.