MySQL 8.0.29
Source Code Documentation
table_setup_objects.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_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. */
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(void) 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:573
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:93
PFS_index_setup_objects()
Definition: table_setup_objects.h:66
Definition: table_helper.h:1610
Definition: table_helper.h:1595
Definition: table_helper.h:1654
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:246
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_objects.cc:218
int index_next() override
Find key in index, read record.
Definition: table_setup_objects.cc:255
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:292
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_setup_objects.cc:372
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:119
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_objects.cc:233
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_setup_objects.cc:213
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:210
static int delete_all_rows()
Definition: table_setup_objects.cc:198
static PFS_engine_table * create(PFS_engine_table_share *)
Table builder.
Definition: table_setup_objects.cc:115
int make_row(PFS_setup_object *pfs)
Definition: table_setup_objects.cc:275
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:337
~table_setup_objects() override=default
static ha_rows get_row_count()
Definition: table_setup_objects.cc:206
char * pos
Definition: do_ctype.cc:76
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
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:180
Definition: pfs_name.h:113
A setup_object record.
Definition: pfs_setup_object.h:57
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Definition: table.h:1394
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.
unsigned int uint
Definition: uca-dump.cc:29