MySQL 9.1.0
Source Code Documentation
table_data_lock_waits.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_DATA_LOCK_WAITS__H
25#define TABLE_DATA_LOCK_WAITS__H
26
27/**
28 @file storage/perfschema/table_data_lock_waits.h
29 Table DATA_LOCK_WAITS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
38
39class Field;
41class Plugin_table;
42struct TABLE;
43struct THR_LOCK;
44
45/**
46 @addtogroup Performance_schema_tables
47 @{
48*/
49
50/**
51 Position of a cursor on
52 PERFORMANCE_SCHEMA.DATA_LOCK_WAITS.
53 Index 1 on engine (0 based)
54 Index 2 on engine index (0 based)
55*/
58 m_index_1 = 0;
59 m_index_2 = 0;
60 }
61
62 inline void reset() {
63 m_index_1 = 0;
64 m_index_2 = 0;
65 }
66
67 void set_at(const scan_pos_data_lock_wait *other) {
68 m_index_1 = other->m_index_1;
69 m_index_2 = other->m_index_2;
70 }
71
73 m_index_1 = other->m_index_1;
74 m_index_2 = other->m_index_2 + 1;
75 }
76
77 inline bool has_more_engine() const {
79 }
80
81 inline void next_engine() {
82 m_index_1++;
83 m_index_2 = 0;
84 }
85
86 unsigned int m_index_1;
87 unsigned int m_index_2;
88};
89
90/** Table PERFORMANCE_SCHEMA.DATA_LOCKS. */
94
95 public:
96 /** Table share. */
99 static ha_rows get_row_count();
100
101 int rnd_next() override;
102 int rnd_pos(const void *pos) override;
103 void reset_position() override;
104
105 int index_init(uint idx, bool sorted) override;
106 int index_next() override;
107
108 private:
109 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
110 bool read_all) override;
111
113
114 void destroy_iterators();
115
116 public:
117 ~table_data_lock_waits() override;
118
119 private:
120 /** Table share lock. */
122 /** Table definition. */
124
125 /** Current row. */
127 /** Current scan position. */
129 /** Next scan position. */
131 /** Current pk position. */
133
136
139};
140
141/** @} */
142#endif
Definition: field.h:577
Definition: pfs_data_lock.h:891
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: pfs_data_lock.h:441
Definition: pfs_data_lock.h:496
Definition: psi_data_lock.h:343
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.DATA_LOCKS.
Definition: table_data_lock_waits.h:91
scan_pos_t m_next_pos
Next scan position.
Definition: table_data_lock_waits.h:130
static ha_rows get_row_count()
Definition: table_data_lock_waits.cc:97
PFS_pk_data_lock_waits * m_opened_pk
Definition: table_data_lock_waits.h:137
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_data_lock_waits.cc:191
static Plugin_table m_table_def
Table definition.
Definition: table_data_lock_waits.h:123
PFS_index_data_lock_waits * m_opened_index
Definition: table_data_lock_waits.h:138
~table_data_lock_waits() override
Definition: table_data_lock_waits.cc:121
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_data_lock_waits.cc:123
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_data_lock_waits.cc:131
static THR_LOCK m_table_lock
Table share lock.
Definition: table_data_lock_waits.h:121
row_data_lock_wait * m_row
Current row.
Definition: table_data_lock_waits.h:126
scan_pos_t m_pos
Current scan position.
Definition: table_data_lock_waits.h:128
int index_init(uint idx, bool sorted) override
Definition: table_data_lock_waits.cc:233
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_data_lock_waits.cc:93
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_data_lock_waits.cc:324
PFS_data_lock_wait_container m_container
Definition: table_data_lock_waits.h:134
table_data_lock_waits()
Definition: table_data_lock_waits.cc:102
scan_pos_data_lock_wait scan_pos_t
Definition: table_data_lock_waits.h:92
pk_pos_t m_pk_pos
Current pk position.
Definition: table_data_lock_waits.h:132
PSI_engine_data_lock_wait_iterator * m_iterator[COUNT_DATA_LOCK_ENGINES]
Definition: table_data_lock_waits.h:135
pk_pos_data_lock_wait pk_pos_t
Definition: table_data_lock_waits.h:93
static PFS_engine_table_share m_share
Table share.
Definition: table_data_lock_waits.h:97
void destroy_iterators()
Definition: table_data_lock_waits.cc:112
int index_next() override
Find key in index, read record.
Definition: table_data_lock_waits.cc:273
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
Performance schema instrumentation (declarations).
Performance schema tables (declarations).
Performance schema instrumentation (declarations).
#define COUNT_DATA_LOCK_ENGINES
Definition: pfs.h:74
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Definition: table.h:1421
Definition: thr_lock.h:139
Definition: pfs_data_lock.h:116
A row of table PERFORMANCE_SCHEMA.DATA_LOCK_WAITS.
Definition: pfs_data_lock.h:198
Position of a cursor on PERFORMANCE_SCHEMA.DATA_LOCK_WAITS.
Definition: table_data_lock_waits.h:56
void set_after(const scan_pos_data_lock_wait *other)
Definition: table_data_lock_waits.h:72
void reset()
Definition: table_data_lock_waits.h:62
void set_at(const scan_pos_data_lock_wait *other)
Definition: table_data_lock_waits.h:67
unsigned int m_index_2
Definition: table_data_lock_waits.h:87
bool has_more_engine() const
Definition: table_data_lock_waits.h:77
scan_pos_data_lock_wait()
Definition: table_data_lock_waits.h:57
unsigned int m_index_1
Definition: table_data_lock_waits.h:86
void next_engine()
Definition: table_data_lock_waits.h:81