MySQL 8.0.39
Source Code Documentation
mysql_error.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_ERROR_H
25#define MYSQL_ERROR_H
26
27/**
28 @file include/mysql/psi/mysql_error.h
29 Instrumentation helpers for errors.
30*/
31
32/* HAVE_PSI_*_INTERFACE */
33#include "my_psi_config.h" // IWYU pragma: keep
34
35#include "mysql/psi/psi_error.h"
36
37#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
38/* PSI_ERROR_CALL() as direct call. */
39#include "pfs_error_provider.h" // IWYU pragma: keep
40#endif
41
42#ifndef PSI_ERROR_CALL
43#define PSI_ERROR_CALL(M) psi_error_service->M
44#endif
45
46/**
47 @defgroup psi_api_error Error instrumentation (API)
48 @ingroup psi_api
49 @{
50*/
51
52/**
53 @def MYSQL_LOG_ERROR(E, N)
54 Instrumented metadata lock destruction.
55 @param N Error number
56 @param T Error operation
57*/
58#ifdef HAVE_PSI_ERROR_INTERFACE
59#define MYSQL_LOG_ERROR(N, T) inline_mysql_log_error(N, T)
60#else
61#define MYSQL_LOG_ERROR(N, T) \
62 do { \
63 } while (0)
64#endif
65
66#ifdef HAVE_PSI_ERROR_INTERFACE
67
68static inline void inline_mysql_log_error(int error_num,
69 PSI_error_operation error_operation) {
70 PSI_ERROR_CALL(log_error)(error_num, error_operation);
71}
72#endif /* HAVE_PSI_ERROR_INTERFACE */
73
74/** @} (end of group psi_api_error) */
75
76#endif
#define log_error
Definition: log_client.h:111
#define PSI_ERROR_CALL(M)
Definition: psi_error.h:36
PSI_error_operation
Definition: psi_error_bits.h:36
static void inline_mysql_log_error(int error_num, PSI_error_operation error_operation)
Definition: mysql_error.h:68
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Performance schema instrumentation (declarations).
Performance schema instrumentation interface.