MySQL  8.0.27
Source Code Documentation
psi_transaction.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2021, 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_PSI_TRANSACTION_H
24 #define MYSQL_PSI_TRANSACTION_H
25 
26 /**
27  @file include/mysql/psi/psi_transaction.h
28  Performance schema instrumentation interface.
29 
30  @defgroup psi_abi_transaction Transaction Instrumentation (ABI)
31  @ingroup psi_abi
32  @{
33 */
34 
35 #include "my_inttypes.h"
36 #include "my_macros.h"
37 
38 /* HAVE_PSI_*_INTERFACE */
39 #include "my_psi_config.h" // IWYU pragma: keep
40 
41 #include "my_sharedlib.h"
43 
44 /**
45  @def PSI_TRANSACTION_VERSION_1
46  Performance Schema Transaction Interface number for version 1.
47  This version is supported.
48 */
49 #define PSI_TRANSACTION_VERSION_1 1
50 
51 /**
52  @def PSI_CURRENT_TRANSACTION_VERSION
53  Performance Schema Transaction Interface number for the most recent version.
54  The most current version is @c PSI_TRANSACTION_VERSION_1
55 */
56 #define PSI_CURRENT_TRANSACTION_VERSION 1
57 
58 /** Entry point for the performance schema interface. */
60  /**
61  ABI interface finder.
62  Calling this method with an interface version number returns either
63  an instance of the ABI for this version, or NULL.
64  @sa PSI_TRANSACTION_VERSION_1
65  @sa PSI_TRANSACTION_VERSION_2
66  @sa PSI_CURRENT_TRANSACTION_VERSION
67  */
68  void *(*get_interface)(int version);
69 };
71 
72 #ifdef HAVE_PSI_TRANSACTION_INTERFACE
73 
74 /**
75  Performance Schema Transaction Interface, version 1.
76  @since PSI_TRANSACTION_VERSION_1
77 */
79  /** @sa get_thread_transaction_locker_v1_t. */
81  /** @sa start_transaction_v1_t. */
83  /** @sa set_transaction_xid_v1_t. */
85  /** @sa set_transaction_xa_state_v1_t. */
87  /** @sa set_transaction_gtid_v1_t. */
89  /** @sa set_transaction_trxid_v1_t. */
91  /** @sa inc_transaction_savepoints_v1_t. */
93  /** @sa inc_transaction_rollback_to_savepoint_v1_t. */
96  /** @sa inc_transaction_release_savepoint_v1_t. */
98  /** @sa end_transaction_v1_t. */
100 };
101 
103 
105 
106 #endif /* HAVE_PSI_TRANSACTION_INTERFACE */
107 
108 /** @} (end of group psi_abi_transaction) */
109 
110 #endif /* MYSQL_PSI_TRANSACTION_H */
void(* end_transaction_v1_t)(struct PSI_transaction_locker *locker, bool commit)
Commit or rollback the transaction.
Definition: psi_transaction_bits.h:169
void(* set_transaction_trxid_v1_t)(struct PSI_transaction_locker *locker, const unsigned long long *trxid)
Set the transaction trx_id.
Definition: psi_transaction_bits.h:137
void(* set_transaction_gtid_v1_t)(struct PSI_transaction_locker *locker, const void *sid, const void *gtid_spec)
Set the transaction gtid.
Definition: psi_transaction_bits.h:128
MYSQL_PLUGIN_IMPORT PSI_transaction_service_t * psi_transaction_service
Definition: psi_noop.cc:868
void(* inc_transaction_release_savepoint_v1_t)(struct PSI_transaction_locker *locker, unsigned long count)
Increment a transaction event release savepoint count.
Definition: psi_transaction_bits.h:161
void(* inc_transaction_rollback_to_savepoint_v1_t)(struct PSI_transaction_locker *locker, unsigned long count)
Increment a transaction event rollback to savepoint count.
Definition: psi_transaction_bits.h:153
struct PSI_transaction_locker *(* get_thread_transaction_locker_v1_t)(struct PSI_transaction_locker_state_v1 *state, const void *xid, const unsigned long long *trxid, int isolation_level, bool read_only, bool autocommit)
Get a transaction instrumentation locker.
Definition: psi_transaction_bits.h:90
void(* set_transaction_xa_state_v1_t)(struct PSI_transaction_locker *locker, int xa_state)
Set the state of the XA transaction.
Definition: psi_transaction_bits.h:119
void(* inc_transaction_savepoints_v1_t)(struct PSI_transaction_locker *locker, unsigned long count)
Increment a transaction event savepoint count.
Definition: psi_transaction_bits.h:145
void(* set_transaction_xid_v1_t)(struct PSI_transaction_locker *locker, const void *xid, int xa_state)
Set the transaction xid.
Definition: psi_transaction_bits.h:111
void(* start_transaction_v1_t)(struct PSI_transaction_locker *locker, const char *src_file, unsigned int src_line)
Start a new transaction event.
Definition: psi_transaction_bits.h:101
Some integer typedefs for easier portability.
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
Performance schema instrumentation interface.
required uint64 version
Definition: replication_group_member_actions.proto:40
Entry point for the performance schema interface.
Definition: psi_transaction.h:59
Performance Schema Transaction Interface, version 1.
Definition: psi_transaction.h:78
inc_transaction_savepoints_v1_t inc_transaction_savepoints
Definition: psi_transaction.h:92
get_thread_transaction_locker_v1_t get_thread_transaction_locker
Definition: psi_transaction.h:80
set_transaction_trxid_v1_t set_transaction_trxid
Definition: psi_transaction.h:90
start_transaction_v1_t start_transaction
Definition: psi_transaction.h:82
inc_transaction_release_savepoint_v1_t inc_transaction_release_savepoint
Definition: psi_transaction.h:97
inc_transaction_rollback_to_savepoint_v1_t inc_transaction_rollback_to_savepoint
Definition: psi_transaction.h:95
end_transaction_v1_t end_transaction
Definition: psi_transaction.h:99
set_transaction_gtid_v1_t set_transaction_gtid
Definition: psi_transaction.h:88
set_transaction_xa_state_v1_t set_transaction_xa_state
Definition: psi_transaction.h:86
set_transaction_xid_v1_t set_transaction_xid
Definition: psi_transaction.h:84