MySQL 8.3.0
Source Code Documentation
table_ees_global_by_error.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, 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() { m_index = 0; }
79
80 inline void next() { m_index++; }
81
82 inline bool has_more_error() { return (m_index < max_global_server_errors); }
83
84 inline void next_error() { m_index++; }
85};
86
87/** Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_GLOBAL_BY_ERROR. */
89 public:
90 /** Table share */
93 static int delete_all_rows();
94 static ha_rows get_row_count();
95
96 void reset_position() override;
97
98 int rnd_init(bool scan) override;
99 int rnd_next() override;
100 int rnd_pos(const void *pos) override;
101
102 int index_init(uint idx, bool sorted) override;
103 int index_next() override;
104
105 protected:
106 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
107 bool read_all) override;
108
110
111 public:
112 ~table_ees_global_by_error() override = default;
113
114 protected:
115 int make_row(uint error_index);
116
117 private:
118 /** Table share lock. */
120 /** Table definition. */
122
123 /** Current row. */
125 /** Current position. */
127 /** Next position. */
129
130 protected:
132};
133
134/** @} */
135#endif
Definition: field.h:574
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:1379
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:88
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:131
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:91
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ees_global_by_error.h:119
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() 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:124
pos_ees_global_by_error m_pos
Current position.
Definition: table_ees_global_by_error.h:126
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:121
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:128
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
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:1006
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:557
uint m_index
Current row index.
Definition: pfs_engine_table.h:559
Definition: table.h:1403
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
bool has_more_error()
Definition: table_ees_global_by_error.h:82
void reset()
Definition: table_ees_global_by_error.h:78
void next_error()
Definition: table_ees_global_by_error.h:84
void next()
Definition: table_ees_global_by_error.h:80
pos_ees_global_by_error()
Definition: table_ees_global_by_error.h:76
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.