MySQL 8.0.29
Source Code Documentation
table_accounts.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 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_ACCOUNTS_H
24#define TABLE_ACCOUNTS_H
25
26/**
27 @file storage/perfschema/table_accounts.h
28 TABLE ACCOUNTS.
29*/
30
31#include <sys/types.h>
32
36
37struct PFS_account;
38
39/**
40 @addtogroup performance_schema_tables
41 @{
42*/
43
44/**
45 A row of PERFORMANCE_SCHEMA.ACCOUNTS.
46*/
48 /** Column USER, HOST. */
50 /** Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS. */
52};
53
55 public:
58 m_key_1("USER"),
59 m_key_2("HOST") {}
60
62
63 bool match(PFS_account *pfs) override;
64
65 private:
68};
69
70/** Table PERFORMANCE_SCHEMA.ACCOUNTS. */
72 public:
73 /** Table share */
75 /** Table builder */
77 static int delete_all_rows();
78
79 protected:
80 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
81 bool read_all) override;
82
83 protected:
85
86 public:
87 ~table_accounts() override = default;
88
89 int index_init(uint idx, bool sorted) override;
90
91 private:
92 int make_row(PFS_account *pfs) override;
93
94 /** Table share lock. */
96 /** Table definition. */
98 /** Current row. */
100};
101
102/** @} */
103#endif
Definition: field.h:573
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_accounts.h:54
PFS_key_host m_key_2
Definition: table_accounts.h:67
bool match(PFS_account *pfs) override
Definition: table_accounts.cc:78
PFS_key_user m_key_1
Definition: table_accounts.h:66
PFS_index_accounts_by_user_host()
Definition: table_accounts.h:56
~PFS_index_accounts_by_user_host() override=default
Definition: cursor_by_account.h:41
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
Cursor CURSOR_BY_ACCOUNT.
Definition: cursor_by_account.h:55
Table PERFORMANCE_SCHEMA.ACCOUNTS.
Definition: table_accounts.h:71
int make_row(PFS_account *pfs) override
Definition: table_accounts.cc:125
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_accounts.cc:94
static PFS_engine_table_share m_share
Table share.
Definition: table_accounts.h:74
table_accounts()
Definition: table_accounts.cc:115
row_accounts m_row
Current row.
Definition: table_accounts.h:99
static int delete_all_rows()
Definition: table_accounts.cc:98
static Plugin_table m_table_def
Table definition.
Definition: table_accounts.h:97
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_accounts.cc:147
int index_init(uint idx, bool sorted) override
Definition: table_accounts.cc:117
static THR_LOCK m_table_lock
Table share lock.
Definition: table_accounts.h:95
~table_accounts() override=default
Cursor CURSOR_BY_ACCOUNT (declarations).
Definition: buf0block_hint.cc:29
Data types for columns used in the performance schema tables (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
Row fragment for connection statistics.
Definition: table_helper.h:1008
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Definition: table.h:1394
Definition: thr_lock.h:138
A row of PERFORMANCE_SCHEMA.ACCOUNTS.
Definition: table_accounts.h:47
PFS_account_row m_account
Column USER, HOST.
Definition: table_accounts.h:49
PFS_connection_stat_row m_connection_stat
Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS.
Definition: table_accounts.h:51
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29