MySQL 8.0.39
Source Code Documentation
table_setup_threads.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 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_THREADS_H
25#define TABLE_SETUP_THREADS_H
26
27/**
28 @file storage/perfschema/table_setup_threads.h
29 Table SETUP_THREADS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_instr_class;
41struct PFS_thread_class;
42struct TABLE;
43struct THR_LOCK;
44
45/**
46 @addtogroup performance_schema_tables
47 @{
48*/
49
50/** A row of PERFORMANCE_SCHEMA.SETUP_THREADS. */
52 /** Columns NAME, ENABLED, HISTORY, PROPERTIES, VOLATILITY, DOCUMENTATION. */
54};
55
57 public:
59
60 ~PFS_index_setup_threads() override = default;
61
62 bool match(PFS_instr_class *klass);
63
64 private:
66};
67
68/** Table PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS. */
71
72 public:
73 /** Table share. */
76 static ha_rows get_row_count();
77
78 void reset_position() override;
79
80 int rnd_next() override;
81 int rnd_pos(const void *pos) override;
82
83 int index_init(uint idx, bool sorted) override;
84 int index_next() override;
85
86 protected:
87 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
88 bool read_all) override;
89
90 int update_row_values(TABLE *table, const unsigned char *old_buf,
91 unsigned char *new_buf, Field **fields) override;
92
94
95 public:
96 ~table_setup_threads() override = default;
97
98 private:
99 int make_row(PFS_thread_class *klass);
100
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:575
Definition: pfs_engine_table.h:300
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_setup_threads.h:56
PFS_key_event_name m_key
Definition: table_setup_threads.h:65
bool match(PFS_instr_class *klass)
Definition: table_setup_threads.cc:78
~PFS_index_setup_threads() override=default
PFS_index_setup_threads()
Definition: table_setup_threads.h:58
Definition: table_helper.h:1458
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS.
Definition: table_setup_threads.h:69
pos_t m_next_pos
Next position.
Definition: table_setup_threads.h:111
int make_row(PFS_thread_class *klass)
Definition: table_setup_threads.cc:178
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_threads.h:74
~table_setup_threads() override=default
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_threads.cc:244
PFS_simple_index pos_t
Definition: table_setup_threads.h:70
int index_init(uint idx, bool sorted) override
Definition: table_setup_threads.cc:141
int index_next() override
Find key in index, read record.
Definition: table_setup_threads.cc:152
row_setup_threads m_row
Current row.
Definition: table_setup_threads.h:107
table_setup_threads()
Definition: table_setup_threads.cc:92
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_threads.cc:122
static Plugin_table m_table_def
Table definition.
Definition: table_setup_threads.h:104
PFS_index_setup_threads * m_opened_index
Definition: table_setup_threads.h:113
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_setup_threads.cc:86
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_threads.cc:95
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_threads.h:102
pos_t m_pos
Current position.
Definition: table_setup_threads.h:109
static ha_rows get_row_count()
Definition: table_setup_threads.cc:90
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_threads.cc:100
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_setup_threads.cc:184
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Information for all instrumentation.
Definition: pfs_instr_class.h:205
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:353
Definition: table.h:1399
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.SETUP_THREADS.
Definition: table_setup_threads.h:51
PFS_thread_class * m_instr_class
Columns NAME, ENABLED, HISTORY, PROPERTIES, VOLATILITY, DOCUMENTATION.
Definition: table_setup_threads.h:53
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca9-dump.cc:75