MySQL 8.0.29
Source Code Documentation
table_ees_global_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_GLOBAL_BY_EVENT_NAME_H
24#define TABLE_EES_GLOBAL_BY_EVENT_NAME_H
25
26/**
27 @file storage/perfschema/table_ees_global_by_error.h
28 Table EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct TABLE;
41struct THR_LOCK;
42
43/**
44 @addtogroup Performance_schema_tables
45 @{
46*/
47
49 public:
51 : PFS_engine_index(&m_key), m_key("ERROR_NUMBER") {}
52
53 ~PFS_index_ees_global_by_error() override = default;
54
55 virtual bool match_error_index(uint error_index);
56
57 private:
59};
60
61/**
62 A row of table
63 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR.
64*/
66 /** Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR. */
68};
69
70/**
71 Position of a cursor on
72 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR.
73 Index 1 on error (0 based)
74*/
77
78 inline void reset(void) { m_index = 0; }
79
80 inline void next(void) { m_index++; }
81
82 inline bool has_more_error(void) {
84 }
85
86 inline void next_error(void) { m_index++; }
87};
88
89/** Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR. */
91 public:
92 /** Table share */
95 static int delete_all_rows();
96 static ha_rows get_row_count();
97
98 void reset_position(void) override;
99
100 int rnd_init(bool scan) override;
101 int rnd_next() override;
102 int rnd_pos(const void *pos) override;
103
104 int index_init(uint idx, bool sorted) override;
105 int index_next() override;
106
107 protected:
108 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
109 bool read_all) override;
110
112
113 public:
114 ~table_ees_global_by_error() override = default;
115
116 protected:
117 int make_row(uint error_index);
118
119 private:
120 /** Table share lock. */
122 /** Table definition. */
124
125 /** Current row. */
127 /** Current position. */
129 /** Next position. */
131
132 protected:
134};
135
136/** @} */
137#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_global_by_error.h:48
virtual bool match_error_index(uint error_index)
Definition: table_ees_global_by_error.cc:81
PFS_index_ees_global_by_error()
Definition: table_ees_global_by_error.h:50
~PFS_index_ees_global_by_error() override=default
PFS_key_error_number m_key
Definition: table_ees_global_by_error.h:58
Definition: table_helper.h:1351
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_GLOBAL_BY_ERROR.
Definition: table_ees_global_by_error.h:90
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_ees_global_by_error.cc:194
PFS_index_ees_global_by_error * m_opened_index
Definition: table_ees_global_by_error.h:133
int make_row(uint error_index)
Definition: table_ees_global_by_error.cc:166
static int delete_all_rows()
Definition: table_ees_global_by_error.cc:94
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_ees_global_by_error.cc:115
static PFS_engine_table_share m_share
Table share.
Definition: table_ees_global_by_error.h:93
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ees_global_by_error.h:121
int index_init(uint idx, bool sorted) override
Definition: table_ees_global_by_error.cc:142
static ha_rows get_row_count()
Definition: table_ees_global_by_error.cc:103
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_ees_global_by_error.cc:110
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_ees_global_by_error.cc:117
row_ees_global_by_error m_row
Current row.
Definition: table_ees_global_by_error.h:126
pos_ees_global_by_error m_pos
Current position.
Definition: table_ees_global_by_error.h:128
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ees_global_by_error.cc:90
~table_ees_global_by_error() override=default
static Plugin_table m_table_def
Table definition.
Definition: table_ees_global_by_error.h:123
table_ees_global_by_error()
Definition: table_ees_global_by_error.cc:107
int index_next() override
Find key in index, read record.
Definition: table_ees_global_by_error.cc:151
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ees_global_by_error.cc:130
pos_ees_global_by_error m_next_pos
Next position.
Definition: table_ees_global_by_error.h:130
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
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
uint max_global_server_errors
Definition: pfs_error.cc:41
server error instrument data structures (declarations).
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for error statistics columns.
Definition: table_helper.h:987
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
uint m_index
Current row index.
Definition: pfs_engine_table.h:560
Definition: table.h:1394
Definition: thr_lock.h:138
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR.
Definition: table_ees_global_by_error.h:75
void reset(void)
Definition: table_ees_global_by_error.h:78
void next(void)
Definition: table_ees_global_by_error.h:80
bool has_more_error(void)
Definition: table_ees_global_by_error.h:82
pos_ees_global_by_error()
Definition: table_ees_global_by_error.h:76
void next_error(void)
Definition: table_ees_global_by_error.h:86
A row of table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR.
Definition: table_ees_global_by_error.h:65
PFS_error_stat_row m_stat
Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR.
Definition: table_ees_global_by_error.h:67
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29