List:Commits« Previous MessageNext Message »
From:Roy Lyseng Date:August 24 2010 11:10am
Subject:bzr push into mysql-next-mr-bugfixing branch (roy.lyseng:3234 to 3235)
Bug#49907
View as plain text  
 3235 Roy Lyseng	2010-08-24
      Followup to bug#49907: ALTER TABLE ... TRUNCATE PARTITION
      
      The original bug fix added new SQL command objects based on the
      class Sql_statement. However, later the class was renamed to Sql_cmd.
      This fix aligns the new class names with the new name standard
      introduced when renaming the class.

    modified:
      sql/sql_admin.cc
      sql/sql_admin.h
      sql/sql_alter.cc
      sql/sql_alter.h
      sql/sql_partition_admin.cc
      sql/sql_partition_admin.h
      sql/sql_truncate.cc
      sql/sql_truncate.h
      sql/sql_yacc.yy
 3234 Alexey Botchkov	2010-08-23 [merge]
      merging.

    modified:
      mysql-test/include/mysqlhotcopy.inc
      mysql-test/mysql-test-run.pl
=== modified file 'sql/sql_admin.cc'
--- a/sql/sql_admin.cc	2010-08-20 09:15:16 +0000
+++ b/sql/sql_admin.cc	2010-08-24 10:52:32 +0000
@@ -884,12 +884,12 @@ bool mysql_preload_keys(THD* thd, TABLE_
 }
 
 
-bool Analyze_table_statement::execute(THD *thd)
+bool Sql_cmd_analyze_table::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   bool res= TRUE;
   thr_lock_type lock_type = TL_READ_NO_INSERT;
-  DBUG_ENTER("Analyze_table_statement::execute");
+  DBUG_ENTER("Sql_cmd_analyze_table::execute");
 
   if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
                          FALSE, UINT_MAX, FALSE))
@@ -914,12 +914,12 @@ error:
 }
 
 
-bool Check_table_statement::execute(THD *thd)
+bool Sql_cmd_check_table::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   thr_lock_type lock_type = TL_READ_NO_INSERT;
   bool res= TRUE;
-  DBUG_ENTER("Check_table_statement::execute");
+  DBUG_ENTER("Sql_cmd_check_table::execute");
 
   if (check_table_access(thd, SELECT_ACL, first_table,
                          TRUE, UINT_MAX, FALSE))
@@ -938,11 +938,11 @@ error:
 }
 
 
-bool Optimize_table_statement::execute(THD *thd)
+bool Sql_cmd_optimize_table::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   bool res= TRUE;
-  DBUG_ENTER("Optimize_table_statement::execute");
+  DBUG_ENTER("Sql_cmd_optimize_table::execute");
 
   if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
                          FALSE, UINT_MAX, FALSE))
@@ -969,11 +969,11 @@ error:
 }
 
 
-bool Repair_table_statement::execute(THD *thd)
+bool Sql_cmd_repair_table::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   bool res= TRUE;
-  DBUG_ENTER("Repair_table_statement::execute");
+  DBUG_ENTER("Sql_cmd_repair_table::execute");
 
   if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
                          FALSE, UINT_MAX, FALSE))

=== modified file 'sql/sql_admin.h'
--- a/sql/sql_admin.h	2010-08-16 18:21:24 +0000
+++ b/sql/sql_admin.h	2010-08-24 10:52:32 +0000
@@ -24,25 +24,20 @@ int reassign_keycache_tables(THD* thd, K
                              KEY_CACHE *dst_cache);
 
 /**
-  Analyze_statement represents the ANALYZE TABLE statement.
+  Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
 */
