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