24#ifndef MYSQL_TRANSACTION_H
25#define MYSQL_TRANSACTION_H
36#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
41#ifndef PSI_TRANSACTION_CALL
42#define PSI_TRANSACTION_CALL(M) psi_transaction_service->M
51#ifdef HAVE_PSI_TRANSACTION_INTERFACE
52#define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
53 inline_mysql_start_transaction(STATE, XID, TRXID, ISO, RO, AC, __FILE__, \
56#define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
61#ifdef HAVE_PSI_TRANSACTION_INTERFACE
62#define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
63 inline_mysql_set_transaction_gtid(LOCKER, P1, P2)
65#define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
70#ifdef HAVE_PSI_TRANSACTION_INTERFACE
71#define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
72 inline_mysql_set_transaction_xid(LOCKER, P1, P2)
74#define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
79#ifdef HAVE_PSI_TRANSACTION_INTERFACE
80#define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
81 inline_mysql_set_transaction_xa_state(LOCKER, P1)
83#define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
88#ifdef HAVE_PSI_TRANSACTION_INTERFACE
89#define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
90 inline_mysql_set_transaction_trxid(LOCKER, P1)
92#define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
97#ifdef HAVE_PSI_TRANSACTION_INTERFACE
98#define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
99 inline_mysql_inc_transaction_savepoints(LOCKER, P1)
101#define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
106#ifdef HAVE_PSI_TRANSACTION_INTERFACE
107#define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
108 inline_mysql_inc_transaction_rollback_to_savepoint(LOCKER, P1)
110#define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
115#ifdef HAVE_PSI_TRANSACTION_INTERFACE
116#define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
117 inline_mysql_inc_transaction_release_savepoint(LOCKER, P1)
119#define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
124#ifdef HAVE_PSI_TRANSACTION_INTERFACE
125#define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
126 inline_mysql_rollback_transaction(LOCKER)
128#define MYSQL_ROLLBACK_TRANSACTION(LOCKER) NULL
131#ifdef HAVE_PSI_TRANSACTION_INTERFACE
132#define MYSQL_COMMIT_TRANSACTION(LOCKER) inline_mysql_commit_transaction(LOCKER)
134#define MYSQL_COMMIT_TRANSACTION(LOCKER) NULL
137#ifdef HAVE_PSI_TRANSACTION_INTERFACE
141 bool autocommit,
const char *src_file,
int src_line) {
145 if (
likely(locker !=
nullptr)) {
153 if (
likely(locker !=
nullptr)) {
160 if (
likely(locker !=
nullptr)) {
167 if (
likely(locker !=
nullptr)) {
174 if (
likely(locker !=
nullptr)) {
181 if (
likely(locker !=
nullptr)) {
188 if (
likely(locker !=
nullptr)) {
195 if (
likely(locker !=
nullptr)) {
202 if (
likely(locker !=
nullptr)) {
209 if (
likely(locker !=
nullptr)) {
#define PSI_TRANSACTION_CALL(M)
Definition: psi_transaction.h:36
struct PSI_transaction_locker PSI_transaction_locker
Definition: psi_transaction_bits.h:41
static void inline_mysql_set_transaction_xid(PSI_transaction_locker *locker, const void *xid, int xa_state)
Definition: mysql_transaction.h:158
static void inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker, const ulonglong *trxid)
Definition: mysql_transaction.h:172
static void inline_mysql_inc_transaction_release_savepoint(PSI_transaction_locker *locker, ulong count)
Definition: mysql_transaction.h:193
static struct PSI_transaction_locker * inline_mysql_start_transaction(PSI_transaction_locker_state *state, const void *xid, const ulonglong *trxid, int isolation_level, bool read_only, bool autocommit, const char *src_file, int src_line)
Definition: mysql_transaction.h:138
static void inline_mysql_set_transaction_gtid(PSI_transaction_locker *locker, const void *sid, const void *gtid_spec)
Definition: mysql_transaction.h:151
static void inline_mysql_rollback_transaction(struct PSI_transaction_locker *locker)
Definition: mysql_transaction.h:200
static void inline_mysql_set_transaction_xa_state(PSI_transaction_locker *locker, int xa_state)
Definition: mysql_transaction.h:165
static void inline_mysql_commit_transaction(struct PSI_transaction_locker *locker)
Definition: mysql_transaction.h:207
static void inline_mysql_inc_transaction_rollback_to_savepoint(PSI_transaction_locker *locker, ulong count)
Definition: mysql_transaction.h:186
static void inline_mysql_inc_transaction_savepoints(PSI_transaction_locker *locker, ulong count)
Definition: mysql_transaction.h:179
constexpr bool likely(bool expr)
Definition: my_compiler.h:55
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
static int count
Definition: myisam_ftdump.cc:43
static int start_transaction(MYSQL *mysql_con)
Definition: mysqldump.cc:5256
constexpr value_type read_only
Definition: classic_protocol_constants.h:213
constexpr value_type autocommit
Definition: classic_protocol_constants.h:152
bool end_transaction(THD *thd, bool error)
Helper function to do rollback or commit, depending on error.
Definition: utils.cc:181
Performance schema instrumentation (declarations).
Performance schema instrumentation interface.
State data storage for get_thread_transaction_locker_v1_t, get_thread_transaction_locker_v1_t.
Definition: psi_transaction_bits.h:53