MySQL 9.0.0
Source Code Documentation
table_global_variable_attributes.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 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_GLOBAL_VARIABLE_ATTRIBUTES_H
25#define TABLE_GLOBAL_VARIABLE_ATTRIBUTES_H
26
27/**
28 @file storage/perfschema/table_global_variable_attributes.h
29 Table GLOBAL_VARIABLE_ATTRIBUTES (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.GLOBAL_VARIABLE_ATTRIBUTES.
50*/
51
55 const char *attribute_name,
56 const char *attribute_value);
60
61 /** Column VARIABLE_NAME. */
64 /** Column ATTR_NAME. */
67 /** Column ATTR_VALUE. */
70};
71
72/** Table PERFORMANCE_SCHEMA.GLOBAL_VARIABLE_ATTRIBUTES. */
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() override;
89
90 protected:
91 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
92 bool read_all) override;
94
95 public:
97
98 protected:
99 /* Build sys_var tracker array. */
100 bool init_sys_var_array();
101 /* Build sys_var info cache. */
102 int do_materialize_all();
103
105
106 private:
107 /** Table share lock. */
109 /** Table definition. */
111
112 /* True when system variable descriptors array is complete. */
114 /* Array of system variable descriptors. */
116 /* Cache of materialized variables. */
118 /* True when cache is complete. */
120 /* Version of global hash/array. Changes when vars added/removed. */
122
123 /** Current row. */
125 /** Current position. */
127 /** Next position. */
129};
130
131#endif
Definition: field.h:577
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
A class representing one system variable - that is something that can be accessed as @global....
Definition: set_var.h:107
Table PERFORMANCE_SCHEMA.GLOBAL_VARIABLE_ATTRIBUTES.
Definition: table_global_variable_attributes.h:73
bool init_sys_var_array()
Build a sorted list of all system variables from the system variable hash.
Definition: table_global_variable_attributes.cc:142
~table_global_variable_attributes() override=default
Prealloced_array< row_global_variable_attributes, SYSTEM_VARIABLE_PREALLOC > Variable_array
Definition: table_global_variable_attributes.h:77
pos_t m_next_pos
Next position.
Definition: table_global_variable_attributes.h:128
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_global_variable_attributes.cc:211
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_global_variable_attributes.cc:247
Variable_array m_cache
Definition: table_global_variable_attributes.h:117
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_global_variable_attributes.cc:216
table_global_variable_attributes()
Definition: table_global_variable_attributes.cc:128
PFS_simple_index pos_t
Definition: table_global_variable_attributes.h:74
int make_row(const row_global_variable_attributes &row)
Definition: table_global_variable_attributes.cc:241
ulonglong m_version
Definition: table_global_variable_attributes.h:121
bool m_initialized
Definition: table_global_variable_attributes.h:113
pos_t m_pos
Current position.
Definition: table_global_variable_attributes.h:126
static Plugin_table m_table_def
Table definition.
Definition: table_global_variable_attributes.h:110
int do_materialize_all()
Build a GLOBAL system variable cache.
Definition: table_global_variable_attributes.cc:173
row_global_variable_attributes m_row
Current row.
Definition: table_global_variable_attributes.h:124
static PFS_engine_table_share m_share
Table share.
Definition: table_global_variable_attributes.h:81
bool m_materialized
Definition: table_global_variable_attributes.h:119
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_global_variable_attributes.cc:233
static THR_LOCK m_table_lock
Table share lock.
Definition: table_global_variable_attributes.h:108
static ha_rows get_row_count()
Definition: table_global_variable_attributes.cc:126
System_variable_tracker::Array m_sys_var_tracker_array
Definition: table_global_variable_attributes.h:115
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_global_variable_attributes.cc:222
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_global_variable_attributes.cc:121
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Common definition between mysql server & client.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Data types for columns used in the performance schema tables (declarations)
#define COL_SHORT_NAME_SIZE
Size of the short NAME columns, in bytes.
Definition: pfs_column_types.h:81
#define COL_OBJECT_NAME_SIZE
Size of the OBJECT_NAME columns, in bytes.
Definition: pfs_column_types.h:55
#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).
#define SYSTEM_VARIABLE_PREALLOC
Definition: pfs_variable.h:152
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Definition: table.h:1407
Definition: thr_lock.h:139
A row of table PERFORMANCE_SCHEMA.GLOBAL_VARIABLE_ATTRIBUTES.
Definition: table_global_variable_attributes.h:52
uint m_variable_name_length
Definition: table_global_variable_attributes.h:63
char m_attr_value[COL_INFO_SIZE]
Column ATTR_VALUE.
Definition: table_global_variable_attributes.h:68
char m_attr_name[COL_SHORT_NAME_SIZE]
Column ATTR_NAME.
Definition: table_global_variable_attributes.h:65
uint m_attr_value_length
Definition: table_global_variable_attributes.h:69
row_global_variable_attributes & operator=(const row_global_variable_attributes &other)
Definition: table_global_variable_attributes.cc:76
char m_variable_name[COL_OBJECT_NAME_SIZE]
Column VARIABLE_NAME.
Definition: table_global_variable_attributes.h:62
row_global_variable_attributes()
Definition: table_global_variable_attributes.cc:48
uint m_attr_name_length
Definition: table_global_variable_attributes.h:66