MySQL 8.0.40
Source Code Documentation
table_variables_info.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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_VARIABLES_INFO_H
25#define TABLE_VARIABLES_INFO_H
26
27/**
28 @file storage/perfschema/table_variables_info.h
29 Table VARIABLES_INFO (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_inttypes.h"
37#include "mysql_com.h"
41
42class Field;
43class Plugin_table;
44struct TABLE;
45struct THR_LOCK;
46
47/**
48 A row of table
49 PERFORMANCE_SCHEMA.VARIABLES_INFO.
50*/
52 /** Column VARIABLE_NAME. */
55 /** Column VARIABLE_SOURCE. */
57 /** Column VARIABLE_PATH. */
60 /** Column MIN_VALUE. */
63 /** Column MAX_VALUE. */
66 /** Column SET_TIME. */
68 /** Column SET_USER. */
71 /** Column SET_HOST. */
74};
75
76/** Table PERFORMANCE_SCHEMA.VARIABLES_INFO. */
79
80 public:
81 /** Table share */
84 static ha_rows get_row_count();
85
86 int rnd_init(bool scan) override;
87 int rnd_next() override;
88 int rnd_pos(const void *pos) override;
89 void reset_position() override;
90
91 protected:
92 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
93 bool read_all) override;
95
96 public:
97 ~table_variables_info() override = default;
98
99 protected:
100 int make_row(const System_variable *system_var);
101
102 private:
103 /** Table share lock. */
105 /** Table definition. */
107
108 /** Current THD variables. */
110 /** Current row. */
112 /** Current position. */
114 /** Next position. */
116};
117
118#endif
Definition: field.h:575
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
System variable info cache.
Definition: pfs_variable.h:650
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
System variable derived from sys_var object.
Definition: pfs_variable.h:169
Table PERFORMANCE_SCHEMA.VARIABLES_INFO.
Definition: table_variables_info.h:77
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_variables_info.cc:113
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_variables_info.cc:119
pos_t m_pos
Current position.
Definition: table_variables_info.h:113
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_variables_info.cc:178
int make_row(const System_variable *system_var)
Definition: table_variables_info.cc:146
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_variables_info.cc:133
~table_variables_info() override=default
table_variables_info()
Definition: table_variables_info.cc:102
static THR_LOCK m_table_lock
Table share lock.
Definition: table_variables_info.h:104
PFS_simple_index pos_t
Definition: table_variables_info.h:78
static Plugin_table m_table_def
Table definition.
Definition: table_variables_info.h:106
static ha_rows get_row_count()
Definition: table_variables_info.cc:89
row_variables_info m_row
Current row.
Definition: table_variables_info.h:111
pos_t m_next_pos
Next position.
Definition: table_variables_info.h:115
static PFS_engine_table_share m_share
Table share.
Definition: table_variables_info.h:82
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_variables_info.cc:108
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_variables_info.cc:85
PFS_system_variable_info_cache m_sysvarinfo_cache
Current THD variables.
Definition: table_variables_info.h:109
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
static constexpr int HOSTNAME_LENGTH
Definition: my_hostname.h:43
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Common definition between mysql server & client.
#define USERNAME_LENGTH
Definition: mysql_com.h:69
Definition: buf0block_hint.cc:30
Data types for columns used in the performance schema tables (declarations)
#define COL_SOURCE_SIZE
Size of the SOURCE columns, in bytes.
Definition: pfs_column_types.h:76
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:71
Performance schema tables (declarations).
Performance schema system and status variables (declarations).
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Definition: table.h:1399
Definition: thr_lock.h:139
A row of table PERFORMANCE_SCHEMA.VARIABLES_INFO.
Definition: table_variables_info.h:51
char m_variable_name[COL_SOURCE_SIZE]
Column VARIABLE_NAME.
Definition: table_variables_info.h:53
char m_set_host_str[HOSTNAME_LENGTH]
Column SET_HOST.
Definition: table_variables_info.h:72
uint m_min_value_length
Definition: table_variables_info.h:62
uint m_variable_path_length
Definition: table_variables_info.h:59
enum_variable_source m_variable_source
Column VARIABLE_SOURCE.
Definition: table_variables_info.h:56
char m_max_value[COL_SOURCE_SIZE]
Column MAX_VALUE.
Definition: table_variables_info.h:64
uint m_set_user_str_length
Definition: table_variables_info.h:70
uint m_variable_name_length
Definition: table_variables_info.h:54
char m_variable_path[COL_INFO_SIZE]
Column VARIABLE_PATH.
Definition: table_variables_info.h:58
uint m_max_value_length
Definition: table_variables_info.h:65
char m_set_user_str[USERNAME_LENGTH]
Column SET_USER.
Definition: table_variables_info.h:69
ulonglong m_set_time
Column SET_TIME.
Definition: table_variables_info.h:67
char m_min_value[COL_SOURCE_SIZE]
Column MIN_VALUE.
Definition: table_variables_info.h:61
uint m_set_host_str_length
Definition: table_variables_info.h:73
enum_variable_source
This enum values define how system variables are set.
Definition: system_variable_source_type.h:33
unsigned int uint
Definition: uca9-dump.cc:75