rdebug is a debugger and a debugging API for MySQL stored routines

rdebug is a pure SQL, server side debugging framework. Relying on stored routines themselves, it allows for debugging of MySQL stored routines.

rdebug provides with an API that can be used by all clients - from command line sessions to GUI tools. The API is based on stored routine calls.

rdebug works by running two MySQL sessions: the worker session, where one issues her stored routine, and the debugger session, which attaches to the worker session and controls it.

rdebug relies on code injection: one must compile his stored procedure in debug mode so as to debug it. This process injects rdebug specific code into the routine. This code can later be removed by compiling the routine again, this time without debug info.

See rdebug workflow to find out how to set up and work out a debugging session.

rdebug is in alpha - experimental - stage. It provides with working functionality, with some known limitations.

Known limitations in rdebug - alpha:

  • Debugging limited to stored procedures. Support for stored functions is expected. Support for triggers and events is not expected.
  • Conditional breakpoints (i.e. breakpoint where some condition holds true) are not yet supported
  • At this stage, breakpoints are declared per debugging session. Thus, a breakpoint set by one debugger will not exist on a simultaneous second debugger. This design is being reviewed and is subject to change.
  • rdebug_run() is known to hang when the entire routine executes without at least once stopping on a breakpoint or on a step.
  • Importing common_schema will terminate any running debugging session (though will not interfere with the execution of the worker).


Query Script, rdebug API


Shlomi Noach
common_schema documentation