MySQL  8.0.27
Source Code Documentation
rpl_info_table_access.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 2021, 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 #ifndef RPL_INFO_TABLE_ACCESS_H
23 #define RPL_INFO_TABLE_ACCESS_H
24 
25 #include <sys/types.h>
26 
27 #include "sql/rpl_table_access.h" // System_table_access
28 
29 class Field;
30 class Open_tables_backup;
31 class Rpl_info_values;
32 class THD;
33 struct TABLE;
34 
36 
38  public:
40  ~Rpl_info_table_access() override = default;
41 
42  /**
43  Prepares before opening table.
44  - set flags
45  - start lex and reset the part of THD responsible
46  for the state of command processing if needed.
47 
48  @param[in] thd Thread requesting to open the table
49  */
50  void before_open(THD *thd) override;
51  bool close_table(THD *thd, TABLE *table, Open_tables_backup *backup,
52  bool error);
53  enum enum_return_id find_info(Rpl_info_values *field_values, TABLE *table);
54  enum enum_return_id scan_info(TABLE *table, uint instance);
55  std::pair<bool, bool> is_table_in_use(TABLE *table);
56  bool count_info(TABLE *table, ulonglong *counter);
57  bool load_info_values(uint max_num_field, Field **fields,
58  Rpl_info_values *field_values);
59  bool store_info_values(uint max_num_field, Field **fields,
60  Rpl_info_values *field_values);
61  THD *create_thd();
62  void drop_thd(THD *thd);
63 
64  private:
66 
69 };
70 #endif /* RPL_INFO_TABLE_ACCESS_H */
Definition: field.h:590
Storage for backup of Open_tables_state.
Definition: sql_class.h:579
Definition: rpl_info_table_access.h:37
THD * create_thd()
Creates a new thread if necessary.
Definition: rpl_info_table_access.cc:362
bool thd_created
Definition: rpl_info_table_access.h:65
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:291
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:133
void drop_thd(THD *thd)
Destroys the created thread if necessary and restores the system_thread information.
Definition: rpl_info_table_access.cc:385
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:99
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:329
bool count_info(TABLE *table, ulonglong *counter)
Returns the number of entries in table.
Definition: rpl_info_table_access.cc:245
Rpl_info_table_access()
Definition: rpl_info_table_access.h:39
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:52
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:192
~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:264
Definition: rpl_info_values.h:30
A base class for accessing a system table.
Definition: rpl_table_access.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
unsigned long long int ulonglong
Definition: my_inttypes.h:55
static bool backup
Definition: myisampack.cc:194
Log info(cout, "NOTE")
uint counter
Definition: mysqlimport.cc:53
enum_return_id
Definition: rpl_info_table_access.h:35
@ FOUND_ID
Definition: rpl_info_table_access.h:35
@ ERROR_ID
Definition: rpl_info_table_access.h:35
@ NOT_FOUND_ID
Definition: rpl_info_table_access.h:35
Definition: table.h:1394
unsigned int uint
Definition: uca-dump.cc:29