From b1f57a98a8fe1d79e3d1b827501383a19301d6fa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 18 Jan 2025 15:07:53 +0100 Subject: [PATCH] cleanup: Alter_table_ctx::Alter_table_ctx() --- sql/sql_alter.cc | 22 ++++------------------ sql/sql_alter.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index dc98f9c8d93..d8cb7e8f341 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -297,16 +297,8 @@ uint Alter_info::check_vcol_field(Item_field *item) const Alter_table_ctx::Alter_table_ctx() - : implicit_default_value_error_field(NULL), - error_if_not_empty(false), - tables_opened(0), - db(null_clex_str), table_name(null_clex_str), alias(null_clex_str), - new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str), - fk_error_if_delete_row(false), fk_error_id(NULL), - fk_error_table(NULL), modified_primary_key(false) -#ifdef DBUG_ASSERT_EXISTS - , tmp_table(false) -#endif + : db(null_clex_str), table_name(null_clex_str), alias(null_clex_str), + new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str) { } @@ -319,14 +311,8 @@ Alter_table_ctx::Alter_table_ctx(THD *thd, TABLE_LIST *table_list, uint tables_opened_arg, const LEX_CSTRING *new_db_arg, const LEX_CSTRING *new_name_arg) - : implicit_default_value_error_field(NULL), error_if_not_empty(false), - tables_opened(tables_opened_arg), - new_db(*new_db_arg), new_name(*new_name_arg), - fk_error_if_delete_row(false), fk_error_id(NULL), - fk_error_table(NULL), modified_primary_key(false) -#ifdef DBUG_ASSERT_EXISTS - , tmp_table(false) -#endif + : tables_opened(tables_opened_arg), + new_db(*new_db_arg), new_name(*new_name_arg) { /* Assign members db, table_name, new_db and new_name diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 65643eac46f..c5e6cb9ba34 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -306,9 +306,9 @@ public: void report_implicit_default_value_error(THD *thd, const TABLE_SHARE *) const; public: - Create_field *implicit_default_value_error_field; - bool error_if_not_empty; - uint tables_opened; + Create_field *implicit_default_value_error_field= NULL; + bool error_if_not_empty= false; + uint tables_opened= 0; LEX_CSTRING db; LEX_CSTRING table_name; LEX_CSTRING alias; @@ -322,12 +322,12 @@ public: of table to the new version ER_FK_CANNOT_DELETE_PARENT error should be emitted. */ - bool fk_error_if_delete_row; + bool fk_error_if_delete_row= false; /** Name of foreign key for the above error. */ - const char *fk_error_id; + const char *fk_error_id= NULL; /** Name of table for the above error. */ - const char *fk_error_table; - bool modified_primary_key; + const char *fk_error_table= NULL; + bool modified_primary_key= false; private: char new_filename[FN_REFLEN + 1]; @@ -339,7 +339,7 @@ private: #ifdef DBUG_ASSERT_EXISTS /** Indicates that we are altering temporary table. Used only in asserts. */ - bool tmp_table; + bool tmp_table= false; #endif Alter_table_ctx &operator=(const Alter_table_ctx &rhs); // not implemented