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