MySQL 9.0.0
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. */
59 bool *m_enabled_ptr{nullptr};
60 /** Column HISTORY. */
61 bool *m_history_ptr{nullptr};
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. */
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:577
Definition: pfs_engine_table.h:300
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:81
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:1506
Definition: table_helper.h:1519
Definition: table_helper.h:1494
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:191
int index_next() override
Find key in index, read record.
Definition: table_setup_actors.cc:227
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:303
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:266
static ha_rows get_row_count()
Definition: table_setup_actors.cc:176
int index_init(uint idx, bool sorted) override
Definition: table_setup_actors.cc:219
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:180
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:107
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_actors.cc:186
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_setup_actors.cc:338
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:206
static int delete_all_rows()
Definition: table_setup_actors.cc:174
int make_row(PFS_setup_actor *pfs)
Definition: table_setup_actors.cc:249
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:103
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:1141
Common definition between mysql server & client.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
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:358
Definition: pfs_name.h:522
Definition: pfs_name.h:566
A setup_actor record.
Definition: pfs_setup_actor.h:59
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Definition: pfs_name.h:478
Definition: table.h:1407
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.