MySQL 9.6.0
Source Code Documentation
table_temporary_account_locks.h
Go to the documentation of this file.
1/* Copyright (c) 2025, 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_TEMPORARY_ACCOUNT_LOCKS_H
25#define TABLE_TEMPORARY_ACCOUNT_LOCKS_H
26
27/**
28 @file storage/perfschema/table_temporary_account_locks.h
29 Table TEMPORARY_ACCOUNT_LOCKS (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_inttypes.h"
38
39class Field;
40class Plugin_table;
41class THD;
42struct TABLE;
43struct THR_LOCK;
44class ACL_USER;
45
46/**
47 @addtogroup performance_schema_tables
48 @{
49*/
50
51/** A row of PERFORMANCE_SCHEMA.TEMPORARY_ACCOUNT_LOCKS. */
53 /** Column USER, HOST. */
55 /** Column LOCKED. */
57 /** Column FAILED_LOGIN_ATTEMPTS. */
59 /** Column REMAINING_LOGIN_ATTEMPTS. */
61 /** Column PASSWORD_LOCK_TIME. */
63 /** Column LOCKED_SINCE. */
65 /** Column LOCKED_UNTIL. */
67};
68
70 public:
72 PFS_engine_key *key_2)
73 : PFS_engine_index(key_1, key_2) {}
74
76
77 virtual bool match(const row_temporary_account_locks *row) = 0;
78};
79
82 public:
85 m_key_1("USER"),
86 m_key_2("HOST") {}
87
89
90 bool match(const row_temporary_account_locks *row) override;
91
92 private:
95};
96
97/** Table PERFORMANCE_SCHEMA.TEMPORARY_ACCOUNT_LOCKS. */
99 public:
100 /** Table share. */
103 static ha_rows get_row_count();
104
105 void reset_position() override;
106
107 int rnd_next() override;
108 int rnd_pos(const void *pos) override;
109
110 int index_init(uint idx, bool sorted) override;
111 int index_next() override;
112
113 protected:
114 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
115 bool read_all) override;
117
118 public:
119 ~table_temporary_account_locks() override = default;
120
121 private:
122 void materialize(THD *thd);
123
124 /** Table share lock. */
126 /** Table definition. */
128
131 /** Current row. */
133 /** Current position. */
135 /** Next position. */
137
139};
140
141/** @} */
142#endif
Definition: sql_auth_cache.h:248
Definition: field.h:570
Definition: pfs_engine_table.h:301
Definition: pfs_engine_table.h:268
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_temporary_account_locks.h:81
PFS_index_temporary_account_locks_by_account()
Definition: table_temporary_account_locks.h:83
~PFS_index_temporary_account_locks_by_account() override=default
bool match(const row_temporary_account_locks *row) override
Definition: table_temporary_account_locks.cc:78
PFS_key_user m_key_1
Definition: table_temporary_account_locks.h:93
PFS_key_host m_key_2
Definition: table_temporary_account_locks.h:94
Definition: table_temporary_account_locks.h:69
virtual bool match(const row_temporary_account_locks *row)=0
PFS_index_temporary_account_locks(PFS_engine_key *key_1, PFS_engine_key *key_2)
Definition: table_temporary_account_locks.h:71
~PFS_index_temporary_account_locks() override=default
Definition: table_helper.h:1522
Definition: table_helper.h:1509
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Table PERFORMANCE_SCHEMA.TEMPORARY_ACCOUNT_LOCKS.
Definition: table_temporary_account_locks.h:98
static ha_rows get_row_count()
Definition: table_temporary_account_locks.cc:104
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_temporary_account_locks.cc:209
static PFS_engine_table_share m_share
Table share.
Definition: table_temporary_account_locks.h:101
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_temporary_account_locks.cc:204
~table_temporary_account_locks() override=default
row_temporary_account_locks * m_all_rows
Definition: table_temporary_account_locks.h:129
uint m_row_count
Definition: table_temporary_account_locks.h:130
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_temporary_account_locks.cc:226
row_temporary_account_locks * m_row
Current row.
Definition: table_temporary_account_locks.h:132
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_temporary_account_locks.cc:269
int index_next() override
Find key in index, read record.
Definition: table_temporary_account_locks.cc:250
PFS_simple_index m_next_pos
Next position.
Definition: table_temporary_account_locks.h:136
PFS_simple_index m_pos
Current position.
Definition: table_temporary_account_locks.h:134
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_temporary_account_locks.cc:95
table_temporary_account_locks()
Definition: table_temporary_account_locks.cc:118
static THR_LOCK m_table_lock
Table share lock.
Definition: table_temporary_account_locks.h:125
PFS_index_temporary_account_locks * m_opened_index
Definition: table_temporary_account_locks.h:138
void materialize(THD *thd)
Definition: table_temporary_account_locks.cc:175
static Plugin_table m_table_def
Table definition.
Definition: table_temporary_account_locks.h:127
int index_init(uint idx, bool sorted) override
Definition: table_temporary_account_locks.cc:233
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1228
Some integer typedefs for easier portability.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
Row fragment for columns USER, HOST.
Definition: table_helper.h:554
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Definition: table.h:1450
Definition: thr_lock.h:139
A row of PERFORMANCE_SCHEMA.TEMPORARY_ACCOUNT_LOCKS.
Definition: table_temporary_account_locks.h:52
ulong m_locked_until_daynr
Column LOCKED_UNTIL.
Definition: table_temporary_account_locks.h:66
ulong m_failed_login_attempts
Column FAILED_LOGIN_ATTEMPTS.
Definition: table_temporary_account_locks.h:58
ulong m_locked_since_daynr
Column LOCKED_SINCE.
Definition: table_temporary_account_locks.h:64
ulong m_password_lock_time_days
Column PASSWORD_LOCK_TIME.
Definition: table_temporary_account_locks.h:62
PFS_account_row m_account
Column USER, HOST.
Definition: table_temporary_account_locks.h:54
ulong m_remaining_login_attempts
Column REMAINING_LOGIN_ATTEMPTS.
Definition: table_temporary_account_locks.h:60
bool m_locked
Column LOCKED.
Definition: table_temporary_account_locks.h:56
Helpers to implement a performance schema table.