MySQL 9.1.0
Source Code Documentation
table_users.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_USERS_H
25#define TABLE_USERS_H
26
27/**
28 @file storage/perfschema/table_users.h
29 TABLE USERS.
30*/
31
32#include <sys/types.h>
33
37
38struct PFS_user;
39
40/**
41 @addtogroup performance_schema_tables
42 @{
43*/
44
45/**
46 A row of PERFORMANCE_SCHEMA.USERS.
47*/
48struct row_users {
49 /** Column USER. */
51 /** Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS. */
53};
54
56 public:
58
59 ~PFS_index_users_by_user() override = default;
60
61 bool match(PFS_user *pfs) override;
62
63 private:
65};
66
67/** Table PERFORMANCE_SCHEMA.USERS. */
69 public:
70 /** Table share */
72 /** Table builder */
74 static int delete_all_rows();
75
76 protected:
77 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
78 bool read_all) override;
79
80 protected:
82
83 public:
84 ~table_users() override = default;
85
86 int index_init(uint idx, bool sorted) override;
87
88 private:
89 int make_row(PFS_user *pfs) override;
90
91 /** Table share lock. */
93 /** Table definition. */
95
96 /** Current row. */
98};
99
100/** @} */
101#endif
Definition: field.h:577
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_users.h:55
~PFS_index_users_by_user() override=default
PFS_index_users_by_user()
Definition: table_users.h:57
PFS_key_user m_key
Definition: table_users.h:64
bool match(PFS_user *pfs) override
Definition: table_users.cc:81
Definition: cursor_by_user.h:42
Definition: table_helper.h:1507
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Cursor CURSOR_BY_USER.
Definition: cursor_by_user.h:52
Table PERFORMANCE_SCHEMA.USERS.
Definition: table_users.h:68
~table_users() override=default
int index_init(uint idx, bool sorted) override
Definition: table_users.cc:121
int make_row(PFS_user *pfs) override
Definition: table_users.cc:128
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_users.cc:91
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_users.cc:151
table_users()
Definition: table_users.cc:119
static int delete_all_rows()
Definition: table_users.cc:95
row_users m_row
Current row.
Definition: table_users.h:97
static THR_LOCK m_table_lock
Table share lock.
Definition: table_users.h:92
static PFS_engine_table_share m_share
Table share.
Definition: table_users.h:71
static Plugin_table m_table_def
Table definition.
Definition: table_users.h:94
Cursor CURSOR_BY_USER (declarations).
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
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 connection statistics.
Definition: table_helper.h:1028
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Row fragment for column USER.
Definition: table_helper.h:540
Per user statistics.
Definition: pfs_user.h:63
Definition: table.h:1421
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.USERS.
Definition: table_users.h:48
PFS_connection_stat_row m_connection_stat
Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS.
Definition: table_users.h:52
PFS_user_row m_user
Column USER.
Definition: table_users.h:50
Helpers to implement a performance schema table.