MySQL 8.0.29
Source Code Documentation
table_ees_by_account_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_ACCOUNT_BY_ERROR_H
24#define TABLE_EES_BY_ACCOUNT_BY_ERROR_H
25
26/**
27 @file storage/perfschema/table_ees_by_account_by_error.h
28 Table EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_BY_ERROR (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_account;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup Performance_schema_tables
46 @{
47*/
48
50 public:
53 m_key_1("USER"),
54 m_key_2("HOST"),
55 m_key_3("ERROR_NUMBER") {}
56
58
59 virtual bool match(PFS_account *pfs);
60 virtual bool match_error_index(uint error_index);
61
62 private:
66};
67
68/**
69 A row of table
70 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_BY_ERROR.
71*/
73 /** Columns USER, HOST. */
75 /** Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR. */
77};
78
79/**
80 Position of a cursor on
81 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_BY_ERROR.
82 Index 1 on account (0 based)
83 Index 2 on error (0 based)
84*/
87
88 inline void reset(void) {
89 m_index_1 = 0;
90 m_index_2 = 0;
91 }
92
93 inline void next_account(void) {
94 m_index_1++;
95 m_index_2 = 0;
96 }
97
98 inline bool has_more_error(void) {
100 }
101
102 inline void next_error(void) { m_index_2++; }
103};
104
105/** Table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_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(void) 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_account_by_error() override = default;
131
132 protected:
133 int make_row(PFS_account *account, 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:573
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_ees_by_account_by_error.h:49
PFS_key_host m_key_2
Definition: table_ees_by_account_by_error.h:64
virtual bool match(PFS_account *pfs)
Definition: table_ees_by_account_by_error.cc:82
~PFS_index_ees_by_account_by_error() override=default
PFS_key_user m_key_1
Definition: table_ees_by_account_by_error.h:63
PFS_index_ees_by_account_by_error()
Definition: table_ees_by_account_by_error.h:51
virtual bool match_error_index(uint error_index)
Definition: table_ees_by_account_by_error.cc:98
PFS_key_error_number m_key_3
Definition: table_ees_by_account_by_error.h:65
Definition: table_helper.h:1351
Definition: table_helper.h:1458
Definition: table_helper.h:1446
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_ACCOUNT_BY_ERROR.
Definition: table_ees_by_account_by_error.h:106
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_ees_by_account_by_error.cc:132
int index_init(uint idx, bool sorted) override
Definition: table_ees_by_account_by_error.cc:170
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_ees_by_account_by_error.cc:134
row_ees_by_account_by_error m_row
Current row.
Definition: table_ees_by_account_by_error.h:142
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ees_by_account_by_error.cc:153
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_ees_by_account_by_error.cc:127
PFS_index_ees_by_account_by_error * m_opened_index
Definition: table_ees_by_account_by_error.h:148
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ees_by_account_by_error.cc:108
static ha_rows get_row_count()
Definition: table_ees_by_account_by_error.cc:119
int index_next() override
Find key in index, read record.
Definition: table_ees_by_account_by_error.cc:179
~table_ees_by_account_by_error() override=default
static int delete_all_rows()
Definition: table_ees_by_account_by_error.cc:113
int make_row(PFS_account *account, int error_index)
Definition: table_ees_by_account_by_error.cc:202
static Plugin_table m_table_def
Table definition.
Definition: table_ees_by_account_by_error.h:139
pos_ees_by_account_by_error m_pos
Current position.
Definition: table_ees_by_account_by_error.h:144
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_ees_by_account_by_error.cc:227
pos_ees_by_account_by_error m_next_pos
Next position.
Definition: table_ees_by_account_by_error.h:146
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ees_by_account_by_error.h:137
table_ees_by_account_by_error()
Definition: table_ees_by_account_by_error.cc:124
static PFS_engine_table_share m_share
Table share.
Definition: table_ees_by_account_by_error.h:109
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_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
Row fragment for columns USER, HOST.
Definition: table_helper.h:565
Per account statistics.
Definition: pfs_account.h:66
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
Definition: table.h:1394
Definition: thr_lock.h:138
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_BY_ERROR.
Definition: table_ees_by_account_by_error.h:85
void next_error(void)
Definition: table_ees_by_account_by_error.h:102
bool has_more_error(void)
Definition: table_ees_by_account_by_error.h:98
pos_ees_by_account_by_error()
Definition: table_ees_by_account_by_error.h:86
void reset(void)
Definition: table_ees_by_account_by_error.h:88
void next_account(void)
Definition: table_ees_by_account_by_error.h:93
A row of table PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_ACCOUNT_BY_ERROR.
Definition: table_ees_by_account_by_error.h:72
PFS_account_row m_account
Columns USER, HOST.
Definition: table_ees_by_account_by_error.h:74
PFS_error_stat_row m_stat
Columns ERROR_NUMBER, ERROR_NAME, COUNT_STAR.
Definition: table_ees_by_account_by_error.h:76
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29