MySQL 9.1.0
Source Code Documentation
cursor_by_thread_connect_attr.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 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 CURSOR_BY_THREAD_CONNECT_ATTR_H
25#define CURSOR_BY_THREAD_CONNECT_ATTR_H
26
27/**
28 @file storage/perfschema/cursor_by_thread_connect_attr.h
29*/
30
31#include <sys/types.h>
32
36
37/**
38 @addtogroup performance_schema_tables
39 @{
40*/
41
42/**
43 Position of a cursor on abstract table
44 PERFORMANCE_SCHEMA.SESSION_CONNECT_ATTRS.
45*/
48
49 inline void next_thread() {
50 m_index_1++;
51 m_index_2 = 0;
52 }
53
54 inline void reset() {
55 m_index_1 = 0;
56 m_index_2 = 0;
57 }
58};
59
60/** Cursor CURSOR_BY_THREAD_CONNECT_ATTR. */
62 public:
63 static ha_rows get_row_count();
64
65 void reset_position() override;
66
67 int rnd_next() override;
68 int rnd_pos(const void *pos) override;
69
70 int index_init(uint, bool) override { return 1; }
71 int index_next() override { return 1; }
72
73 protected:
75
76 public:
77 ~cursor_by_thread_connect_attr() override = default;
78
79 protected:
80 virtual int make_row(PFS_thread *thread, uint ordinal) = 0;
81
82 /** Current position. */
84 /** Next position. */
86};
87
88/** @} */
89#endif
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Cursor CURSOR_BY_THREAD_CONNECT_ATTR.
Definition: cursor_by_thread_connect_attr.h:61
pos_connect_attr_by_thread_by_attr m_pos
Current position.
Definition: cursor_by_thread_connect_attr.h:83
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: cursor_by_thread_connect_attr.cc:50
int index_init(uint, bool) override
Definition: cursor_by_thread_connect_attr.h:70
int index_next() override
Find key in index, read record.
Definition: cursor_by_thread_connect_attr.h:71
virtual int make_row(PFS_thread *thread, uint ordinal)=0
cursor_by_thread_connect_attr(const PFS_engine_table_share *share)
Definition: cursor_by_thread_connect_attr.cc:46
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: cursor_by_thread_connect_attr.cc:72
~cursor_by_thread_connect_attr() override=default
int rnd_next() override
Fetch the next row in this cursor.
Definition: cursor_by_thread_connect_attr.cc:55
static ha_rows get_row_count()
Definition: cursor_by_thread_connect_attr.cc:35
pos_connect_attr_by_thread_by_attr m_next_pos
Next position.
Definition: cursor_by_thread_connect_attr.h:85
my_off_t ha_rows
Definition: my_base.h:1141
Data types for columns used in the performance schema tables (declarations)
Performance schema tables (declarations).
Performance schema instruments (declarations).
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:602
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:604
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:606
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Instrumented thread implementation.
Definition: pfs_instr.h:375
Position of a cursor on abstract table PERFORMANCE_SCHEMA.SESSION_CONNECT_ATTRS.
Definition: cursor_by_thread_connect_attr.h:46
void next_thread()
Definition: cursor_by_thread_connect_attr.h:49
pos_connect_attr_by_thread_by_attr()
Definition: cursor_by_thread_connect_attr.h:47
void reset()
Definition: cursor_by_thread_connect_attr.h:54