MySQL 8.1.0
Source Code Documentation
table_users.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 2023, 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_USERS_H
24#define TABLE_USERS_H
25
26/**
27 @file storage/perfschema/table_users.h
28 TABLE USERS.
29*/
30
31#include <sys/types.h>
32
36
37struct PFS_user;
38
39/**
40 @addtogroup performance_schema_tables
41 @{
42*/
43
44/**
45 A row of PERFORMANCE_SCHEMA.USERS.
46*/
47struct row_users {
48 /** Column USER. */
50 /** Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS. */
52};
53
55 public:
57
58 ~PFS_index_users_by_user() override = default;
59
60 bool match(PFS_user *pfs) override;
61
62 private:
64};
65
66/** Table PERFORMANCE_SCHEMA.USERS. */
68 public:
69 /** Table share */
71 /** Table builder */
73 static int delete_all_rows();
74
75 protected:
76 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
77 bool read_all) override;
78
79 protected:
81
82 public:
83 ~table_users() override = default;
84
85 int index_init(uint idx, bool sorted) override;
86
87 private:
88 int make_row(PFS_user *pfs) override;
89
90 /** Table share lock. */
92 /** Table definition. */
94
95 /** Current row. */
97};
98
99/** @} */
100#endif
Definition: field.h:575
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_users.h:54
~PFS_index_users_by_user() override=default
PFS_index_users_by_user()
Definition: table_users.h:56
PFS_key_user m_key
Definition: table_users.h:63
bool match(PFS_user *pfs) override
Definition: table_users.cc:80
Definition: cursor_by_user.h:41
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_USER.
Definition: cursor_by_user.h:51
Table PERFORMANCE_SCHEMA.USERS.
Definition: table_users.h:67
~table_users() override=default
int index_init(uint idx, bool sorted) override
Definition: table_users.cc:120
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:90
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:118
static int delete_all_rows()
Definition: table_users.cc:94
row_users m_row
Current row.
Definition: table_users.h:96
static THR_LOCK m_table_lock
Table share lock.
Definition: table_users.h:91
static PFS_engine_table_share m_share
Table share.
Definition: table_users.h:70
static Plugin_table m_table_def
Table definition.
Definition: table_users.h:93
Cursor CURSOR_BY_USER (declarations).
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
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 connection statistics.
Definition: table_helper.h:1000
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for column USER.
Definition: table_helper.h:539
Per user statistics.
Definition: pfs_user.h:62
Definition: table.h:1394
Definition: thr_lock.h:138
A row of PERFORMANCE_SCHEMA.USERS.
Definition: table_users.h:47
PFS_connection_stat_row m_connection_stat
Columns CURRENT_CONNECTIONS, TOTAL_CONNECTIONS.
Definition: table_users.h:51
PFS_user_row m_user
Column USER.
Definition: table_users.h:49
Helpers to implement a performance schema table.