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