MySQL 8.3.0
Source Code Documentation
table_setup_objects.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 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_SETUP_OBJECTS_H
24#define TABLE_SETUP_OBJECTS_H
25
26/**
27 @file storage/perfschema/table_setup_objects.h
28 Table SETUP_OBJECTS (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
34#include "mysql_com.h"
38
39class Field;
40class Plugin_table;
41struct PFS_setup_object;
42struct TABLE;
43struct THR_LOCK;
44
45/**
46 @addtogroup performance_schema_tables
47 @{
48*/
49
50/** A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
52 /** Column OBJECT_TYPE. */
54 /** Column SCHEMA_NAME. */
56 /** Column OBJECT_NAME. */
58 /** Column ENABLED. */
60 /** Column TIMED. */
62};
63
65 public:
68 m_key_1("OBJECT_TYPE"),
69 m_key_2("OBJECT_SCHEMA"),
70 m_key_3("OBJECT_NAME") {}
71
72 ~PFS_index_setup_objects() override = default;
73
74 virtual bool match(PFS_setup_object *pfs);
75
76 private:
80};
81
82/** Table PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
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_objects() override = default;
116
117 private:
119
120 /** Table share lock. */
122 /** Table definition. */
124
125 /** Current row. */
127 /** Current position. */
129 /** Next position. */
131
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_objects.h:64
PFS_key_object_type_enum m_key_1
Definition: table_setup_objects.h:77
PFS_key_object_name m_key_3
Definition: table_setup_objects.h:79
PFS_key_object_schema m_key_2
Definition: table_setup_objects.h:78
~PFS_index_setup_objects() override=default
virtual bool match(PFS_setup_object *pfs)
Definition: table_setup_objects.cc:95
PFS_index_setup_objects()
Definition: table_setup_objects.h:66
Definition: table_helper.h:1655
Definition: table_helper.h:1640
Definition: table_helper.h:1699
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.SETUP_OBJECTS.
Definition: table_setup_objects.h:83
int index_init(uint idx, bool sorted) override
Definition: table_setup_objects.cc:248
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_objects.cc:220
int index_next() override
Find key in index, read record.
Definition: table_setup_objects.cc:257
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:294
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_setup_objects.cc:374
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_objects.h:86
static int write_row(PFS_engine_table *pfs_table, TABLE *table, unsigned char *buf, Field **fields)
Definition: table_setup_objects.cc:121
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_objects.cc:235
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_objects.h:121
PFS_index_setup_objects * m_opened_index
Definition: table_setup_objects.h:132
PFS_simple_index m_next_pos
Next position.
Definition: table_setup_objects.h:130
table_setup_objects()
Definition: table_setup_objects.cc:212
static int delete_all_rows()
Definition: table_setup_objects.cc:200
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_setup_objects.cc:117
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_objects.cc:215
int make_row(PFS_setup_object *pfs)
Definition: table_setup_objects.cc:277
row_setup_objects m_row
Current row.
Definition: table_setup_objects.h:126
static Plugin_table m_table_def
Table definition.
Definition: table_setup_objects.h:123
PFS_simple_index m_pos
Current position.
Definition: table_setup_objects.h:128
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:339
~table_setup_objects() override=default
static ha_rows get_row_count()
Definition: table_setup_objects.cc:208
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:1140
Common definition between mysql server & client.
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)
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:221
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:337
Definition: pfs_name.h:187
A setup_object record.
Definition: pfs_setup_object.h:57
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:557
Definition: table.h:1403
Definition: thr_lock.h:138
A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS.
Definition: table_setup_objects.h:51
bool * m_enabled_ptr
Column ENABLED.
Definition: table_setup_objects.h:59
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_setup_objects.h:55
PFS_object_name m_object_name
Column OBJECT_NAME.
Definition: table_setup_objects.h:57
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_setup_objects.h:53
bool * m_timed_ptr
Column TIMED.
Definition: table_setup_objects.h:61
Helpers to implement a performance schema table.