MySQL  8.0.22
Source Code Documentation
service_rpl_transaction_write_set.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_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);
65 
66 #ifdef MYSQL_DYNAMIC_PLUGIN
67 
68 #define get_transaction_write_set(m_thread_id) \
69  (transaction_write_set_service->get_transaction_write_set((m_thread_id)))
70 
71 #else
72 
73 Transaction_write_set *get_transaction_write_set(unsigned long m_thread_id);
74 
75 #endif
76 
77 #define MYSQL_SERVICE_TRANSACTION_WRITE_SET_INCLUDED
78 #endif
unsigned long long * write_set
Definition: service_rpl_transaction_write_set.h:58
Transaction_write_set * get_transaction_write_set(unsigned long m_thread_id)
Definition: rpl_transaction_write_set_ctx.cc:96
Definition: service_rpl_transaction_write_set.h:61
struct transaction_write_set_service_st * transaction_write_set_service
unsigned long write_set_size
Definition: service_rpl_transaction_write_set.h:57
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