1 /* 2 Copyright (c) 2013, 2021, 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 25 #ifndef TABLE_REPLICATION_GROUP_MEMBERS_H 26 #define TABLE_REPLICATION_GROUP_MEMBERS_H 27 28 /** 29 @file storage/perfschema/table_replication_group_members.h 30 Table replication_group_members (declarations). 31 */ 32 33 #include "pfs_column_types.h" 34 #include "pfs_engine_table.h" 35 #include "mysql_com.h" 36 #include "rpl_info.h" 37 #include <mysql/plugin_group_replication.h> 38 39 /** 40 @addtogroup Performance_schema_tables 41 @{ 42 */ 43 44 /** 45 A row in connection nodes table. The fields with string values have an additional 46 length field denoted by <field_name>_length. 47 */ 48 struct st_row_group_members { 49 char channel_name[CHANNEL_NAME_LENGTH]; 50 uint channel_name_length; 51 char member_id[UUID_LENGTH]; 52 uint member_id_length; 53 char member_host[HOSTNAME_LENGTH]; 54 uint member_host_length; 55 uint member_port; 56 char member_state[NAME_LEN]; 57 uint member_state_length; 58 }; 59 60 /** Table PERFORMANCE_SCHEMA.replication_group_members. */ 61 class table_replication_group_members: public PFS_engine_table 62 { 63 private: 64 void make_row(uint index); 65 /** Table share lock. */ 66 static THR_LOCK m_table_lock; 67 /** Fields definition. */ 68 static TABLE_FIELD_DEF m_field_def; 69 /** True if the current row exists. */ 70 bool m_row_exists; 71 /** Current row */ 72 st_row_group_members m_row; 73 /** Current position. */ 74 PFS_simple_index m_pos; 75 /** Next position. */ 76 PFS_simple_index m_next_pos; 77 78 protected: 79 /** 80 Read the current row values. 81 @param table Table handle 82 @param buf row buffer 83 @param fields Table fields 84 @param read_all true if all columns are read. 85 */ 86 87 virtual int read_row_values(TABLE *table, 88 unsigned char *buf, 89 Field **fields, 90 bool read_all); 91 92 table_replication_group_members(); 93 94 public: 95 ~table_replication_group_members(); 96 97 /** Table share. */ 98 static PFS_engine_table_share m_share; 99 static PFS_engine_table* create(); 100 static ha_rows get_row_count(); 101 virtual int rnd_next(); 102 virtual int rnd_pos(const void *pos); 103 virtual void reset_position(void); 104 105 }; 106 107 /** @} */ 108 #endif 109