1 /* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */ 22 #ifndef RPL_INFO_TABLE_ACCESS_H 23 #define RPL_INFO_TABLE_ACCESS_H 24 25 #include "my_global.h" 26 #include "rpl_table_access.h" // System_table_access 27 /* 28 #include <table.h> 29 #include <key.h> 30 #include "rpl_info_handler.h" 31 #include "rpl_info_values.h" 32 */ 33 class Field; 34 class Rpl_info_values; 35 36 37 enum enum_return_id { FOUND_ID= 1, NOT_FOUND_ID, ERROR_ID }; 38 39 class Rpl_info_table_access : public System_table_access 40 { 41 public: Rpl_info_table_access()42 Rpl_info_table_access(): thd_created(false) { }; ~Rpl_info_table_access()43 virtual ~Rpl_info_table_access() { }; 44 45 /** 46 Prepares before opening table. 47 - set flags 48 - start lex and reset the part of THD responsible 49 for the state of command processing if needed. 50 51 @param[in] thd Thread requesting to open the table 52 */ 53 void before_open(THD* thd); 54 bool close_table(THD* thd, TABLE* table, Open_tables_backup* backup, 55 bool error); 56 enum enum_return_id find_info(Rpl_info_values *field_values, TABLE *table); 57 enum enum_return_id scan_info(TABLE *table, uint instance); 58 bool count_info(TABLE *table, uint* counter); 59 bool load_info_values(uint max_num_field, Field **fields, 60 Rpl_info_values *field_values); 61 bool store_info_values(uint max_num_field, Field **fields, 62 Rpl_info_values *field_values); 63 THD *create_thd(); 64 void drop_thd(THD* thd); 65 66 private: 67 bool thd_created; 68 69 Rpl_info_table_access& operator=(const Rpl_info_table_access& info); 70 Rpl_info_table_access(const Rpl_info_table_access& info); 71 }; 72 #endif /* RPL_INFO_TABLE_ACCESS_H */ 73