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