This chapter focused on logging, finding, and understanding the errors that occur in a MariaDB installation.
We analyzed the information available in a single error condition. These conditions populate the diagnostics area. We discussed how the diagnostics area is populated or emptied by the statements we execute. We also discussed and tried the SQL statements that show information from the diagnostics area: SHOW WARNINGS
, SHOW ERRORS
, and GET DIAGNOSTICS
. The SQL errors are also logged in a file if the SQL_ERROR_LOG
plugin is enabled. We learned how to use that plugin efficiently. Some further notes were dedicated to the debugging of stored programs, which is often a difficult task.
The general query log is also useful to debug applications or find problematic statements. While it does not contain information about errors which occurred, it keeps a track of all the statements that were sent to the server. This log can be written to a file or to a SQL table called general_log
.
SQL errors...