MySQL 8.0.29
Source Code Documentation
table_ees_by_host_by_error.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2022, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef TABLE_EES_BY_HOST_BY_ERROR_H
24#define TABLE_EES_BY_HOST_BY_ERROR_H
25
26/**
27 @file storage/perfschema/table_ees_by_host_by_error.h
28 Table EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_host;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup Performance_schema_tables
46 @{
47*/
48
50 public:
53 m_key_1("HOST"),
54 m_key_2("ERROR_NUMBER") {}
55
56 ~PFS_index_ees_by_host_by_error() override = default;
57
58 virtual bool match(PFS_host *pfs);
59 virtual bool match_error_index(uint error_index);
60
61 private:
64};
65
66/**
67 A row of table
68 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR.
69*/
71 /** Column HOST */
73 /** Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR. */
75};
76
77/**
78 Position of a cursor on
79 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR.
80 Index 1 on host (0 based)
81 Index 2 on error (0 based)
82*/
85
86 inline void reset(void) {
87 m_index_1 = 0;
88 m_index_2 = 0;
89 }
90
91 inline void next_host(void) {
92 m_index_1++;
93 m_index_2 = 0;
94 }
95
96 inline bool has_more_error(void) {
98 }
99
100 inline void next_error(void) { m_index_2++; }
101};
102
103/** Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR. */
105 public:
106 /** Table share */
109 static int delete_all_rows();
110 static ha_rows get_row_count();
111
112 void reset_position(void) override;
113
114 int rnd_init(bool scan) override;
115 int rnd_next() override;
116 int rnd_pos(const void *pos) override;
117
118 int index_init(uint idx, bool sorted) override;
119 int index_next() override;
120
121 protected:
122 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
123 bool read_all) override;
124
126
127 public:
128 ~table_ees_by_host_by_error() override = default;
129
130 protected:
131 int make_row(PFS_host *host, int error_index);
132
133 private:
134 /** Table share lock. */
136 /** Table definition. */
138
139 /** Current row. */
141 /** Current position. */
143 /** Next position. */
145
147};
148
149/** @} */
150#endif
Definition: field.h:573
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_ees_by_host_by_error.h:49
~PFS_index_ees_by_host_by_error() override=default
virtual bool match_error_index(uint error_index)
Definition: table_ees_by_host_by_error.cc:91
virtual bool match(PFS_host *pfs)
Definition: table_ees_by_host_by_error.cc:82
PFS_key_host m_key_1
Definition: table_ees_by_host_by_error.h:62
PFS_key_error_number m_key_2
Definition: table_ees_by_host_by_error.h:63
PFS_index_ees_by_host_by_error()
Definition: table_ees_by_host_by_error.h:51
Definition: table_helper.h:1351
Definition: table_helper.h:1458
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR.
Definition: table_ees_by_host_by_error.h:104
int index_init(uint idx, bool sorted) override
Definition: table_ees_by_host_by_error.cc:162
static Plugin_table m_table_def
Table definition.
Definition: table_ees_by_host_by_error.h:137
static int delete_all_rows()
Definition: table_ees_by_host_by_error.cc:104
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ees_by_host_by_error.h:135
int index_next() override
Find key in index, read record.
Definition: table_ees_by_host_by_error.cc:171
static ha_rows get_row_count()
Definition: table_ees_by_host_by_error.cc:111
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ees_by_host_by_error.cc:100
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_ees_by_host_by_error.cc:219
row_ees_by_host_by_error m_row
Current row.
Definition: table_ees_by_host_by_error.h:140
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_ees_by_host_by_error.cc:126
PFS_index_ees_by_host_by_error * m_opened_index
Definition: table_ees_by_host_by_error.h:146
int make_row(PFS_host *host, int error_index)
Definition: table_ees_by_host_by_error.cc:194
static PFS_engine_table_share m_share
Table share.
Definition: table_ees_by_host_by_error.h:107
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_ees_by_host_by_error.cc:119
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ees_by_host_by_error.cc:145
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_ees_by_host_by_error.cc:124
pos_ees_by_host_by_error m_pos
Current position.
Definition: table_ees_by_host_by_error.h:142
table_ees_by_host_by_error()
Definition: table_ees_by_host_by_error.cc:116
~table_ees_by_host_by_error() override=default
pos_ees_by_host_by_error m_next_pos
Next position.
Definition: table_ees_by_host_by_error.h:144
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
const char * host
Definition: mysqladmin.cc:58
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
uint max_session_server_errors
Definition: pfs_error.cc:42
server error instrument data structures (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:593
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:595
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:597
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for error statistics columns.
Definition: table_helper.h:987
Row fragment for column HOST.
Definition: table_helper.h:541
Per host statistics.
Definition: pfs_host.h:62
Definition: table.h:1394
Definition: thr_lock.h:138
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR.
Definition: table_ees_by_host_by_error.h:83
pos_ees_by_host_by_error()
Definition: table_ees_by_host_by_error.h:84
bool has_more_error(void)
Definition: table_ees_by_host_by_error.h:96
void next_error(void)
Definition: table_ees_by_host_by_error.h:100
void reset(void)
Definition: table_ees_by_host_by_error.h:86
void next_host(void)
Definition: table_ees_by_host_by_error.h:91
A row of table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_HOST_BY_ERROR.
Definition: table_ees_by_host_by_error.h:70
PFS_host_row m_host
Column HOST.
Definition: table_ees_by_host_by_error.h:72
PFS_error_stat_row m_stat
Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR.
Definition: table_ees_by_host_by_error.h:74
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29