MySQL 9.0.0
Source Code Documentation
table_setup_consumers.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_CONSUMERS_H
25#define TABLE_SETUP_CONSUMERS_H
26
27/**
28 @file storage/perfschema/table_setup_consumers.h
29 Table SETUP_CONSUMERS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "lex_string.h"
35#include "my_base.h"
38
39class Field;
40class Plugin_table;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup performance_schema_tables
46 @{
47*/
48
49/** A row of PERFORMANCE_SCHEMA.SETUP_CONSUMERS. */
51 /** Column NAME. */
53 /** Column ENABLED. */
55 /** Hidden column, instrument refresh. */
57 /** Hidden column, thread refresh. */
59};
60
62 public:
64
65 ~PFS_index_setup_consumers() override = default;
66
67 virtual bool match(row_setup_consumers *row);
68
69 private:
71};
72
73/** Table PERFORMANCE_SCHEMA.SETUP_CONSUMERS. */
75 public:
76 /** Table share. */
79 static ha_rows get_row_count();
80
81 void reset_position() override;
82
83 int rnd_next() override;
84 int rnd_pos(const void *pos) override;
85
86 int index_init(uint idx, bool sorted) override;
87 int index_next() override;
88
89 protected:
90 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
91 bool read_all) override;
92
93 int update_row_values(TABLE *table, const unsigned char *old_buf,
94 unsigned char *new_buf, Field **fields) override;
96
97 public:
98 ~table_setup_consumers() override = default;
99
100 private:
101 /** Table share lock. */
103 /** Table definition. */
105
106 /** Current row. */
108 /** Current position. */
110 /** Next position. */
112
114};
115
116/** @} */
117#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_consumers.h:61
virtual bool match(row_setup_consumers *row)
Definition: table_setup_consumers.cc:143
PFS_key_name m_key
Definition: table_setup_consumers.h:70
PFS_index_setup_consumers()
Definition: table_setup_consumers.h:63
~PFS_index_setup_consumers() override=default
Definition: table_helper.h:1556
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.SETUP_CONSUMERS.
Definition: table_setup_consumers.h:74
int index_next() override
Find key in index, read record.
Definition: table_setup_consumers.cc:203
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_consumers.h:102
int index_init(uint idx, bool sorted) override
Definition: table_setup_consumers.cc:195
row_setup_consumers * m_row
Current row.
Definition: table_setup_consumers.h:107
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_consumers.cc:166
static ha_rows get_row_count()
Definition: table_setup_consumers.cc:157
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_consumers.cc:245
PFS_index_setup_consumers * m_opened_index
Definition: table_setup_consumers.h:113
~table_setup_consumers() override=default
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_setup_consumers.cc:153
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_consumers.cc:171
static Plugin_table m_table_def
Table definition.
Definition: table_setup_consumers.h:104
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_consumers.cc:188
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_consumers.h:77
PFS_simple_index m_pos
Current position.
Definition: table_setup_consumers.h:109
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_setup_consumers.cc:218
PFS_simple_index m_next_pos
Next position.
Definition: table_setup_consumers.h:111
table_setup_consumers()
Definition: table_setup_consumers.cc:159
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
Definition: mysql_lex_string.h:40
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Definition: table.h:1407
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.SETUP_CONSUMERS.
Definition: table_setup_consumers.h:50
bool m_thread_refresh
Hidden column, thread refresh.
Definition: table_setup_consumers.h:58
LEX_CSTRING m_name
Column NAME.
Definition: table_setup_consumers.h:52
bool * m_enabled_ptr
Column ENABLED.
Definition: table_setup_consumers.h:54
bool m_instrument_refresh
Hidden column, instrument refresh.
Definition: table_setup_consumers.h:56
Helpers to implement a performance schema table.