MySQL 9.1.0
Source Code Documentation
table_setup_objects.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_OBJECTS_H
25#define TABLE_SETUP_OBJECTS_H
26
27/**
28 @file storage/perfschema/table_setup_objects.h
29 Table SETUP_OBJECTS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "mysql_com.h"
39
40class Field;
41class Plugin_table;
42struct PFS_setup_object;
43struct TABLE;
44struct THR_LOCK;
45
46/**
47 @addtogroup performance_schema_tables
48 @{
49*/
50
51/** A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
53 /** Column OBJECT_TYPE. */
55 /** Column SCHEMA_NAME. */
57 /** Column OBJECT_NAME. */
59 /** Column ENABLED. */
60 bool *m_enabled_ptr{nullptr};
61 /** Column TIMED. */
62 bool *m_timed_ptr{nullptr};
63};
64
66 public:
69 m_key_1("OBJECT_TYPE"),
70 m_key_2("OBJECT_SCHEMA"),
71 m_key_3("OBJECT_NAME") {}
72
73 ~PFS_index_setup_objects() override = default;
74
75 virtual bool match(PFS_setup_object *pfs);
76
77 private:
81};
82
83/** Table PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
85 public:
86 /** Table share. */
88 /** Table builder. */
91 unsigned char *buf, Field **fields);
92 static int delete_all_rows();
93 static ha_rows get_row_count();
94
95 void reset_position() override;
96
97 int rnd_next() override;
98 int rnd_pos(const void *pos) override;
99
100 int index_init(uint idx, bool sorted) override;
101 int index_next() override;
102
103 protected:
104 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
105 bool read_all) override;
106
107 int update_row_values(TABLE *table, const unsigned char *old_buf,
108 unsigned char *new_buf, Field **fields) override;
109
110 int delete_row_values(TABLE *table, const unsigned char *buf,
111 Field **fields) override;
112
114
115 public:
116 ~table_setup_objects() override = default;
117
118 private:
120
121 /** Table share lock. */
123 /** Table definition. */
125
126 /** Current row. */
128 /** Current position. */
130 /** Next position. */
132
134};
135
136/** @} */
137#endif
Definition: field.h:577
Definition: pfs_engine_table.h:301
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_setup_objects.h:65
PFS_key_object_type_enum m_key_1
Definition: table_setup_objects.h:78
PFS_key_object_name m_key_3
Definition: table_setup_objects.h:80
PFS_key_object_schema m_key_2
Definition: table_setup_objects.h:79
~PFS_index_setup_objects() override=default
virtual bool match(PFS_setup_object *pfs)
Definition: table_setup_objects.cc:96
PFS_index_setup_objects()
Definition: table_setup_objects.h:67
Definition: table_helper.h:1671
Definition: table_helper.h:1656
Definition: table_helper.h:1715
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.SETUP_OBJECTS.
Definition: table_setup_objects.h:84
int index_init(uint idx, bool sorted) override
Definition: table_setup_objects.cc:250
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_objects.cc:222
int index_next() override
Find key in index, read record.
Definition: table_setup_objects.cc:258
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_setup_objects.cc:295
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_setup_objects.cc:375
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_objects.h:87
static int write_row(PFS_engine_table *pfs_table, TABLE *table, unsigned char *buf, Field **fields)
Definition: table_setup_objects.cc:122
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_objects.cc:237
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_objects.h:122
PFS_index_setup_objects * m_opened_index
Definition: table_setup_objects.h:133
PFS_simple_index m_next_pos
Next position.
Definition: table_setup_objects.h:131
table_setup_objects()
Definition: table_setup_objects.cc:211
static int delete_all_rows()
Definition: table_setup_objects.cc:199
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_setup_objects.cc:118
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_objects.cc:217
int make_row(PFS_setup_object *pfs)
Definition: table_setup_objects.cc:278
row_setup_objects m_row
Current row.
Definition: table_setup_objects.h:127
static Plugin_table m_table_def
Table definition.
Definition: table_setup_objects.h:124
PFS_simple_index m_pos
Current position.
Definition: table_setup_objects.h:129
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_objects.cc:340
~table_setup_objects() override=default
static ha_rows get_row_count()
Definition: table_setup_objects.cc:207
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
Data types for columns used in the performance schema tables (declarations)
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:227
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:344
Definition: pfs_name.h:194
A setup_object record.
Definition: pfs_setup_object.h:58
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Definition: table.h:1421
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS.
Definition: table_setup_objects.h:52
bool * m_enabled_ptr
Column ENABLED.
Definition: table_setup_objects.h:60
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_setup_objects.h:56
PFS_object_name m_object_name
Column OBJECT_NAME.
Definition: table_setup_objects.h:58
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_setup_objects.h:54
bool * m_timed_ptr
Column TIMED.
Definition: table_setup_objects.h:62
Helpers to implement a performance schema table.