MySQL 8.0.31
Source Code Documentation
table_setup_actors.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 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_SETUP_ACTORS_H
24#define TABLE_SETUP_ACTORS_H
25
26/**
27 @file storage/perfschema/table_setup_actors.h
28 Table SETUP_ACTORS (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
34#include "mysql_com.h"
37
38class Field;
39class Plugin_table;
40struct PFS_setup_actor;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup performance_schema_tables
46 @{
47*/
48
49/** A row of PERFORMANCE_SCHEMA.SETUP_ACTORS. */
51 /** Column HOST. */
53 /** Column USER. */
55 /** Column ROLE. */
57 /** Column ENABLED. */
59 /** Column HISTORY. */
61};
62
64 public:
67 m_key_1("HOST"),
68 m_key_2("USER"),
69 m_key_3("ROLE") {}
70
71 ~PFS_index_setup_actors() override = default;
72
73 virtual bool match(PFS_setup_actor *pfs);
74
75 private:
79};
80
81/** Table PERFORMANCE_SCHEMA.SETUP_ACTORS. */
83 public:
84 /** Table share. */
86 /** Table builder. */
88 static int write_row(PFS_engine_table *pfs_table, TABLE *table,
89 unsigned char *buf, Field **fields);
90 static int delete_all_rows();
91 static ha_rows get_row_count();
92
93 void reset_position(void) override;
94
95 int rnd_next() override;
96 int rnd_pos(const void *pos) override;
97
98 int index_init(uint idx, bool sorted) override;
99 int index_next() override;
100
101 protected:
102 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
103 bool read_all) override;
104
105 int update_row_values(TABLE *table, const unsigned char *old_buf,
106 unsigned char *new_buf, Field **fields) override;
107
108 int delete_row_values(TABLE *table, const unsigned char *buf,
109 Field **fields) override;
110
112
113 public:
114 ~table_setup_actors() override = default;
115
116 private:
117 int make_row(PFS_setup_actor *actor);
118
119 /** Table share lock. */
121 /** Table definition. */
123
124 /** Current row. */
126 /** Current position. */
128 /** Next position. */
130
131 protected:
133};
134
135/** @} */
136#endif
Definition: field.h:574
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_setup_actors.h:63
virtual bool match(PFS_setup_actor *pfs)
Definition: table_setup_actors.cc:78
PFS_key_role m_key_3
Definition: table_setup_actors.h:78
~PFS_index_setup_actors() override=default
PFS_key_host m_key_1
Definition: table_setup_actors.h:76
PFS_key_user m_key_2
Definition: table_setup_actors.h:77
PFS_index_setup_actors()
Definition: table_setup_actors.h:65
Definition: table_helper.h:1458
Definition: table_helper.h:1471
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.SETUP_ACTORS.
Definition: table_setup_actors.h:82
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_actors.cc:185
int make_row(PFS_setup_actor *actor)
Definition: table_setup_actors.cc:244
int index_next() override
Find key in index, read record.
Definition: table_setup_actors.cc:222
int update_row_values(TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields) override
Update the current row values.
Definition: table_setup_actors.cc:298
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_setup_actors.cc:180
static Plugin_table m_table_def
Table definition.
Definition: table_setup_actors.h:122
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_setup_actors.cc:261
static ha_rows get_row_count()
Definition: table_setup_actors.cc:173
int index_init(uint idx, bool sorted) override
Definition: table_setup_actors.cc:213
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_actors.h:85
~table_setup_actors() override=default
table_setup_actors()
Definition: table_setup_actors.cc:177
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_actors.h:120
row_setup_actors m_row
Current row.
Definition: table_setup_actors.h:125
static int write_row(PFS_engine_table *pfs_table, TABLE *table, unsigned char *buf, Field **fields)
Definition: table_setup_actors.cc:104
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_setup_actors.cc:333
PFS_simple_index m_pos
Current position.
Definition: table_setup_actors.h:127
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_actors.cc:200
static int delete_all_rows()
Definition: table_setup_actors.cc:171
PFS_index_setup_actors * m_opened_index
Definition: table_setup_actors.h:132
PFS_simple_index m_next_pos
Next position.
Definition: table_setup_actors.h:129
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_setup_actors.cc:100
char * pos
Definition: do_ctype.cc:76
mysql_service_pfs_plugin_table_v1_t * pfs_table
Definition: log0pfs.cc:46
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
Common definition between mysql server & client.
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Definition: pfs_name.h:243
Definition: pfs_name.h:264
A setup_actor record.
Definition: pfs_setup_actor.h:58
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Definition: pfs_name.h:222
Definition: table.h:1396
Definition: thr_lock.h:138
A row of PERFORMANCE_SCHEMA.SETUP_ACTORS.
Definition: table_setup_actors.h:50
PFS_user_name m_user_name
Column USER.
Definition: table_setup_actors.h:54
bool * m_history_ptr
Column HISTORY.
Definition: table_setup_actors.h:60
bool * m_enabled_ptr
Column ENABLED.
Definition: table_setup_actors.h:58
PFS_host_name m_host_name
Column HOST.
Definition: table_setup_actors.h:52
PFS_role_name m_role_name
Column ROLE.
Definition: table_setup_actors.h:56
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29