MySQL 9.1.0
Source Code Documentation
table_setup_loggers.h
Go to the documentation of this file.
1/* Copyright (c) 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_SETUP_LOGGERS_H
25#define TABLE_SETUP_LOGGERS_H
26
27/**
28 @file storage/perfschema/table_setup_loggers.h
29 Table SETUP_LOGGERS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_instr_class;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup performance_schema_tables
46 @{
47*/
48
49/** A row of PERFORMANCE_SCHEMA.SETUP_LOGGERS. */
52 /** Column NAME. */
55 /** Column LEVEL. */
57 /** Column DESCRIPTION. */
60};
61
62#define LOGGERS_PREALLOC (size_t)50
63
64/** Table PERFORMANCE_SCHEMA.SETUP_LOGGERS. */
68
69 public:
70 /** Table share. */
73 static ha_rows get_row_count();
74
75 void reset_position() override;
76
77 int rnd_next() override;
78 int rnd_pos(const void *pos) override;
79
80 protected:
81 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
82 bool read_all) override;
83
84 int update_row_values(TABLE *table, const unsigned char *old_buf,
85 unsigned char *new_buf, Field **fields) override;
86
88
89 public:
90 ~table_setup_loggers() override = default;
91
92 private:
93 int make_row(PFS_logger_class *klass);
94
95 /** Table share lock. */
97 /** Table definition. */
99
100 /** Current row. */
102 /** Current position. */
104 /** Next position. */
106};
107
108/** @} */
109#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
Table PERFORMANCE_SCHEMA.SETUP_LOGGERS.
Definition: table_setup_loggers.h:65
PFS_simple_index pos_t
Definition: table_setup_loggers.h:66
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_setup_loggers.cc:86
pos_t m_pos
Current position.
Definition: table_setup_loggers.h:103
static ha_rows get_row_count()
Definition: table_setup_loggers.cc:81
static Plugin_table m_table_def
Table definition.
Definition: table_setup_loggers.h:98
int update_row_values(TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields) override
Update the current row values.
Definition: table_setup_loggers.cc:184
table_setup_loggers()
Definition: table_setup_loggers.cc:83
Prealloced_array< row_setup_loggers, LOGGERS_PREALLOC > Loggers_array
Definition: table_setup_loggers.h:67
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_setup_loggers.cc:91
row_setup_loggers m_row
Current row.
Definition: table_setup_loggers.h:101
static PFS_engine_table_share m_share
Table share.
Definition: table_setup_loggers.h:71
~table_setup_loggers() override=default
static THR_LOCK m_table_lock
Table share lock.
Definition: table_setup_loggers.h:96
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_setup_loggers.cc:109
int make_row(PFS_logger_class *klass)
Definition: table_setup_loggers.cc:126
pos_t m_next_pos
Next position.
Definition: table_setup_loggers.h:105
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_setup_loggers.cc:77
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_setup_loggers.cc:148
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:71
Performance schema tables (declarations).
OTELLogLevel
Log levels as supported by opentelemetry-cpp (+ "none"), see: api/include/opentelemetry/logs/severity...
Definition: server_telemetry_logs_client_bits.h:43
constexpr size_t MAX_LOGGER_NAME_LEN
Definition: server_telemetry_logs_client_bits.h:47
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Information for all instrumentation.
Definition: pfs_instr_class.h:248
Instrumentation metadata for a telemetry logger.
Definition: pfs_instr_class.h:448
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Definition: table.h:1421
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.SETUP_LOGGERS.
Definition: table_setup_loggers.h:50
uint m_logger_name_length
Definition: table_setup_loggers.h:54
OTELLogLevel m_level
Column LEVEL.
Definition: table_setup_loggers.h:56
uint m_description_length
Definition: table_setup_loggers.h:59
char m_description[COL_INFO_SIZE]
Column DESCRIPTION.
Definition: table_setup_loggers.h:58
char m_logger_name[MAX_LOGGER_NAME_LEN+1]
Column NAME.
Definition: table_setup_loggers.h:53
PFS_logger_class * m_instr_class
Definition: table_setup_loggers.h:51
Helpers to implement a performance schema table.