MySQL 8.4.0
Source Code Documentation
table_replication_applier_global_filters.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2016, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24
25#ifndef TABLE_REPLICATION_APPLIER_DEFAULT_FILTERS_H
26#define TABLE_REPLICATION_APPLIER_DEFAULT_FILTERS_H
27
28/**
29 @file storage/perfschema/table_replication_applier_global_filters.h
30 Table replication_applier_global_filters (declarations).
31*/
32
33#include <sys/types.h>
34
35#include "my_base.h"
36#include "my_inttypes.h"
37#include "mysql_com.h"
38#include "sql/rpl_filter.h"
39#include "sql_string.h"
41
42class Field;
43class Plugin_table;
44struct TABLE;
45struct THR_LOCK;
46
47/** A row in the table */
49 /*
50 REPLICATE_DO_DB, REPLICATE_IGNORE_DB, REPLICATE_DO_TABLE,
51 REPLICATE_IGNORE_TABLE, REPLICATE_WILD_DO_TABLE,
52 REPLICATE_WILD_IGNORE_TABLE, REPLICATE_REWRITE_DB.
53 */
56 /*
57 The replication filter configured by startup options: --replicate-*,
58 CHANGE REPLICATION FILTER, or DEFAULT_FILTER (every channel copyies
59 global replication filters to its per-channel replication filters
60 if there are no per-channel replication filters and there are global
61 filters on the filter type when it is created).
62 */
64 /*
65 The global replication filters can be configured with the following
66 two states:
67 STARTUP_OPTIONS, //STARTUP_OPTIONS: --REPLICATE-*
68 CHANGE_REPLICATION_FILTER //CHANGE REPLICATION FILTER filter [, filter...]
69 */
71
72 /* Timestamp of when the configuration took place */
74};
75
76/** Table PERFORMANCE_SCHEMA.replication_applier_global_filters */
79
80 private:
81 /**
82 Make a row by an object of Rpl_pfs_filter.
83
84 @param rpl_pfs_filter a pointer to a Rpl_pfs_filter object.
85 */
86 void make_row(Rpl_pfs_filter *rpl_pfs_filter);
87
88 /** Table share lock. */
90 /** Table definition. */
92
93 /** Current row */
95 /** True is the current row exists. */
97 /** Current position. */
99 /** Next position. */
101
102 protected:
103 /**
104 Read the current row values.
105 @param table Table handle
106 @param buf row buffer
107 @param fields Table fields
108 @param read_all true if all columns are read.
109
110 @retval 0 if HAVE_REPLICATION is defined, else HA_ERR_RECORD_DELETED.
111 */
112 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
113 bool read_all) override;
114
116
117 public:
119
120 /** Table share. */
123 /**
124 Get the table count.
125
126 @retval return the table count.
127 */
128 static ha_rows get_row_count();
129 /**
130 Fetch the next row in this cursor.
131
132 @retval
133 0 Did not reach the end of the table.
134 HA_ERR_END_OF_FILE reached the end of the table.
135 */
136 int rnd_next() override;
137 /**
138 Fetch a row by position.
139
140 @param pos position to fetch
141 */
142 int rnd_pos(const void *pos) override;
143 void reset_position() override;
144};
145
146#endif
Definition: field.h:575
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
The class Rpl_pfs_filter is introduced to serve the performance_schema.replication_applier_filters ta...
Definition: rpl_filter.h:167
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
Table PERFORMANCE_SCHEMA.replication_applier_global_filters.
Definition: table_replication_applier_global_filters.h:77
pos_t m_next_pos
Next position.
Definition: table_replication_applier_global_filters.h:100
static Plugin_table m_table_def
Table definition.
Definition: table_replication_applier_global_filters.h:91
void make_row(Rpl_pfs_filter *rpl_pfs_filter)
Make a row by an object of Rpl_pfs_filter.
Definition: table_replication_applier_global_filters.cc:149
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_replication_applier_global_filters.cc:83
bool m_row_exists
True is the current row exists.
Definition: table_replication_applier_global_filters.h:96
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_replication_applier_global_filters.cc:132
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_replication_applier_global_filters.cc:111
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_replication_applier_global_filters.cc:170
table_replication_applier_global_filters()
Definition: table_replication_applier_global_filters.cc:89
PFS_simple_index pos_t
Definition: table_replication_applier_global_filters.h:78
static PFS_engine_table_share m_share
Table share.
Definition: table_replication_applier_global_filters.h:121
static THR_LOCK m_table_lock
Table share lock.
Definition: table_replication_applier_global_filters.h:89
st_row_applier_global_filters m_row
Current row.
Definition: table_replication_applier_global_filters.h:94
static ha_rows get_row_count()
Get the table count.
Definition: table_replication_applier_global_filters.cc:103
pos_t m_pos
Current position.
Definition: table_replication_applier_global_filters.h:98
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_replication_applier_global_filters.cc:98
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Common definition between mysql server & client.
#define NAME_LEN
Definition: mysql_com.h:67
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
enum_configured_by
Enum values for CONFIGURED_BY column.
Definition: rpl_filter.h:84
Our own string classes, used pervasively throughout the executor.
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Definition: table.h:1405
Definition: thr_lock.h:139
A row in the table.
Definition: table_replication_applier_global_filters.h:48
char filter_name[NAME_LEN]
Definition: table_replication_applier_global_filters.h:54
uint filter_name_length
Definition: table_replication_applier_global_filters.h:55
ulonglong active_since
Definition: table_replication_applier_global_filters.h:73
String filter_rule
Definition: table_replication_applier_global_filters.h:63
enum_configured_by configured_by
Definition: table_replication_applier_global_filters.h:70