MySQL 8.3.0
Source Code Documentation
mysql_error.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MYSQL_ERROR_H
24#define MYSQL_ERROR_H
25
26/**
27 @file include/mysql/psi/mysql_error.h
28 Instrumentation helpers for errors.
29*/
30
31/* HAVE_PSI_*_INTERFACE */
32#include "my_psi_config.h" // IWYU pragma: keep
33
34#include "mysql/psi/psi_error.h"
35
36#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
37/* PSI_ERROR_CALL() as direct call. */
38#include "pfs_error_provider.h" // IWYU pragma: keep
39#endif
40
41#ifndef PSI_ERROR_CALL
42#define PSI_ERROR_CALL(M) psi_error_service->M
43#endif
44
45/**
46 @defgroup psi_api_error Error instrumentation (API)
47 @ingroup psi_api
48 @{
49*/
50
51/**
52 @def MYSQL_LOG_ERROR(E, N)
53 Instrumented metadata lock destruction.
54 @param N Error number
55 @param T Error operation
56*/
57#ifdef HAVE_PSI_ERROR_INTERFACE
58#define MYSQL_LOG_ERROR(N, T) inline_mysql_log_error(N, T)
59#else
60#define MYSQL_LOG_ERROR(N, T) \
61 do { \
62 } while (0)
63#endif
64
65#ifdef HAVE_PSI_ERROR_INTERFACE
66
67static inline void inline_mysql_log_error(int error_num,
68 PSI_error_operation error_operation) {
69 PSI_ERROR_CALL(log_error)(error_num, error_operation);
70}
71#endif /* HAVE_PSI_ERROR_INTERFACE */
72
73/** @} (end of group psi_api_error) */
74
75#endif
#define PSI_ERROR_CALL(M)
Definition: psi_error.h:35
#define log_error(...)
Definition: log_client.h:154
PSI_error_operation
Definition: psi_error_bits.h:35
static void inline_mysql_log_error(int error_num, PSI_error_operation error_operation)
Definition: mysql_error.h:67
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Performance schema instrumentation (declarations).
Performance schema instrumentation interface.