MySQL 9.0.0
Source Code Documentation
table_ees_by_thread_by_error.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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_EES_BY_THREAD_BY_EVENT_NAME_H
25#define TABLE_EES_BY_THREAD_BY_EVENT_NAME_H
26
27/**
28 @file storage/perfschema/table_ees_by_thread_by_error.h
29 Table EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_inttypes.h"
39
40class Field;
41class Plugin_table;
42struct PFS_thread;
43struct TABLE;
44struct THR_LOCK;
45
46/**
47 @addtogroup Performance_schema_tables
48 @{
49*/
50
52 public:
55 m_key_1("THREAD_ID"),
56 m_key_2("ERROR_NUMBER") {}
57
59
60 virtual bool match(PFS_thread *pfs);
61 virtual bool match_error_index(uint error_index);
62
63 private:
66};
67
68/**
69 A row of table
70 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR.
71*/
73 /** Column THREAD_ID. */
75 /** Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR. */
77};
78
79/**
80 Position of a cursor on
81 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR.
82 Index 1 on thread (0 based).
83 Index 2 on error (0 based)
84*/
87
88 inline void reset() {
89 m_index_1 = 0;
90 m_index_2 = 0;
91 }
92
93 inline void next_thread() {
94 m_index_1++;
95 m_index_2 = 0;
96 }
97
98 inline bool has_more_error() {
100 }
101
102 inline void next_error() { m_index_2++; }
103};
104
105/** Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR. */
107 public:
108 /** Table share */
111 static int delete_all_rows();
112 static ha_rows get_row_count();
113
114 void reset_position() override;
115
116 int rnd_init(bool scan) override;
117 int rnd_next() override;
118 int rnd_pos(const void *pos) override;
119
120 int index_init(uint idx, bool sorted) override;
121 int index_next() override;
122
123 protected:
124 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
125 bool read_all) override;
126
128
129 public:
130 ~table_ees_by_thread_by_error() override = default;
131
132 protected:
133 int make_row(PFS_thread *thread, int error_index);
134
135 private:
136 /** Table share lock. */
138 /** Table definition. */
140
141 /** Current row. */
143 /** Current position. */
145 /** Next position. */
147
149};
150
151/** @} */
152#endif
Definition: field.h:577
Definition: pfs_engine_table.h:300
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_ees_by_thread_by_error.h:51
virtual bool match(PFS_thread *pfs)
Definition: table_ees_by_thread_by_error.cc:45
PFS_key_error_number m_key_2
Definition: table_ees_by_thread_by_error.h:65
~PFS_index_ees_by_thread_by_error() override=default
PFS_key_thread_id m_key_1
Definition: table_ees_by_thread_by_error.h:64
virtual bool match_error_index(uint error_index)
Definition: table_ees_by_thread_by_error.cc:55
PFS_index_ees_by_thread_by_error()
Definition: table_ees_by_thread_by_error.h:53
Definition: table_helper.h:1380
Definition: table_helper.h:1279
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR.
Definition: table_ees_by_thread_by_error.h:106
static ha_rows get_row_count()
Definition: table_ees_by_thread_by_error.cc:112
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_ees_by_thread_by_error.cc:216
row_ees_by_thread_by_error m_row
Current row.
Definition: table_ees_by_thread_by_error.h:142
table_ees_by_thread_by_error()
Definition: table_ees_by_thread_by_error.cc:117
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ees_by_thread_by_error.cc:146
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_ees_by_thread_by_error.cc:125
static Plugin_table m_table_def
Table definition.
Definition: table_ees_by_thread_by_error.h:139
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_ees_by_thread_by_error.cc:127
~table_ees_by_thread_by_error() override=default
PFS_index_ees_by_thread_by_error * m_opened_index
Definition: table_ees_by_thread_by_error.h:148
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ees_by_thread_by_error.cc:102
pos_ees_by_thread_by_error m_pos
Current position.
Definition: table_ees_by_thread_by_error.h:144
static int delete_all_rows()
Definition: table_ees_by_thread_by_error.cc:107
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ees_by_thread_by_error.h:137
int make_row(PFS_thread *thread, int error_index)
Definition: table_ees_by_thread_by_error.cc:194
int index_next() override
Find key in index, read record.
Definition: table_ees_by_thread_by_error.cc:171
pos_ees_by_thread_by_error m_next_pos
Next position.
Definition: table_ees_by_thread_by_error.h:146
int index_init(uint idx, bool sorted) override
Definition: table_ees_by_thread_by_error.cc:163
static PFS_engine_table_share m_share
Table share.
Definition: table_ees_by_thread_by_error.h:109
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_ees_by_thread_by_error.cc:120
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
uint max_session_server_errors
Definition: pfs_error.cc:43
server error instrument data structures (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:601
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:603
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:605
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Row fragment for error statistics columns.
Definition: table_helper.h:1007
Instrumented thread implementation.
Definition: pfs_instr.h:375
Definition: table.h:1407
Definition: thr_lock.h:139
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR.
Definition: table_ees_by_thread_by_error.h:85
bool has_more_error()
Definition: table_ees_by_thread_by_error.h:98
void next_thread()
Definition: table_ees_by_thread_by_error.h:93
pos_ees_by_thread_by_error()
Definition: table_ees_by_thread_by_error.h:86
void reset()
Definition: table_ees_by_thread_by_error.h:88
void next_error()
Definition: table_ees_by_thread_by_error.h:102
A row of table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_THREAD_BY_ERROR.
Definition: table_ees_by_thread_by_error.h:72
ulonglong m_thread_internal_id
Column THREAD_ID.
Definition: table_ees_by_thread_by_error.h:74
PFS_error_stat_row m_stat
Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR.
Definition: table_ees_by_thread_by_error.h:76
Helpers to implement a performance schema table.