Chapter 2. Debugging

In this chapter, we will discuss the basic techniques that can be used to find problems in the MariaDB server and in SQL statements. The following are some of the basic tools and techniques used:

  • Error conditions
  • The diagnostics area
  • The error log
  • The general query log
  • Maintaining logs
  • The SQL_ERROR_LOG plugin
  • Debugging of stored programs

Understanding error conditions in MariaDB

Before discussing the database debugging techniques, it is important to understand the most important tools used by MariaDB that notify us about error conditions, that is, when something goes wrong.

An error in MariaDB consists of the following types of data:

  • A SQLSTATE value
  • An error number
  • An error message

While conditions are usually generated by the server, ...

Get Mastering MariaDB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.