MySQL 8.0.40
Source Code Documentation
rpl_info_table_access.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 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#ifndef RPL_INFO_TABLE_ACCESS_H
24#define RPL_INFO_TABLE_ACCESS_H
25
26#include <sys/types.h>
27
28#include "sql/rpl_table_access.h" // System_table_access
29
30class Field;
32class Rpl_info_values;
33class THD;
34struct TABLE;
35
37
39 public:
41 ~Rpl_info_table_access() override = default;
42
43 /**
44 Prepares before opening table.
45 - set flags
46 - start lex and reset the part of THD responsible
47 for the state of command processing if needed.
48
49 @param[in] thd Thread requesting to open the table
50 */
51 void before_open(THD *thd) override;
52 bool close_table(THD *thd, TABLE *table, Open_tables_backup *backup,
53 bool error);
54 enum enum_return_id find_info(Rpl_info_values *field_values, TABLE *table);
55 enum enum_return_id scan_info(TABLE *table, uint instance);
56 std::pair<bool, bool> is_table_in_use(TABLE *table);
57 bool count_info(TABLE *table, ulonglong *counter);
58 bool load_info_values(uint max_num_field, Field **fields,
59 Rpl_info_values *field_values);
60 bool store_info_values(uint max_num_field, Field **fields,
61 Rpl_info_values *field_values);
62 THD *create_thd();
63 void drop_thd(THD *thd);
64
65 private:
67
70};
71#endif /* RPL_INFO_TABLE_ACCESS_H */
Definition: field.h:575
Storage for backup of Open_tables_state.
Definition: sql_class.h:688
Definition: rpl_info_table_access.h:38
THD * create_thd()
Creates a new thread if necessary.
Definition: rpl_info_table_access.cc:367
bool thd_created
Definition: rpl_info_table_access.h:66
bool load_info_values(uint max_num_field, Field **fields, Rpl_info_values *field_values)
Reads information from a sequence of fields into a set of LEX_STRING structures, where the sequence o...
Definition: rpl_info_table_access.cc:296
Rpl_info_table_access(const Rpl_info_table_access &info)
enum enum_return_id find_info(Rpl_info_values *field_values, TABLE *table)
Positions the internal pointer of table according to the primary key.
Definition: rpl_info_table_access.cc:134
void drop_thd(THD *thd)
Destroys the created thread if necessary and restores the system_thread information.
Definition: rpl_info_table_access.cc:390
bool close_table(THD *thd, TABLE *table, Open_tables_backup *backup, bool error)
Commits the changes, unlocks the table and closes it.
Definition: rpl_info_table_access.cc:100
bool store_info_values(uint max_num_field, Field **fields, Rpl_info_values *field_values)
Stores information from a sequence of fields into a set of LEX_STRING structures, where the sequence ...
Definition: rpl_info_table_access.cc:334
bool count_info(TABLE *table, ulonglong *counter)
Returns the number of entries in table.
Definition: rpl_info_table_access.cc:250
Rpl_info_table_access()
Definition: rpl_info_table_access.h:40
Rpl_info_table_access & operator=(const Rpl_info_table_access &info)
void before_open(THD *thd) override
Prepares before opening table.
Definition: rpl_info_table_access.cc:53
enum enum_return_id scan_info(TABLE *table, uint instance)
Positions the internal pointer of table to the n-instance row.
Definition: rpl_info_table_access.cc:197
~Rpl_info_table_access() override=default
std::pair< bool, bool > is_table_in_use(TABLE *table)
Returns if the table is being used, meaning it contains at least a line or some concurrency related e...
Definition: rpl_info_table_access.cc:269
Definition: rpl_info_values.h:31
A base class for accessing a system table.
Definition: rpl_table_access.h:40
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
unsigned long long int ulonglong
Definition: my_inttypes.h:56
static bool backup
Definition: myisampack.cc:195
Log info(cout, "NOTE")
uint counter
Definition: mysqlimport.cc:54
enum_return_id
Definition: rpl_info_table_access.h:36
@ FOUND_ID
Definition: rpl_info_table_access.h:36
@ ERROR_ID
Definition: rpl_info_table_access.h:36
@ NOT_FOUND_ID
Definition: rpl_info_table_access.h:36
Definition: table.h:1399
unsigned int uint
Definition: uca9-dump.cc:75