My Project
rpl_info_table_access.h
00001 /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
00015 #ifndef RPL_INFO_TABLE_ACCESS_H
00016 #define RPL_INFO_TABLE_ACCESS_H
00017 
00018 #include "my_global.h"
00019 #include "sql_priv.h"
00020 #include <table.h>
00021 #include <key.h>
00022 #include <sql_base.h>
00023 #include "rpl_info_handler.h"
00024 #include "rpl_info_values.h"
00025 
00026 enum enum_return_id { FOUND_ID= 1, NOT_FOUND_ID, ERROR_ID };
00027 
00028 class Rpl_info_table_access
00029 {
00030 public:
00031   Rpl_info_table_access(): thd_created(false) { };
00032   virtual ~Rpl_info_table_access() { };
00033 
00034   bool open_table(THD* thd, const LEX_STRING dbstr, const LEX_STRING tbstr,
00035                   uint max_num_field, enum thr_lock_type lock_type,
00036                   TABLE** table, Open_tables_backup* backup);
00037   bool close_table(THD* thd, TABLE* table, Open_tables_backup* backup,
00038                    bool error);
00039   enum enum_return_id find_info(Rpl_info_values *field_values, TABLE *table);
00040   enum enum_return_id scan_info(TABLE *table, uint instance);
00041   bool count_info(TABLE *table, uint* counter);
00042   bool load_info_values(uint max_num_field, Field **fields,
00043                         Rpl_info_values *field_values);
00044   bool store_info_values(uint max_num_field, Field **fields,
00045                          Rpl_info_values *field_values);
00046   THD *create_thd();
00047   bool drop_thd(THD* thd);
00048 
00049 private:
00050   bool thd_created;
00051 
00052   Rpl_info_table_access& operator=(const Rpl_info_table_access& info);
00053   Rpl_info_table_access(const Rpl_info_table_access& info);
00054 };
00055 #endif /* RPL_INFO_TABLE_ACCESS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines