MySQL 8.0.40
Source Code Documentation
cursor_by_account.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 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
25#ifndef CURSOR_BY_ACCOUNT_H
26#define CURSOR_BY_ACCOUNT_H
27
28/**
29 @file storage/perfschema/cursor_by_account.h
30 Cursor CURSOR_BY_ACCOUNT (declarations).
31*/
32
36
37/**
38 @addtogroup performance_schema_tables
39 @{
40*/
41
43 public:
45 : PFS_engine_index(key_1) {}
46
48 : PFS_engine_index(key_1, key_2) {}
49
50 ~PFS_index_accounts() override = default;
51
52 virtual bool match(PFS_account *pfs) = 0;
53};
54
55/** Cursor CURSOR_BY_ACCOUNT. */
57 public:
58 static ha_rows get_row_count();
59
60 void reset_position() override;
61
62 int rnd_next() override;
63 int rnd_pos(const void *pos) override;
64
65 int index_next() override;
66
67 protected:
68 explicit cursor_by_account(const PFS_engine_table_share *share);
69
70 public:
71 ~cursor_by_account() override = default;
72
73 protected:
74 virtual int make_row(PFS_account *account) = 0;
75
76 private:
77 /** Current position. */
79 /** Next position. */
81
82 protected:
84};
85
86/** @} */
87#endif
Definition: pfs_engine_table.h:301
Definition: pfs_engine_table.h:268
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: cursor_by_account.h:42
virtual bool match(PFS_account *pfs)=0
PFS_index_accounts(PFS_engine_key *key_1, PFS_engine_key *key_2)
Definition: cursor_by_account.h:47
~PFS_index_accounts() override=default
PFS_index_accounts(PFS_engine_key *key_1)
Definition: cursor_by_account.h:44
Cursor CURSOR_BY_ACCOUNT.
Definition: cursor_by_account.h:56
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: cursor_by_account.cc:63
PFS_simple_index m_next_pos
Next position.
Definition: cursor_by_account.h:80
PFS_simple_index m_pos
Current position.
Definition: cursor_by_account.h:78
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: cursor_by_account.cc:44
int index_next() override
Find key in index, read record.
Definition: cursor_by_account.cc:76
cursor_by_account(const PFS_engine_table_share *share)
Definition: cursor_by_account.cc:41
int rnd_next() override
Fetch the next row in this cursor.
Definition: cursor_by_account.cc:49
static ha_rows get_row_count()
Definition: cursor_by_account.cc:37
virtual int make_row(PFS_account *account)=0
~cursor_by_account() override=default
PFS_index_accounts * m_opened_index
Definition: cursor_by_account.h:83
my_off_t ha_rows
Definition: my_base.h:1140
Performance schema account (declarations).
Performance schema tables (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Per account statistics.
Definition: pfs_account.h:67
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Helpers to implement a performance schema table.