My Project
sql_partition_admin.h
00001 /* Copyright (c) 2010, 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_PARTITION_ADMIN_H
00017 #define SQL_PARTITION_ADMIN_H
00018 
00019 #ifndef WITH_PARTITION_STORAGE_ENGINE
00020 
00025 class Sql_cmd_partition_unsupported : public Sql_cmd
00026 {
00027 public:
00028   Sql_cmd_partition_unsupported()
00029   {}
00030 
00031   ~Sql_cmd_partition_unsupported()
00032   {}
00033 
00034   /* Override SQLCOM_*, since it is an ALTER command */
00035   virtual enum_sql_command sql_command_code() const
00036   {
00037     return SQLCOM_ALTER_TABLE;
00038   }
00039 
00040   bool execute(THD *thd);
00041 };
00042 
00043 
00044 class Sql_cmd_alter_table_exchange_partition :
00045   public Sql_cmd_partition_unsupported
00046 {
00047 public:
00048   Sql_cmd_alter_table_exchange_partition()
00049   {}
00050 
00051   ~Sql_cmd_alter_table_exchange_partition()
00052   {}
00053 };
00054 
00055 
00056 class  Sql_cmd_alter_table_analyze_partition :
00057   public Sql_cmd_partition_unsupported
00058 {
00059 public:
00060   Sql_cmd_alter_table_analyze_partition()
00061   {}
00062 
00063   ~Sql_cmd_alter_table_analyze_partition()
00064   {}
00065 };
00066 
00067 
00068 class Sql_cmd_alter_table_check_partition :
00069   public Sql_cmd_partition_unsupported
00070 {
00071 public:
00072   Sql_cmd_alter_table_check_partition()
00073   {}
00074 
00075   ~Sql_cmd_alter_table_check_partition()
00076   {}
00077 };
00078 
00079 
00080 class Sql_cmd_alter_table_optimize_partition :
00081   public Sql_cmd_partition_unsupported
00082 {
00083 public:
00084   Sql_cmd_alter_table_optimize_partition()
00085   {}
00086 
00087   ~Sql_cmd_alter_table_optimize_partition()
00088   {}
00089 };
00090 
00091 
00092 class Sql_cmd_alter_table_repair_partition :
00093   public Sql_cmd_partition_unsupported
00094 {
00095 public:
00096   Sql_cmd_alter_table_repair_partition()
00097   {}
00098 
00099   ~Sql_cmd_alter_table_repair_partition()
00100   {}
00101 };
00102 
00103 
00104 class Sql_cmd_alter_table_truncate_partition :
00105   public Sql_cmd_partition_unsupported
00106 {
00107 public:
00108   Sql_cmd_alter_table_truncate_partition()
00109   {}
00110 
00111   ~Sql_cmd_alter_table_truncate_partition()
00112   {}
00113 };
00114 
00115 #else
00116 
00121 class Sql_cmd_alter_table_exchange_partition : public Sql_cmd_common_alter_table
00122 {
00123 public:
00127   Sql_cmd_alter_table_exchange_partition()
00128     : Sql_cmd_common_alter_table()
00129   {}
00130 
00131   ~Sql_cmd_alter_table_exchange_partition()
00132   {}
00133 
00134   bool execute(THD *thd);
00135 
00136 private:
00137   bool exchange_partition(THD *thd, TABLE_LIST *, Alter_info *);
00138 };
00139 
00140 
00144 class Sql_cmd_alter_table_analyze_partition : public Sql_cmd_analyze_table
00145 {
00146 public:
00150   Sql_cmd_alter_table_analyze_partition()
00151     : Sql_cmd_analyze_table()
00152   {}
00153 
00154   ~Sql_cmd_alter_table_analyze_partition()
00155   {}
00156 
00157   bool execute(THD *thd);
00158 
00159   /* Override SQLCOM_ANALYZE, since it is an ALTER command */
00160   virtual enum_sql_command sql_command_code() const
00161   {
00162     return SQLCOM_ALTER_TABLE;
00163   }
00164 };
00165 
00166 
00170 class Sql_cmd_alter_table_check_partition : public Sql_cmd_check_table
00171 {
00172 public:
00176   Sql_cmd_alter_table_check_partition()
00177     : Sql_cmd_check_table()
00178   {}
00179 
00180   ~Sql_cmd_alter_table_check_partition()
00181   {}
00182 
00183   bool execute(THD *thd);
00184 
00185   /* Override SQLCOM_CHECK, since it is an ALTER command */
00186   virtual enum_sql_command sql_command_code() const
00187   {
00188     return SQLCOM_ALTER_TABLE;
00189   }
00190 };
00191 
00192 
00196 class Sql_cmd_alter_table_optimize_partition : public Sql_cmd_optimize_table
00197 {
00198 public:
00202   Sql_cmd_alter_table_optimize_partition()
00203     : Sql_cmd_optimize_table()
00204   {}
00205 
00206   ~Sql_cmd_alter_table_optimize_partition()
00207   {}
00208 
00209   bool execute(THD *thd);
00210 
00211   /* Override SQLCOM_OPTIMIZE, since it is an ALTER command */
00212   virtual enum_sql_command sql_command_code() const
00213   {
00214     return SQLCOM_ALTER_TABLE;
00215   }
00216 };
00217 
00218 
00222 class Sql_cmd_alter_table_repair_partition : public Sql_cmd_repair_table
00223 {
00224 public:
00228   Sql_cmd_alter_table_repair_partition()
00229     : Sql_cmd_repair_table()
00230   {}
00231 
00232   ~Sql_cmd_alter_table_repair_partition()
00233   {}
00234 
00235   bool execute(THD *thd);
00236 
00237   /* Override SQLCOM_REPAIR, since it is an ALTER command */
00238   virtual enum_sql_command sql_command_code() const
00239   {
00240     return SQLCOM_ALTER_TABLE;
00241   }
00242 };
00243 
00244 
00248 class Sql_cmd_alter_table_truncate_partition : public Sql_cmd_truncate_table
00249 {
00250 public:
00254   Sql_cmd_alter_table_truncate_partition()
00255   {}
00256 
00257   virtual ~Sql_cmd_alter_table_truncate_partition()
00258   {}
00259 
00260   bool execute(THD *thd);
00261 
00262   /* Override SQLCOM_TRUNCATE, since it is an ALTER command */
00263   virtual enum_sql_command sql_command_code() const
00264   {
00265     return SQLCOM_ALTER_TABLE;
00266   }
00267 };
00268 
00269 #endif /* WITH_PARTITION_STORAGE_ENGINE */
00270 #endif /* SQL_PARTITION_ADMIN_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines