MySQL 8.0.29
Source Code Documentation
table_replication_applier_global_filters.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2016, 2022, 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 also distributed 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 included with MySQL.
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 TABLE_REPLICATION_APPLIER_DEFAULT_FILTERS_H
25#define TABLE_REPLICATION_APPLIER_DEFAULT_FILTERS_H
26
27/**
28 @file storage/perfschema/table_replication_applier_global_filters.h
29 Table replication_applier_global_filters (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_inttypes.h"
36#include "mysql_com.h"
37#include "sql/rpl_filter.h"
38#include "sql_string.h"
40
41class Field;
42class Plugin_table;
43struct TABLE;
44struct THR_LOCK;
45
46/** A row in the table */
48 /*
49 REPLICATE_DO_DB, REPLICATE_IGNORE_DB, REPLICATE_DO_TABLE,
50 REPLICATE_IGNORE_TABLE, REPLICATE_WILD_DO_TABLE,
51 REPLICATE_WILD_IGNORE_TABLE, REPLICATE_REWRITE_DB.
52 */
55 /*
56 The replication filter configured by startup options: --replicate-*,
57 CHANGE REPLICATION FILTER, or DEFAULT_FILTER (every channel copyies
58 global replication filters to its per-channel replication filters
59 if there are no per-channel replication filters and there are global
60 filters on the filter type when it is created).
61 */
63 /*
64 The global replication filters can be configured with the following
65 two states:
66 STARTUP_OPTIONS, //STARTUP_OPTIONS: --REPLICATE-*
67 CHANGE_REPLICATION_FILTER //CHANGE REPLICATION FILTER filter [, filter...]
68 */
70
71 /* Timestamp of when the configuration took place */
73};
74
75/** Table PERFORMANCE_SCHEMA.replication_applier_global_filters */
78
79 private:
80 /**
81 Make a row by an object of Rpl_pfs_filter.
82
83 @param rpl_pfs_filter a pointer to a Rpl_pfs_filter object.
84 */
85 void make_row(Rpl_pfs_filter *rpl_pfs_filter);
86
87 /** Table share lock. */
89 /** Table definition. */
91
92 /** Current row */
94 /** True is the current row exists. */
96 /** Current position. */
98 /** Next position. */
100
101 protected:
102 /**
103 Read the current row values.
104 @param table Table handle
105 @param buf row buffer
106 @param fields Table fields
107 @param read_all true if all columns are read.
108
109 @retval 0 if HAVE_REPLICATION is defined, else HA_ERR_RECORD_DELETED.
110 */
111 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
112 bool read_all) override;
113
115
116 public:
118
119 /** Table share. */
122 /**
123 Get the table count.
124
125 @retval return the table count.
126 */
127 static ha_rows get_row_count();
128 /**
129 Fetch the next row in this cursor.
130
131 @retval
132 0 Did not reach the end of the table.
133 HA_ERR_END_OF_FILE reached the end of the table.
134 */
135 int rnd_next() override;
136 /**
137 Fetch a row by position.
138
139 @param pos position to fetch
140 */
141 int rnd_pos(const void *pos) override;
142 void reset_position(void) override;
143};
144
145#endif
Definition: field.h:573
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
The class Rpl_pfs_filter is introduced to serve the performance_schema.replication_applier_filters ta...
Definition: rpl_filter.h:166
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
Table PERFORMANCE_SCHEMA.replication_applier_global_filters.
Definition: table_replication_applier_global_filters.h:76
pos_t m_next_pos
Next position.
Definition: table_replication_applier_global_filters.h:99
static Plugin_table m_table_def
Table definition.
Definition: table_replication_applier_global_filters.h:90
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:82
bool m_row_exists
True is the current row exists.
Definition: table_replication_applier_global_filters.h:95
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:110
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:88
PFS_simple_index pos_t
Definition: table_replication_applier_global_filters.h:77
static PFS_engine_table_share m_share
Table share.
Definition: table_replication_applier_global_filters.h:120
static THR_LOCK m_table_lock
Table share lock.
Definition: table_replication_applier_global_filters.h:88
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_replication_applier_global_filters.cc:97
st_row_applier_global_filters m_row
Current row.
Definition: table_replication_applier_global_filters.h:93
static ha_rows get_row_count()
Get the table count.
Definition: table_replication_applier_global_filters.cc:102
pos_t m_pos
Current position.
Definition: table_replication_applier_global_filters.h:97
char * pos
Definition: do_ctype.cc:76
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Common definition between mysql server & client.
#define NAME_LEN
Definition: mysql_com.h:66
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
enum_configured_by
Enum values for CONFIGURED_BY column.
Definition: rpl_filter.h:83
Our own string classes, used pervasively throughout the executor.
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Definition: table.h:1394
Definition: thr_lock.h:138
A row in the table.
Definition: table_replication_applier_global_filters.h:47
char filter_name[NAME_LEN]
Definition: table_replication_applier_global_filters.h:53
uint filter_name_length
Definition: table_replication_applier_global_filters.h:54
ulonglong active_since
Definition: table_replication_applier_global_filters.h:72
String filter_rule
Definition: table_replication_applier_global_filters.h:62
enum_configured_by configured_by
Definition: table_replication_applier_global_filters.h:69
unsigned int uint
Definition: uca-dump.cc:29