MySQL 8.3.0
Source Code Documentation
replicated_columns_view_with_gipk_on_source.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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 RPL_REPLICATED_COLUMNS_VIEW_GIPK_ON_SOURCE__H
24#define RPL_REPLICATED_COLUMNS_VIEW_GIPK_ON_SOURCE__H
25
26#include "sql/changestreams/misc/replicated_columns_view.h" // ReplicatedColumnsView
27
28namespace cs {
29namespace util {
30/**
31 @class ReplicatedColumnsViewWithGipkOnSource
32
33 Class used when we want a column view over a table in a context where the
34 replicated table contains a GIPK on the source, but not on the replica.
35
36 SOURCE TABLE `t`
37 +------+----+----+----+
38 | GIPK | C1 | C2 | C3 |
39 +------+----+----+----+
40
41 REPLICA TABLE `t`
42 +----+----+----+
43 | C1 | C2 | C3 |
44 +----+----+----+
45
46 This class differs from a standard column view:
47 - begin() will cause that returned filtered position, that pertain to the
48 source, are always incremented by 1.
49 This way, C1 on the replica matches C1 on the source data
50 */
52 public:
53 /**
54 Constructor which takes the TABLE object whose field set will be iterated.
55
56 @param table reference to the target TABLE object.
57 @param thd instance of `THD` class to be used to determine if filtering is
58 to be enabled. It may be `nullptr`.
59 */
61 THD const *thd = nullptr);
62 /**
63 Destructor for the class.
64 */
65 virtual ~ReplicatedColumnsViewWithGipkOnSource() override = default;
66 /**
67 This method overrides Table_columns_view::begin
68 Its start value insure that filtered positions are incremented by 1
69 when compared to the base iterator.
70
71 @return a column view iterator over the table
72 */
74
75 // --> Deleted constructors and methods to remove default move/copy semantics
77 const ReplicatedColumnsViewWithGipkOnSource &rhs) = delete;
81 const ReplicatedColumnsViewWithGipkOnSource &rhs) = delete;
84 // <--
85};
86} // namespace util
87} // namespace cs
88#endif // RPL_REPLICATED_COLUMNS_VIEW_GIPK_ON_SOURCE__H
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
Iterator class to allow iterating over the replicatable fields in a TABLE object field set.
Definition: table_column_iterator.h:214
Class used when we want a column view over a table in a context where the replicated table contains a...
Definition: replicated_columns_view_with_gipk_on_source.h:51
virtual ~ReplicatedColumnsViewWithGipkOnSource() override=default
Destructor for the class.
Table_columns_view ::iterator begin() override
This method overrides Table_columns_view::begin Its start value insure that filtered positions are in...
Definition: replicated_columns_view_with_gipk_on_source.cc:33
ReplicatedColumnsViewWithGipkOnSource(TABLE const *table, THD const *thd=nullptr)
Constructor which takes the TABLE object whose field set will be iterated.
Definition: replicated_columns_view_with_gipk_on_source.cc:29
ReplicatedColumnsViewWithGipkOnSource(const ReplicatedColumnsViewWithGipkOnSource &rhs)=delete
ReplicatedColumnsViewWithGipkOnSource & operator=(ReplicatedColumnsViewWithGipkOnSource &&rhs)=delete
ReplicatedColumnsViewWithGipkOnSource & operator=(const ReplicatedColumnsViewWithGipkOnSource &rhs)=delete
ReplicatedColumnsViewWithGipkOnSource(ReplicatedColumnsViewWithGipkOnSource &&rhs)=delete
Since it's not mandatory that all fields in a TABLE object are replicated, this class extends Table_c...
Definition: replicated_columns_view.h:53
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Definition: commit_order_queue.h:33
Definition: table.h:1403