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