MySQL 8.0.37
Source Code Documentation
table_plugin_table.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_PLUGIN_TABLE_H
25#define TABLE_PLUGIN_TABLE_H
26
27/**
28 @file storage/perfschema/table_plugin_table.h
29 plugins/components tables (declarations).
30*/
31
33
35
36/**
37 @addtogroup Performance_schema_tables
38 @{
39*/
40
42
44 public:
45 /** Table share */
49
51 int delete_all_rows();
52 /*
53 PFS_engine_table* open();
54 ha_rows get_row_count();
55 */
56
57 void reset_position() override;
58
59 int rnd_init(bool scan) override;
60 int rnd_next() override;
61 int rnd_pos(const void *pos) override;
62
63 int index_init(uint idx, bool sorted) override;
64 int index_next() override;
65
66 int write_row(PSI_field *field, uint index, bool finished);
67
69
71
72 protected:
73 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
74 bool read_all) override;
75
76 int update_row_values(TABLE *table, const unsigned char *, unsigned char *,
77 Field **fields) override;
78
79 int delete_row_values(TABLE *table, const unsigned char *buf,
80 Field **fields) override;
81
82 public:
84 delete m_index;
85 m_st_table->close_table(this->plugin_table_handle);
86 }
87
88 private:
89 /** Table share lock. */
91
92 /** True is the current row exists. */
94
95 /** Current position. */
97 /** Next position. */
99
101};
102
104 public:
106 : m_st_table(st_table), m_idx(0), m_plugin_index(nullptr) {}
107
108 ~PFS_plugin_table_index() override = default;
109
110 int init(PSI_table_handle *table, uint idx, bool sorted);
111
112 int index_next(PSI_table_handle *table);
113
114 void read_key(const uchar *key, uint key_len,
115 enum ha_rkey_function find_flag) override;
116
117 private:
121};
122
123/** @} */
124#endif
Definition: field.h:575
Definition: pfs_engine_table.h:284
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
PFS_engine_index_abstract * m_index
Current index.
Definition: pfs_engine_table.h:180
Definition: table_plugin_table.h:103
void read_key(const uchar *key, uint key_len, enum ha_rkey_function find_flag) override
Definition: table_plugin_table.cc:49
int index_next(PSI_table_handle *table)
Definition: table_plugin_table.cc:60
~PFS_plugin_table_index() override=default
PSI_index_handle * m_plugin_index
Definition: table_plugin_table.h:120
int init(PSI_table_handle *table, uint idx, bool sorted)
Definition: table_plugin_table.cc:35
uint m_idx
Definition: table_plugin_table.h:119
PFS_engine_table_proxy * m_st_table
Definition: table_plugin_table.h:118
PFS_plugin_table_index(PFS_engine_table_proxy *st_table)
Definition: table_plugin_table.h:105
Definition: table_plugin_table.h:43
int index_next() override
Find key in index, read record.
Definition: table_plugin_table.cc:125
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_plugin_table.cc:89
THR_LOCK * m_table_lock
Table share lock.
Definition: table_plugin_table.h:90
PFS_engine_table_share * m_share
Table share.
Definition: table_plugin_table.h:46
PSI_pos * m_next_pos
Next position.
Definition: table_plugin_table.h:98
bool m_row_exists
True is the current row exists.
Definition: table_plugin_table.h:93
int index_init(uint idx, bool sorted) override
Definition: table_plugin_table.cc:111
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_plugin_table.cc:129
PFS_plugin_table_index * m_opened_index
Definition: table_plugin_table.h:100
int update_row_values(TABLE *table, const unsigned char *, unsigned char *, Field **fields) override
Update the current row values.
Definition: table_plugin_table.cc:165
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_plugin_table.cc:96
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_plugin_table.cc:103
table_plugin_table(PFS_engine_table_share *share)
Definition: table_plugin_table.cc:72
int delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) override
Delete a row.
Definition: table_plugin_table.cc:188
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_plugin_table.cc:82
~table_plugin_table() override
Definition: table_plugin_table.h:83
static PFS_engine_table * create(PFS_engine_table_share *share)
Definition: table_plugin_table.cc:68
int delete_all_rows()
Definition: table_plugin_table.cc:157
int write_row(PSI_field *field, uint index, bool finished)
PFS_engine_table_proxy * m_st_table
Definition: table_plugin_table.h:47
void deinitialize_table_share()
PSI_pos * m_pos
Current position.
Definition: table_plugin_table.h:96
PSI_table_handle * plugin_table_handle
Definition: table_plugin_table.h:48
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
ha_rkey_function
Definition: my_base.h:78
unsigned char uchar
Definition: my_inttypes.h:52
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
struct PSI_table_handle PSI_table_handle
This is an opaque structure to denote table handle in plugin/component code.
Definition: pfs_plugin_table_service.h:97
struct PSI_pos PSI_pos
This is an opaque structure to denote cursor position in plugin/component code.
Definition: pfs_plugin_table_service.h:102
struct PSI_index_handle PSI_index_handle
This is an opaque structure to denote Index Handle in plugin/component code.
Definition: pfs_plugin_table_service.h:110
struct PSI_field PSI_field
This is an opaque structure to denote filed in plugin/component code.
Definition: pfs_plugin_table_service.h:93
required string key
Definition: replication_asynchronous_connection_failover.proto:60
A structure to keep callback functions to be implemented by plugin/component.
Definition: pfs_plugin_table_service.h:413
close_table_t close_table
Definition: pfs_plugin_table_service.h:428
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Definition: table.h:1398
Definition: thr_lock.h:139
unsigned int uint
Definition: uca9-dump.cc:75
static int finished(pax_machine *p)
Definition: xcom_base.cc:732