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