MySQL 8.0.32
Source Code Documentation
sql_xa_end.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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 XA_SQL_CMD_XA_END
24#define XA_SQL_CMD_XA_END
25
26#include "sql/sql_cmd.h" // Sql_cmd
27#include "sql/xa.h" // xid_t
28
29/**
30 @class Sql_cmd_xa_end
31
32 This class represents the `XA END ...` SQL statement which puts in the IDLE
33 state an XA transaction with the given xid value.
34
35 @see Sql_cmd
36*/
37class Sql_cmd_xa_end : public Sql_cmd {
38 public:
39 /**
40 Class constructor.
41
42 @param xid_arg XID of the XA transacation about to end
43 @param xa_option Additional options for the `XA END` command
44 */
45 Sql_cmd_xa_end(xid_t *xid_arg, enum xa_option_words xa_option);
46 virtual ~Sql_cmd_xa_end() override = default;
47
48 /**
49 Retrieves the SQL command code for this class, `SQLCOM_XA_END`.
50
51 @see Sql_cmd::sql_command_code
52
53 @return The SQL command code for this class, `SQLCOM_XA_END`.
54 */
55 enum_sql_command sql_command_code() const override;
56 /**
57 Executes the SQL command.
58
59 @see Sql_cmd::execute
60
61 @param thd The `THD` session object within which the command is being
62 executed.
63
64 @return false if the execution is successful, true otherwise.
65 */
66 bool execute(THD *thd) override;
67
68 private:
69 /** The XID associated with the underlying XA transaction. */
71 /** Options associated with the underlying `XA END` */
73
74 /**
75 Put a XA transaction in the IDLE state.
76
77 @param thd Current thread
78
79 @retval false Success
80 @retval true Failure
81 */
82 bool trans_xa_end(THD *thd);
83};
84
85#endif // XA_SQL_CMD_XA_END
This class represents the XA END ... SQL statement which puts in the IDLE state an XA transaction wit...
Definition: sql_xa_end.h:37
Sql_cmd_xa_end(xid_t *xid_arg, enum xa_option_words xa_option)
Class constructor.
Definition: sql_xa_end.cc:30
virtual ~Sql_cmd_xa_end() override=default
xid_t * m_xid
The XID associated with the underlying XA transaction.
Definition: sql_xa_end.h:70
bool execute(THD *thd) override
Executes the SQL command.
Definition: sql_xa_end.cc:37
enum_sql_command sql_command_code() const override
Retrieves the SQL command code for this class, SQLCOM_XA_END.
Definition: sql_xa_end.cc:33
bool trans_xa_end(THD *thd)
Put a XA transaction in the IDLE state.
Definition: sql_xa_end.cc:45
enum xa_option_words m_xa_opt
Options associated with the underlying XA END
Definition: sql_xa_end.h:72
Representation of an SQL command.
Definition: sql_cmd.h:64
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
enum_sql_command
Definition: my_sqlcommand.h:45
Representation of an SQL command.
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: xa.h:82
xa_option_words
Definition: xa.h:52