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