Book Image

Mastering MariaDB

By : Federico Razzoli
Book Image

Mastering MariaDB

By: Federico Razzoli

Overview of this book

Table of Contents (19 chapters)
Mastering MariaDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Tips on debugging stored programs


Debugging a stored program can be tricky in MariaDB. There are several reasons. The most obvious is that MariaDB does not have any native debug API. Some debuggers exist, but they use dirty techniques to emulate the debugger process. Some of them parse the stored programs code and transparently add some statements that emulate a checkpoint, or keep track of the call stack, or return information to the debugger. This technique heavily modifies the code, thus it is not always reliable. Other debuggers execute the code internally to be able to implement debugging features. However, they cannot reproduce the exact behavior of MariaDB and MySQL in all circumstances, especially if you consider that several versions exist, and that they necessarily have bugs in both the program and the documentation. Of course, this is true for all existing software, not only for MariaDB!

To debug stored programs, a developer needs to use some tricks, which consist of adding some...