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