MySQL 8.4.2
Source Code Documentation
service_rpl_transaction_ctx.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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_SERVICE_RPL_TRANSACTION_CTX_INCLUDED
25
26/**
27 @file include/mysql/service_rpl_transaction_ctx.h
28 This service provides a function for plugins to report if a transaction of a
29 given THD should continue or be aborted.
30
31 SYNOPSIS
32 set_transaction_ctx()
33 should be called during RUN_HOOK macro, on which we know that thread is
34 on plugin context and it is before
35 Rpl_transaction_ctx::is_transaction_rollback() check.
36*/
37
38#ifndef MYSQL_ABI_CHECK
39#include <stdlib.h>
40#endif
41
42#include <cstdint>
43
45 unsigned long m_thread_id;
46 unsigned int m_flags; // reserved
47
48 /*
49 If the instruction is to rollback the transaction,
50 then this flag is set to false.
51 */
53
54 /*
55 If the plugin has generated a GTID, then the following
56 fields MUST be set.
57 */
60 std::int64_t m_gno;
61};
62
65 Transaction_termination_ctx transaction_termination_ctx);
67
68#ifdef MYSQL_DYNAMIC_PLUGIN
69
70#define set_transaction_ctx(transaction_termination_ctx) \
71 (rpl_transaction_ctx_service->set_transaction_ctx( \
72 (transaction_termination_ctx)))
73
74#else
75
77 Transaction_termination_ctx transaction_termination_ctx);
78
79#endif
80
81#define MYSQL_SERVICE_RPL_TRANSACTION_CTX_INCLUDED
82#endif
struct rpl_transaction_ctx_service_st * rpl_transaction_ctx_service
int set_transaction_ctx(Transaction_termination_ctx transaction_termination_ctx)
Definition: rpl_transaction_ctx.cc:96
Definition: service_rpl_transaction_ctx.h:44
std::int64_t m_gno
Definition: service_rpl_transaction_ctx.h:60
bool m_rollback_transaction
Definition: service_rpl_transaction_ctx.h:52
unsigned long m_thread_id
Definition: service_rpl_transaction_ctx.h:45
int m_sidno
Definition: service_rpl_transaction_ctx.h:59
unsigned int m_flags
Definition: service_rpl_transaction_ctx.h:46
bool m_generated_gtid
Definition: service_rpl_transaction_ctx.h:58
Definition: service_rpl_transaction_ctx.h:63
int(* set_transaction_ctx)(Transaction_termination_ctx transaction_termination_ctx)
Definition: service_rpl_transaction_ctx.h:64