rdebug_show_routine
NAME
rdebug_show_routine(): Show a routine's code, along with the outline of breakpoint positions.TYPE
ProcedureDESCRIPTION
This procedure is part of the rdebug API.
rdebug_show_routine() displays the body of a routine in prettified format. It adds breakpoint positions/IDs to the display.
A breakpoint is shown just at the beginning of the statement following it. Thus, setting a breakpoint implies the worker will stop just before executing said statement.
Execution of this routine is possible at any given time. When the specified routine has no debug info, rdebug_show_routine() simply shows its code.
SYNOPSIS
rdebug_show_routine(
in rdebug_routine_schema varchar(128) charset utf8,
in rdebug_routine_name varchar(128) charset utf8
)
READS SQL DATA
Input:
- rdebug_routine_schema: schema where routine is located.
- rdebug_routine_name: name of routine to show.
EXAMPLES
Show routine code with breakpoint positions (IDs):
mysql> call rdebug_show_routine('test','analyze_continents');
+-------------------------------------------------------------+
| `test`.`analyze_continents` breakpoints |
+-------------------------------------------------------------+
| main_body: begin |
| declare done bool default false; |
| declare current_continent varchar(32) default null; |
| declare continents_cursor cursor for |
| select distinct continent from world.Country; |
| declare continue handler for not found set done := true; |
| |
| [:80]open continents_cursor; |
| [:86]cursor_loop: while not done do |
| [:98]fetch continents_cursor into current_continent; |
| [:108]if done then |
| [:115]leave cursor_loop; |
| [:121]end if; |
| [:127]call analyze_continent_cities(current_continent); |
| [:136]end while; |
| [:142]close continents_cursor; |
| [:147]end |
+-------------------------------------------------------------+
In the above routine there are 9 breakpoint positions; these can be
used as input for rdebug_set_breakpoint().
Compare the above with output from rdebug_show_routine_statements().