My Project
sql_admin.h
00001 /* Copyright (c) 2010, 2013, 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 St, Fifth Floor, Boston, MA 02110-1301  USA */
00015 
00016 #ifndef SQL_TABLE_MAINTENANCE_H
00017 #define SQL_TABLE_MAINTENANCE_H
00018 
00019 /* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
00020 #define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024
00021 
00022 bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
00023                               LEX_STRING *key_cache_name);
00024 bool mysql_preload_keys(THD* thd, TABLE_LIST* table_list);
00025 int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
00026                              KEY_CACHE *dst_cache);
00027 
00031 class Sql_cmd_analyze_table : public Sql_cmd
00032 {
00033 public:
00037   Sql_cmd_analyze_table()
00038   {}
00039 
00040   ~Sql_cmd_analyze_table()
00041   {}
00042 
00043   bool execute(THD *thd);
00044 
00045   virtual enum_sql_command sql_command_code() const
00046   {
00047     return SQLCOM_ANALYZE;
00048   }
00049 };
00050 
00051 
00052 
00056 class Sql_cmd_check_table : public Sql_cmd
00057 {
00058 public:
00062   Sql_cmd_check_table()
00063   {}
00064 
00065   ~Sql_cmd_check_table()
00066   {}
00067 
00068   bool execute(THD *thd);
00069 
00070   virtual enum_sql_command sql_command_code() const
00071   {
00072     return SQLCOM_CHECK;
00073   }
00074 };
00075 
00076 
00080 class Sql_cmd_optimize_table : public Sql_cmd
00081 {
00082 public:
00086   Sql_cmd_optimize_table()
00087   {}
00088 
00089   ~Sql_cmd_optimize_table()
00090   {}
00091 
00092   bool execute(THD *thd);
00093 
00094   virtual enum_sql_command sql_command_code() const
00095   {
00096     return SQLCOM_OPTIMIZE;
00097   }
00098 };
00099 
00100 
00101 
00105 class Sql_cmd_repair_table : public Sql_cmd
00106 {
00107 public:
00111   Sql_cmd_repair_table()
00112   {}
00113 
00114   ~Sql_cmd_repair_table()
00115   {}
00116 
00117   bool execute(THD *thd);
00118 
00119   virtual enum_sql_command sql_command_code() const
00120   {
00121     return SQLCOM_REPAIR;
00122   }
00123 };
00124 
00125 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines