MySQL 8.0.39
Source Code Documentation
table_hosts.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
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_HOSTS_H
25#define TABLE_HOSTS_H
26
27/**
28 @file storage/perfschema/table_hosts.h
29 TABLE HOSTS.
30*/
31
32#include <sys/types.h>
33
37
38struct PFS_host;
39
40/**
41 @addtogroup performance_schema_tables
42 @{
43*/
44
46 public:
48
49 ~PFS_index_hosts_by_host() override = default;
50
51 bool match(PFS_host *pfs) override;
52
53 private:
55};
56
57/**
58 A row of PERFORMANCE_SCHEMA.HOSTS.
59*/
60struct row_hosts {
61 /** Column HOST. */
63 /** Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS. */
65};
66
67/** Table PERFORMANCE_SCHEMA.THREADS. */
69 public:
70 /** Table share */
72 /** Table builder */
74 static int delete_all_rows();
75
76 protected:
77 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
78 bool read_all) override;
79
80 protected:
82
83 public:
84 ~table_hosts() override = default;
85
86 int index_init(uint idx, bool sorted) override;
87
88 private:
89 int make_row(PFS_host *pfs) override;
90
91 /** Table share lock. */
93 /** Table definition. */
95
96 /** Current row. */
98};
99
100/** @} */
101#endif
Definition: field.h:575
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_hosts.h:45
bool match(PFS_host *pfs) override
Definition: table_hosts.cc:81
PFS_index_hosts_by_host()
Definition: table_hosts.h:47
PFS_key_host m_key
Definition: table_hosts.h:54
~PFS_index_hosts_by_host() override=default
Definition: cursor_by_host.h:42
Definition: table_helper.h:1485
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Cursor CURSOR_BY_HOST.
Definition: cursor_by_host.h:52
Table PERFORMANCE_SCHEMA.THREADS.
Definition: table_hosts.h:68
static int delete_all_rows()
Definition: table_hosts.cc:95
static Plugin_table m_table_def
Table definition.
Definition: table_hosts.h:94
static THR_LOCK m_table_lock
Table share lock.
Definition: table_hosts.h:92
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_hosts.cc:91
int make_row(PFS_host *pfs) override
Definition: table_hosts.cc:129
row_hosts m_row
Current row.
Definition: table_hosts.h:97
int index_init(uint idx, bool sorted) override
Definition: table_hosts.cc:121
~table_hosts() override=default
table_hosts()
Definition: table_hosts.cc:119
static PFS_engine_table_share m_share
Table share.
Definition: table_hosts.h:71
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_hosts.cc:152
Cursor CURSOR_BY_HOST (declarations).
Definition: buf0block_hint.cc:30
Data types for columns used in the performance schema tables (declarations)
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Row fragment for connection statistics.
Definition: table_helper.h:1027
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Row fragment for column HOST.
Definition: table_helper.h:527
Per host statistics.
Definition: pfs_host.h:64
Definition: table.h:1399
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.HOSTS.
Definition: table_hosts.h:60
PFS_host_row m_host
Column HOST.
Definition: table_hosts.h:62
PFS_connection_stat_row m_connection_stat
Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS.
Definition: table_hosts.h:64
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca9-dump.cc:75