MySQL 8.0.39
Source Code Documentation
service_rpl_transaction_write_set.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_TRANSACTION_WRITE_SET_INCLUDED
25
26/**
27 @file include/mysql/service_rpl_transaction_write_set.h
28 This service provides a function for plugins to get the write set of a given
29 transaction.
30
31 SYNOPSIS
32 get_transaction_write_set()
33 This service is used to fetch the write_set extracted for the currently
34 executing transaction by passing the thread_id as an input parameter for
35 the method.
36
37 @param [in] - thread_id - It is the thread identifier of the currently
38 executing thread.
39
40 In the current implementation it is being called during RUN_HOOK macro,
41 on which we know that thread is on plugin context.
42
43 Cleanup :
44 The service caller must take of the memory allocated during the service
45 call to prevent memory leaks.
46*/
47
48#ifndef MYSQL_ABI_CHECK
49#include <stdlib.h>
50#endif
51
52/**
53 This structure is used to keep the list of the hash values of the records
54 changed in the transaction.
55*/
57 unsigned int m_flags; // reserved
58 unsigned long write_set_size; // Size of the PKE set of the transaction.
59 unsigned long long *write_set; // A pointer to the PKE set.
60};
61
63 Transaction_write_set *(*get_transaction_write_set)(
64 unsigned long m_thread_id);
65 void (*require_full_write_set)(bool requires_ws);
69
70#ifdef MYSQL_DYNAMIC_PLUGIN
71
72#define get_transaction_write_set(m_thread_id) \
73 transaction_write_set_service->get_transaction_write_set(m_thread_id)
74#define require_full_write_set(requires_ws) \
75 transaction_write_set_service->require_full_write_set(requires_ws)
76#define set_write_set_memory_size_limit(size_limit) \
77 transaction_write_set_service->set_write_set_memory_size_limit(size_limit)
78#define update_write_set_memory_size_limit(size_limit) \
79 transaction_write_set_service->update_write_set_memory_size_limit(size_limit)
80
81#else
82
83Transaction_write_set *get_transaction_write_set(unsigned long m_thread_id);
84
85void require_full_write_set(bool requires_ws);
86
88
90
91#endif
92
93#define MYSQL_SERVICE_TRANSACTION_WRITE_SET_INCLUDED
94#endif
uint64_t uint64
Definition: my_inttypes.h:69
struct transaction_write_set_service_st * transaction_write_set_service
void update_write_set_memory_size_limit(uint64 size_limit)
Definition: rpl_transaction_write_set_ctx.cc:173
void require_full_write_set(bool requires_ws)
Definition: rpl_transaction_write_set_ctx.cc:153
Transaction_write_set * get_transaction_write_set(unsigned long m_thread_id)
Definition: rpl_transaction_write_set_ctx.cc:193
void set_write_set_memory_size_limit(uint64 size_limit)
Definition: rpl_transaction_write_set_ctx.cc:168
This structure is used to keep the list of the hash values of the records changed in the transaction.
Definition: service_rpl_transaction_write_set.h:56
unsigned int m_flags
Definition: service_rpl_transaction_write_set.h:57
unsigned long long * write_set
Definition: service_rpl_transaction_write_set.h:59
unsigned long write_set_size
Definition: service_rpl_transaction_write_set.h:58
Definition: service_rpl_transaction_write_set.h:62
void(* require_full_write_set)(bool requires_ws)
Definition: service_rpl_transaction_write_set.h:65
void(* update_write_set_memory_size_limit)(uint64 size_limit)
Definition: service_rpl_transaction_write_set.h:67
void(* set_write_set_memory_size_limit)(uint64 size_limit)
Definition: service_rpl_transaction_write_set.h:66