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