-class Analyze_table_statement : public Sql_cmd
+class Sql_cmd_analyze_table : public Sql_cmd
 {
 public:
   /**
     Constructor, used to represent a ANALYZE TABLE statement.
   */
-  Analyze_table_statement()
+  Sql_cmd_analyze_table()
   {}
 
-  ~Analyze_table_statement()
+  ~Sql_cmd_analyze_table()
   {}
 
-  /**
-    Execute a ANALYZE TABLE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -54,25 +49,20 @@ public:
 
 
 /**
-  Check_table_statement represents the CHECK TABLE statement.
+  Sql_cmd_check_table represents the CHECK TABLE statement.
 */
-class Check_table_statement : public Sql_cmd
+class Sql_cmd_check_table : public Sql_cmd
 {
 public:
   /**
     Constructor, used to represent a CHECK TABLE statement.
   */
-  Check_table_statement()
+  Sql_cmd_check_table()
   {}
 
-  ~Check_table_statement()
+  ~Sql_cmd_check_table()
   {}
 
-  /**
-    Execute a CHECK TABLE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -83,25 +73,20 @@ public:
 
 
 /**
-  Optimize_table_statement represents the OPTIMIZE TABLE statement.
+  Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
 */
-class Optimize_table_statement : public Sql_cmd
+class Sql_cmd_optimize_table : public Sql_cmd
 {
 public:
   /**
     Constructor, used to represent a OPTIMIZE TABLE statement.
   */
-  Optimize_table_statement()
+  Sql_cmd_optimize_table()
   {}
 
-  ~Optimize_table_statement()
+  ~Sql_cmd_optimize_table()
   {}
 
-  /**
-    Execute a OPTIMIZE TABLE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -113,25 +98,20 @@ public:
 
 
 /**
-  Repair_table_statement represents the REPAIR TABLE statement.
+  Sql_cmd_repair_table represents the REPAIR TABLE statement.
 */
-class Repair_table_statement : public Sql_cmd
+class Sql_cmd_repair_table : public Sql_cmd
 {
 public:
   /**
     Constructor, used to represent a REPAIR TABLE statement.
   */
-  Repair_table_statement()
+  Sql_cmd_repair_table()
   {}
 
-  ~Repair_table_statement()
+  ~Sql_cmd_repair_table()
   {}
 
-  /**
-    Execute a REPAIR TABLE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const

=== modified file 'sql/sql_alter.cc'
--- a/sql/sql_alter.cc	2010-08-16 15:07:53 +0000
+++ b/sql/sql_alter.cc	2010-08-24 10:52:32 +0000
@@ -19,7 +19,7 @@
                                              // mysql_exchange_partition
 #include "sql_alter.h"
 
-bool Alter_table_statement::execute(THD *thd)
+bool Sql_cmd_alter_table::execute(THD *thd)
 {
   LEX *lex= thd->lex;
   /* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */
@@ -39,7 +39,7 @@ bool Alter_table_statement::execute(THD 
   ulong priv_needed= ALTER_ACL;
   bool result;
 
-  DBUG_ENTER("Alter_table_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table::execute");
 
   if (thd->is_fatal_error) /* out of memory creating a copy of alter_info */
     DBUG_RETURN(TRUE);

=== modified file 'sql/sql_alter.h'
--- a/sql/sql_alter.h	2010-08-16 18:21:24 +0000
+++ b/sql/sql_alter.h	2010-08-24 10:52:32 +0000
@@ -17,20 +17,20 @@
 #define SQL_ALTER_TABLE_H
 
 /**
-  Alter_table_common represents the common properties of the ALTER TABLE
+  Sql_cmd_common_alter_table represents the common properties of the ALTER TABLE
   statements.
   @todo move Alter_info and other ALTER generic structures from Lex here.
 */
-class Alter_table_common : public Sql_cmd
+class Sql_cmd_common_alter_table : public Sql_cmd
 {
 protected:
   /**
     Constructor.
   */
-  Alter_table_common()
+  Sql_cmd_common_alter_table()
   {}
 
-  virtual ~Alter_table_common()
+  virtual ~Sql_cmd_common_alter_table()
   {}
 
   virtual enum_sql_command sql_command_code() const
@@ -40,26 +40,21 @@ protected:
 };
 
 /**
-  Alter_table_statement represents the generic ALTER TABLE statement.
+  Sql_cmd_alter_table represents the generic ALTER TABLE statement.
   @todo move Alter_info and other ALTER specific structures from Lex here.
 */
-class Alter_table_statement : public Alter_table_common
+class Sql_cmd_alter_table : public Sql_cmd_common_alter_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE statement.
   */
-  Alter_table_statement()
+  Sql_cmd_alter_table()
   {}
 
-  ~Alter_table_statement()
+  ~Sql_cmd_alter_table()
   {}
 
-  /**
-    Execute a ALTER TABLE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 };
 

=== modified file 'sql/sql_partition_admin.cc'
--- a/sql/sql_partition_admin.cc	2010-08-16 18:21:24 +0000
+++ b/sql/sql_partition_admin.cc	2010-08-24 10:52:32 +0000
@@ -18,21 +18,21 @@
                                             // check_one_table_access
 #include "sql_table.h"                      // mysql_alter_table, etc.
 #include "sql_cmd.h"                        // Sql_cmd
-#include "sql_alter.h"                      // Alter_table_statement
+#include "sql_alter.h"                      // Sql_cmd_alter_table
 #include "sql_partition.h"                  // struct partition_info, etc.
 #include "sql_handler.h"                    // mysql_ha_rm_tables
 #include "sql_base.h"                       // open_and_lock_tables, etc
 #include "debug_sync.h"                     // DEBUG_SYNC
 #include "sql_truncate.h"                   // mysql_truncate_table,
-                                            // Truncate_statement
-#include "sql_admin.h"                      // Analyze/Check/.._table_statement
+                                            // Sql_cmd_truncate_table
+#include "sql_admin.h"                      // Sql_cmd_Analyze/Check/.._table
 #include "sql_partition_admin.h"            // Alter_table_*_partition
 
 #ifndef WITH_PARTITION_STORAGE_ENGINE
 
-bool Partition_statement_unsupported::execute(THD *)
+bool Sql_cmd_partition_unsupported::execute(THD *)
 {
-  DBUG_ENTER("Partition_statement_unsupported::execute");
+  DBUG_ENTER("Sql_cmd_partition_unsupported::execute");
   /* error, partitioning support not compiled in... */
   my_error(ER_FEATURE_DISABLED, MYF(0), "partitioning",
            "--with-plugin-partition");
@@ -41,7 +41,7 @@ bool Partition_statement_unsupported::ex
 
 #else
 
-bool Alter_table_exchange_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_exchange_partition::execute(THD *thd)
 {
   /* Moved from mysql_execute_command */
   LEX *lex= thd->lex;
@@ -60,7 +60,7 @@ bool Alter_table_exchange_partition_stat
   Alter_info alter_info(lex->alter_info, thd->mem_root);
   ulong priv_needed= ALTER_ACL | DROP_ACL | INSERT_ACL | CREATE_ACL;
 
-  DBUG_ENTER("Alter_table_exchange_partition_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table_exchange_partition::execute");
 
   if (thd->is_fatal_error) /* out of memory creating a copy of alter_info */
     DBUG_RETURN(TRUE);
@@ -455,7 +455,7 @@ err_no_action_written:
 
   @note This is a DDL operation so triggers will not be used.
 */
-bool Alter_table_exchange_partition_statement::
+bool Sql_cmd_alter_table_exchange_partition::
   exchange_partition(THD *thd, TABLE_LIST *table_list, Alter_info *alter_info)
 {
   TABLE *part_table, *swap_table;
@@ -634,10 +634,10 @@ err:
 }
 
 
-bool Alter_table_analyze_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_analyze_partition::execute(THD *thd)
 {
   bool res;
-  DBUG_ENTER("Alter_table_analyze_partition_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table_analyze_partition::execute");
 
   /*
     Flag that it is an ALTER command which administrates partitions, used
@@ -645,16 +645,16 @@ bool Alter_table_analyze_partition_state
   */
   thd->lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
 
-  res= Analyze_table_statement::execute(thd);
+  res= Sql_cmd_analyze_table::execute(thd);
     
   DBUG_RETURN(res);
 }
 
 
-bool Alter_table_check_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_check_partition::execute(THD *thd)
 {
   bool res;
-  DBUG_ENTER("Alter_table_check_partition_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table_check_partition::execute");
 
   /*
     Flag that it is an ALTER command which administrates partitions, used
@@ -662,13 +662,13 @@ bool Alter_table_check_partition_stateme
   */
   thd->lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
 
-  res= Check_table_statement::execute(thd);
+  res= Sql_cmd_check_table::execute(thd);
 
   DBUG_RETURN(res);
 }
 
 
-bool Alter_table_optimize_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_optimize_partition::execute(THD *thd)
 {
   bool res;
   DBUG_ENTER("Alter_table_optimize_partition_statement::execute");
@@ -679,16 +679,16 @@ bool Alter_table_optimize_partition_stat
   */
   thd->lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
 
-  res= Optimize_table_statement::execute(thd);
+  res= Sql_cmd_optimize_table::execute(thd);
 
   DBUG_RETURN(res);
 }
 
 
-bool Alter_table_repair_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_repair_partition::execute(THD *thd)
 {
   bool res;
-  DBUG_ENTER("Alter_table_repair_partition_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table_repair_partition::execute");
 
   /*
     Flag that it is an ALTER command which administrates partitions, used
@@ -696,18 +696,18 @@ bool Alter_table_repair_partition_statem
   */
   thd->lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
 
-  res= Repair_table_statement::execute(thd);
+  res= Sql_cmd_repair_table::execute(thd);
 
   DBUG_RETURN(res);
 }
 
 
-bool Alter_table_truncate_partition_statement::execute(THD *thd)
+bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   bool res;
   enum_sql_command original_sql_command;
-  DBUG_ENTER("Alter_table_truncate_partition_statement::execute");
+  DBUG_ENTER("Sql_cmd_alter_table_truncate_partition::execute");
 
   /*
     Execute TRUNCATE PARTITION just like TRUNCATE TABLE.
@@ -730,7 +730,7 @@ bool Alter_table_truncate_partition_stat
   first_table->mdl_request.set_type(MDL_SHARED_NO_READ_WRITE);
 
   /* execute as a TRUNCATE TABLE */
-  res= Truncate_statement::execute(thd);
+  res= Sql_cmd_truncate_table::execute(thd);
 
   thd->lex->sql_command= original_sql_command;
   DBUG_RETURN(res);

=== modified file 'sql/sql_partition_admin.h'
--- a/sql/sql_partition_admin.h	2010-08-16 18:21:24 +0000
+++ b/sql/sql_partition_admin.h	2010-08-24 10:52:32 +0000
@@ -22,87 +22,87 @@
   Stub class that returns a error if the partition storage engine is
   not supported.
 */
-class Partition_statement_unsupported : public Sql_cmd
+class Sql_cmd_partition_unsupported : public Sql_cmd
 {
 public:
-  Partition_statement_unsupported()
+  Sql_cmd_partition_unsupported()
   {}
 
-  ~Partition_statement_unsupported()
+  ~Sql_cmd_partition_unsupported()
   {}
 
   bool execute(THD *thd);
 };
 
 
-class Alter_table_exchange_partition_statement :
-  public Partition_statement_unsupported
+class Sql_cmd_alter_table_exchange_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_exchange_partition_statement()
+  Sql_cmd_alter_table_exchange_partition()
   {}
 
-  ~Alter_table_exchange_partition_statement()
+  ~Sql_cmd_alter_table_exchange_partition()
   {}
 };
 
 
-class Alter_table_analyze_partition_statement :
-  public Partition_statement_unsupported
+class  Sql_cmd_alter_table_analyze_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_analyze_partition_statement()
+  Sql_cmd_alter_table_analyze_partition()
   {}
 
-  ~Alter_table_analyze_partition_statement()
+  ~Sql_cmd_alter_table_analyze_partition()
   {}
 };
 
 
-class Alter_table_check_partition_statement :
-  public Partition_statement_unsupported
+class Sql_cmd_alter_table_check_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_check_partition_statement()
+  Sql_cmd_alter_table_check_partition()
   {}
 
-  ~Alter_table_check_partition_statement()
+  ~Sql_cmd_alter_table_check_partition()
   {}
 };
 
 
-class Alter_table_optimize_partition_statement :
-  public Partition_statement_unsupported
+class Sql_cmd_alter_table_optimize_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_optimize_partition_statement()
+  Sql_cmd_alter_table_optimize_partition()
   {}
 
-  ~Alter_table_optimize_partition_statement()
+  ~Sql_cmd_alter_table_optimize_partition()
   {}
 };
 
 
-class Alter_table_repair_partition_statement :
-  public Partition_statement_unsupported
+class Sql_cmd_alter_table_repair_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_repair_partition_statement()
+  Sql_cmd_alter_table_repair_partition()
   {}
 
-  ~Alter_table_repair_partition_statement()
+  ~Sql_cmd_alter_table_repair_partition()
   {}
 };
 
 
-class Alter_table_truncate_partition_statement :
-  public Partition_statement_unsupported
+class Sql_cmd_alter_table_truncate_partition :
+  public Sql_cmd_partition_unsupported
 {
 public:
-  Alter_table_truncate_partition_statement()
+  Sql_cmd_alter_table_truncate_partition()
   {}
 
-  ~Alter_table_truncate_partition_statement()
+  ~Sql_cmd_alter_table_truncate_partition()
   {}
 };
 
@@ -112,24 +112,19 @@ public:
   Class that represents the ALTER TABLE t1 EXCHANGE PARTITION p
                             WITH TABLE t2 statement.
 */
-class Alter_table_exchange_partition_statement : public Alter_table_common
+class Sql_cmd_alter_table_exchange_partition : public Sql_cmd_common_alter_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE EXCHANGE PARTITION statement.
   */
-  Alter_table_exchange_partition_statement()
-    : Alter_table_common()
+  Sql_cmd_alter_table_exchange_partition()
+    : Sql_cmd_common_alter_table()
   {}
 
-  ~Alter_table_exchange_partition_statement()
+  ~Sql_cmd_alter_table_exchange_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE EXCHANGE PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
 private:
@@ -140,24 +135,19 @@ private:
 /**
   Class that represents the ALTER TABLE t1 ANALYZE PARTITION p statement.
 */
-class Alter_table_analyze_partition_statement : public Analyze_table_statement
+class Sql_cmd_alter_table_analyze_partition : public Sql_cmd_analyze_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE ANALYZE PARTITION statement.
   */
-  Alter_table_analyze_partition_statement()
-    : Analyze_table_statement()
+  Sql_cmd_alter_table_analyze_partition()
+    : Sql_cmd_analyze_table()
   {}
 
-  ~Alter_table_analyze_partition_statement()
+  ~Sql_cmd_alter_table_analyze_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE ANALYZE PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -170,24 +160,19 @@ public:
 /**
   Class that represents the ALTER TABLE t1 CHECK PARTITION p statement.
 */
-class Alter_table_check_partition_statement : public Check_table_statement
+class Sql_cmd_alter_table_check_partition : public Sql_cmd_check_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE CHECK PARTITION statement.
   */
-  Alter_table_check_partition_statement()
-    : Check_table_statement()
+  Sql_cmd_alter_table_check_partition()
+    : Sql_cmd_check_table()
   {}
 
-  ~Alter_table_check_partition_statement()
+  ~Sql_cmd_alter_table_check_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE CHECK PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -200,24 +185,19 @@ public:
 /**
   Class that represents the ALTER TABLE t1 OPTIMIZE PARTITION p statement.
 */
-class Alter_table_optimize_partition_statement : public Optimize_table_statement
+class Sql_cmd_alter_table_optimize_partition : public Sql_cmd_optimize_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE OPTIMIZE PARTITION statement.
   */
-  Alter_table_optimize_partition_statement()
-    : Optimize_table_statement()
+  Sql_cmd_alter_table_optimize_partition()
+    : Sql_cmd_optimize_table()
   {}
 
-  ~Alter_table_optimize_partition_statement()
+  ~Sql_cmd_alter_table_optimize_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE OPTIMIZE PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -230,24 +210,19 @@ public:
 /**
   Class that represents the ALTER TABLE t1 REPAIR PARTITION p statement.
 */
-class Alter_table_repair_partition_statement : public Repair_table_statement
+class Sql_cmd_alter_table_repair_partition : public Sql_cmd_repair_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE REPAIR PARTITION statement.
   */
-  Alter_table_repair_partition_statement()
-    : Repair_table_statement()
+  Sql_cmd_alter_table_repair_partition()
+    : Sql_cmd_repair_table()
   {}
 
-  ~Alter_table_repair_partition_statement()
+  ~Sql_cmd_alter_table_repair_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE REPAIR PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const
@@ -260,23 +235,18 @@ public:
 /**
   Class that represents the ALTER TABLE t1 TRUNCATE PARTITION p statement.
 */
-class Alter_table_truncate_partition_statement : public Truncate_statement
+class Sql_cmd_alter_table_truncate_partition : public Sql_cmd_truncate_table
 {
 public:
   /**
     Constructor, used to represent a ALTER TABLE TRUNCATE PARTITION statement.
   */
-  Alter_table_truncate_partition_statement()
+  Sql_cmd_alter_table_truncate_partition()
   {}
 
-  ~Alter_table_truncate_partition_statement()
+  ~Sql_cmd_alter_table_truncate_partition()
   {}
 
-  /**
-    Execute a ALTER TABLE TRUNCATE PARTITION statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const

=== modified file 'sql/sql_truncate.cc'
--- a/sql/sql_truncate.cc	2010-08-18 11:29:04 +0000
+++ b/sql/sql_truncate.cc	2010-08-24 10:52:32 +0000
@@ -494,11 +494,11 @@ bool mysql_truncate_table(THD *thd, TABL
 }
 
 
-bool Truncate_statement::execute(THD *thd)
+bool Sql_cmd_truncate_table::execute(THD *thd)
 {
   TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
   bool res= TRUE;
-  DBUG_ENTER("Truncate_statement::execute");
+  DBUG_ENTER("Sql_cmd_truncate_table::execute");
 
   if (check_one_table_access(thd, DROP_ACL, first_table))
     goto error;

=== modified file 'sql/sql_truncate.h'
--- a/sql/sql_truncate.h	2010-08-16 18:21:24 +0000
+++ b/sql/sql_truncate.h	2010-08-24 10:52:32 +0000
@@ -21,25 +21,20 @@ struct TABLE_LIST;
 bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref);
 
 /**
-  Truncate_statement represents the TRUNCATE statement.
+  Sql_cmd_truncate_table represents the TRUNCATE statement.
 */
-class Truncate_statement : public Sql_cmd
+class Sql_cmd_truncate_table : public Sql_cmd
 {
 public:
   /**
-    Constructor, used to represent a ALTER TABLE statement.
+    Constructor, used to represent a TRUNCATE statement.
   */
-  Truncate_statement()
+  Sql_cmd_truncate_table()
   {}
 
-  ~Truncate_statement()
+  ~Sql_cmd_truncate_table()
   {}
 
-  /**
-    Execute a TRUNCATE statement at runtime.
-    @param thd the current thread.
-    @return false on success.
-  */
   bool execute(THD *thd);
 
   virtual enum_sql_command sql_command_code() const

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-08-20 09:15:16 +0000
+++ b/sql/sql_yacc.yy	2010-08-24 10:52:32 +0000
@@ -51,10 +51,10 @@
 #include "sp_pcontext.h"
 #include "sp_rcontext.h"
 #include "sp.h"
-#include "sql_alter.h"                         // Alter_table*_statement
-#include "sql_truncate.h"                      // Truncate_statement
-#include "sql_admin.h"                         // Analyze/Check..._table_stmt
-#include "sql_partition_admin.h"               // Alter_table_*_partition_stmt
+#include "sql_alter.h"                         // Sql_cmd_alter_table*
+#include "sql_truncate.h"                      // Sql_cmd_truncate_table
+#include "sql_admin.h"                         // Sql_cmd_analyze/Check..._table
+#include "sql_partition_admin.h"               // Sql_cmd_alter_table_*_part.
 #include "sql_signal.h"
 #include "event_parse_data.h"
 #include <myisam.h>
@@ -6284,7 +6284,7 @@ alter:
             if (!lex->m_sql_cmd)
             {
               /* Create a generic ALTER TABLE statment. */
-              lex->m_sql_cmd= new (thd->mem_root) Alter_table_statement();
+              lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_alter_table();
               if (lex->m_sql_cmd == NULL)
                 MYSQL_YYABORT;
             }
@@ -6512,7 +6512,7 @@ alter_commands:
             lex->check_opt.init();
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                              Alter_table_optimize_partition_statement();
+                              Sql_cmd_alter_table_optimize_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -6526,7 +6526,7 @@ alter_commands:
             lex->check_opt.init();
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                              Alter_table_analyze_partition_statement();
+                              Sql_cmd_alter_table_analyze_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -6537,7 +6537,7 @@ alter_commands:
             lex->check_opt.init();
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                              Alter_table_check_partition_statement();
+                              Sql_cmd_alter_table_check_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -6551,7 +6551,7 @@ alter_commands:
             lex->check_opt.init();
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                              Alter_table_repair_partition_statement();
+                              Sql_cmd_alter_table_repair_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -6570,7 +6570,7 @@ alter_commands:
             lex->check_opt.init();
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                              Alter_table_truncate_partition_statement();
+                              Sql_cmd_alter_table_truncate_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -6596,7 +6596,7 @@ alter_commands:
               MYSQL_YYABORT;
             DBUG_ASSERT(!lex->m_sql_cmd);
             lex->m_sql_cmd= new (thd->mem_root)
-                               Alter_table_exchange_partition_statement();
+                               Sql_cmd_alter_table_exchange_partition();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -7041,7 +7041,7 @@ repair:
             THD *thd= YYTHD;
             LEX* lex= thd->lex;
             DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Repair_table_statement();
+            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_repair_table();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -7079,7 +7079,7 @@ analyze:
             THD *thd= YYTHD;
             LEX* lex= thd->lex;
             DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Analyze_table_statement();
+            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_analyze_table();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -7114,7 +7114,7 @@ check:
             THD *thd= YYTHD;
             LEX* lex= thd->lex;
             DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Check_table_statement();
+            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_check_table();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -7155,7 +7155,7 @@ optimize:
             THD *thd= YYTHD;
             LEX* lex= thd->lex;
             DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Optimize_table_statement();
+            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_optimize_table();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }
@@ -10940,7 +10940,7 @@ truncate:
             THD *thd= YYTHD;
             LEX* lex= thd->lex;
             DBUG_ASSERT(!lex->m_sql_cmd);
-            lex->m_sql_cmd= new (thd->mem_root) Truncate_statement();
+            lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_truncate_table();
             if (lex->m_sql_cmd == NULL)
               MYSQL_YYABORT;
           }


Attachment: [text/bzr-bundle] bzr/roy.lyseng@oracle.com-20100824105232-43go543mzvzcxfa2.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (roy.lyseng:3234 to 3235)Bug#49907Roy Lyseng24 Aug