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