MySQL 8.0.29
Source Code Documentation
table_replication_connection_status.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2013, 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_CONNECTION_STATUS_H
25#define TABLE_REPLICATION_CONNECTION_STATUS_H
26
27/**
28 @file storage/perfschema/table_replication_connection_status.h
29 Table replication_connection_status (declarations).
30*/
31
32#include <stddef.h>
33#include <sys/types.h>
34
35#include "my_base.h"
36#include "my_inttypes.h"
38#include "sql/rpl_gtid.h"
39#include "sql/rpl_info.h" /*CHANNEL_NAME_LENGTH */
40#include "sql/rpl_reporting.h" /* MAX_SLAVE_ERRMSG */
41#include "sql/sql_const.h"
44
45class Field;
46class Master_info;
47class Plugin_table;
48struct TABLE;
49struct THR_LOCK;
50
51/**
52 @addtogroup performance_schema_tables
53 @{
54*/
55
56#ifndef ENUM_RPL_YES_NO
57#define ENUM_RPL_YES_NO
59#endif
60
65};
66
67/*
68 A row in the table. The fields with string values have an additional
69 length field denoted by <field_name>_length.
70*/
100
102
103 void cleanup() {
104 if (received_transaction_set != nullptr) {
106 received_transaction_set = nullptr;
107 }
108 }
109};
110
112 public:
115
117
118 virtual bool match(Master_info *mi) = 0;
119};
120
123 public:
125 : PFS_index_rpl_connection_status(&m_key), m_key("CHANNEL_NAME") {}
126
128
129 bool match(Master_info *mi) override;
130
131 private:
133};
134
137 public:
139 : PFS_index_rpl_connection_status(&m_key), m_key("THREAD_ID") {}
140
142
143 bool match(Master_info *mi) override;
144
145 private:
147};
148
149/** Table PERFORMANCE_SCHEMA.REPLICATION_CONNECTION_STATUS. */
152
153 private:
154 int make_row(Master_info *mi);
155
156 /** Table share lock. */
158 /** Table definition. */
160
161 /** Current row */
163 /** Current position. */
165 /** Next position. */
167
168 protected:
169 /**
170 Read the current row values.
171 @param table Table handle
172 @param buf row buffer
173 @param fields Table fields
174 @param read_all true if all columns are read.
175 */
176
177 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
178 bool read_all) override;
179
181
182 public:
184
185 /** Table share. */
188 static ha_rows get_row_count();
189 void reset_position(void) override;
190
191 int rnd_next() override;
192 int rnd_pos(const void *pos) override;
193
194 int index_init(uint idx, bool sorted) override;
195 int index_next() override;
196
197 private:
199};
200
201/** @} */
202#endif
Definition: field.h:573
Definition: rpl_mi.h:86
Definition: pfs_engine_table.h:299
Definition: pfs_engine_table.h:267
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_replication_connection_status.h:122
PFS_key_name m_key
Definition: table_replication_connection_status.h:132
PFS_index_rpl_connection_status_by_channel()
Definition: table_replication_connection_status.h:124
bool match(Master_info *mi) override
Definition: table_replication_connection_status.cc:138
~PFS_index_rpl_connection_status_by_channel() override=default
Definition: table_replication_connection_status.h:136
~PFS_index_rpl_connection_status_by_thread() override=default
PFS_index_rpl_connection_status_by_thread()
Definition: table_replication_connection_status.h:138
bool match(Master_info *mi) override
Definition: table_replication_connection_status.cc:155
PFS_key_thread_id m_key
Definition: table_replication_connection_status.h:146
Definition: table_replication_connection_status.h:111
virtual bool match(Master_info *mi)=0
~PFS_index_rpl_connection_status() override=default
PFS_index_rpl_connection_status(PFS_engine_key *key)
Definition: table_replication_connection_status.h:113
Definition: table_helper.h:1508
Definition: table_helper.h:1250
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.REPLICATION_CONNECTION_STATUS.
Definition: table_replication_connection_status.h:150
PFS_simple_index pos_t
Definition: table_replication_connection_status.h:151
int index_next() override
Find key in index, read record.
Definition: table_replication_connection_status.cc:255
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_replication_connection_status.cc:189
int index_init(uint idx, bool sorted) override
Definition: table_replication_connection_status.cc:236
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_replication_connection_status.cc:178
st_row_connect_status m_row
Current row.
Definition: table_replication_connection_status.h:162
static ha_rows get_row_count()
Definition: table_replication_connection_status.cc:194
pos_t m_pos
Current position.
Definition: table_replication_connection_status.h:164
PFS_index_rpl_connection_status * m_opened_index
Definition: table_replication_connection_status.h:198
pos_t m_next_pos
Next position.
Definition: table_replication_connection_status.h:166
table_replication_connection_status()
Definition: table_replication_connection_status.cc:183
static Plugin_table m_table_def
Table definition.
Definition: table_replication_connection_status.h:159
int make_row(Master_info *mi)
Definition: table_replication_connection_status.cc:280
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_replication_connection_status.cc:199
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_replication_connection_status.cc:218
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_replication_connection_status.cc:409
static THR_LOCK m_table_lock
Table share lock.
Definition: table_replication_connection_status.h:157
static PFS_engine_table_share m_share
Table share.
Definition: table_replication_connection_status.h:186
char * pos
Definition: do_ctype.cc:76
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
enum_rpl_connect_status_service_state
Definition: table_replication_connection_status.h:61
@ PS_RPL_NO
Definition: table_replication_connection_status.h:58
@ PS_RPL_YES
Definition: table_replication_connection_status.h:58
@ PS_RPL_CONNECT_SERVICE_STATE_YES
Definition: table_replication_connection_status.h:62
@ PS_RPL_CONNECT_SERVICE_STATE_CONNECTING
Definition: table_replication_connection_status.h:64
@ PS_RPL_CONNECT_SERVICE_STATE_NO
Definition: table_replication_connection_status.h:63
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
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:80
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
required string key
Definition: replication_asynchronous_connection_failover.proto:59
#define CHANNEL_NAME_LENGTH
Definition: rpl_info.h:40
#define MAX_SLAVE_ERRMSG
Maximum size of an error message from a slave thread.
Definition: rpl_reporting.h:41
File containing constants that can be used throughout the server.
constexpr const size_t UUID_LENGTH
Definition: sql_const.h:269
static const int MAX_TEXT_LENGTH
The maximal length of the textual representation of a SID, not including the terminating '\0'.
Definition: rpl_gtid.h:1100
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
Definition: table_replication_connection_status.h:71
int received_transaction_set_length
Definition: table_replication_connection_status.h:84
ulonglong last_queued_trx_immediate_commit_timestamp
Definition: table_replication_connection_status.h:92
ulonglong last_queued_trx_end_queue_timestamp
Definition: table_replication_connection_status.h:94
ulonglong queueing_trx_start_queue_timestamp
Definition: table_replication_connection_status.h:99
uint last_queued_trx_length
Definition: table_replication_connection_status.h:90
enum_rpl_connect_status_service_state service_state
Definition: table_replication_connection_status.h:80
ulonglong last_queued_trx_original_commit_timestamp
Definition: table_replication_connection_status.h:91
char group_name[UUID_LENGTH]
Definition: table_replication_connection_status.h:72
void cleanup()
Definition: table_replication_connection_status.h:103
ulonglong queueing_trx_original_commit_timestamp
Definition: table_replication_connection_status.h:97
char last_queued_trx[Gtid::MAX_TEXT_LENGTH+1]
Definition: table_replication_connection_status.h:89
char channel_name[CHANNEL_NAME_LENGTH]
Definition: table_replication_connection_status.h:74
char last_error_message[MAX_SLAVE_ERRMSG]
Definition: table_replication_connection_status.h:86
ulonglong last_queued_trx_start_queue_timestamp
Definition: table_replication_connection_status.h:93
st_row_connect_status()
Definition: table_replication_connection_status.h:101
ulonglong last_heartbeat_timestamp
Definition: table_replication_connection_status.h:82
bool thread_id_is_null
Definition: table_replication_connection_status.h:79
ulonglong thread_id
Definition: table_replication_connection_status.h:78
bool source_uuid_is_null
Definition: table_replication_connection_status.h:77
uint last_error_message_length
Definition: table_replication_connection_status.h:87
char * received_transaction_set
Definition: table_replication_connection_status.h:83
uint channel_name_length
Definition: table_replication_connection_status.h:75
char queueing_trx[Gtid::MAX_TEXT_LENGTH+1]
Definition: table_replication_connection_status.h:95
uint last_error_number
Definition: table_replication_connection_status.h:85
ulonglong last_error_timestamp
Definition: table_replication_connection_status.h:88
bool group_name_is_null
Definition: table_replication_connection_status.h:73
uint queueing_trx_length
Definition: table_replication_connection_status.h:96
ulonglong count_received_heartbeats
Definition: table_replication_connection_status.h:81
char source_uuid[UUID_LENGTH]
Definition: table_replication_connection_status.h:76
ulonglong queueing_trx_immediate_commit_timestamp
Definition: table_replication_connection_status.h:98
Helpers to implement a performance schema table.
enum_rpl_yes_no
Definition: table_replication_applier_configuration.h:49
unsigned int uint
Definition: uca-dump.cc:29