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