MySQL 8.0.39
Source Code Documentation
transaction_prepared_message.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 TRANSACTION_PREPARED_MESSAGE_INCLUDED
25#define TRANSACTION_PREPARED_MESSAGE_INCLUDED
26
28#include <vector>
29
30#include "my_inttypes.h"
32
33/*
34 @class Transaction_prepared_message
35 */
37 public:
39 // This type should not be used anywhere.
41
42 // Length of the payload item: 8 bytes
44
45 // Length of the payload item: 16 bytes.
46 // Optional item.
48
49 // No valid type codes can appear after this one.
50 PIT_MAX = 3
51 };
52
53 /**
54 Message constructor
55
56 @param[in] sid the prepared transaction sid
57 @param[in] gno the prepared transaction gno
58 */
60
61 /**
62 Message decode constructor
63
64 @param[in] buf message buffer
65 @param[in] len message buffer length
66 */
67 Transaction_prepared_message(const unsigned char *buf, size_t len);
69
70 const rpl_sid *get_sid();
71
73
74 protected:
75 /*
76 Implementation of the template methods
77 */
78 void encode_payload(std::vector<unsigned char> *buffer) const override;
79 void decode_payload(const unsigned char *buffer,
80 const unsigned char *end) override;
81
82 private:
86};
87
88#endif /* TRANSACTION_PREPARED_MESSAGE_INCLUDED */
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
Definition: transaction_prepared_message.h:36
void encode_payload(std::vector< unsigned char > *buffer) const override
Encodes the contents of this instance payload into the buffer.
Definition: transaction_prepared_message.cc:47
~Transaction_prepared_message() override
void decode_payload(const unsigned char *buffer, const unsigned char *end) override
Decodes the contents of the buffer and sets the payload field values according to the values decoded.
Definition: transaction_prepared_message.cc:60
Transaction_prepared_message(const rpl_sid *sid, rpl_gno gno)
Message constructor.
Definition: transaction_prepared_message.cc:27
enum_payload_item_type
Definition: transaction_prepared_message.h:38
@ PIT_MAX
Definition: transaction_prepared_message.h:50
@ PIT_UNKNOWN
Definition: transaction_prepared_message.h:40
@ PIT_TRANSACTION_PREPARED_GNO
Definition: transaction_prepared_message.h:43
@ PIT_TRANSACTION_PREPARED_SID
Definition: transaction_prepared_message.h:47
rpl_gno get_gno()
Definition: transaction_prepared_message.cc:92
rpl_gno m_gno
Definition: transaction_prepared_message.h:85
const rpl_sid * get_sid()
Definition: transaction_prepared_message.cc:88
bool m_sid_specified
Definition: transaction_prepared_message.h:83
rpl_sid m_sid
Definition: transaction_prepared_message.h:84
Some integer typedefs for easier portability.
Definition: buf0block_hint.cc:30
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
binary_log::gtids::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of binary_log::gtids::gno_t.
Definition: rpl_gtid.h:103
This is a POD.
Definition: uuid.h:61