Skip to content

Commit b1f57a9

Browse files
committed
cleanup: Alter_table_ctx::Alter_table_ctx()
1 parent b87c1b0 commit b1f57a9

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

sql/sql_alter.cc

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,8 @@ uint Alter_info::check_vcol_field(Item_field *item) const
297297

298298

299299
Alter_table_ctx::Alter_table_ctx()
300-
: implicit_default_value_error_field(NULL),
301-
error_if_not_empty(false),
302-
tables_opened(0),
303-
db(null_clex_str), table_name(null_clex_str), alias(null_clex_str),
304-
new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str),
305-
fk_error_if_delete_row(false), fk_error_id(NULL),
306-
fk_error_table(NULL), modified_primary_key(false)
307-
#ifdef DBUG_ASSERT_EXISTS
308-
, tmp_table(false)
309-
#endif
300+
: db(null_clex_str), table_name(null_clex_str), alias(null_clex_str),
301+
new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str)
310302
{
311303
}
312304

@@ -319,14 +311,8 @@ Alter_table_ctx::Alter_table_ctx(THD *thd, TABLE_LIST *table_list,
319311
uint tables_opened_arg,
320312
const LEX_CSTRING *new_db_arg,
321313
const LEX_CSTRING *new_name_arg)
322-
: implicit_default_value_error_field(NULL), error_if_not_empty(false),
323-
tables_opened(tables_opened_arg),
324-
new_db(*new_db_arg), new_name(*new_name_arg),
325-
fk_error_if_delete_row(false), fk_error_id(NULL),
326-
fk_error_table(NULL), modified_primary_key(false)
327-
#ifdef DBUG_ASSERT_EXISTS
328-
, tmp_table(false)
329-
#endif
314+
: tables_opened(tables_opened_arg),
315+
new_db(*new_db_arg), new_name(*new_name_arg)
330316
{
331317
/*
332318
Assign members db, table_name, new_db and new_name

sql/sql_alter.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ class Alter_table_ctx
306306

307307
void report_implicit_default_value_error(THD *thd, const TABLE_SHARE *) const;
308308
public:
309-
Create_field *implicit_default_value_error_field;
310-
bool error_if_not_empty;
311-
uint tables_opened;
309+
Create_field *implicit_default_value_error_field= NULL;
310+
bool error_if_not_empty= false;
311+
uint tables_opened= 0;
312312
LEX_CSTRING db;
313313
LEX_CSTRING table_name;
314314
LEX_CSTRING alias;
@@ -322,12 +322,12 @@ class Alter_table_ctx
322322
of table to the new version ER_FK_CANNOT_DELETE_PARENT error should be
323323
emitted.
324324
*/
325-
bool fk_error_if_delete_row;
325+
bool fk_error_if_delete_row= false;
326326
/** Name of foreign key for the above error. */
327-
const char *fk_error_id;
327+
const char *fk_error_id= NULL;
328328
/** Name of table for the above error. */
329-
const char *fk_error_table;
330-
bool modified_primary_key;
329+
const char *fk_error_table= NULL;
330+
bool modified_primary_key= false;
331331

332332
private:
333333
char new_filename[FN_REFLEN + 1];
@@ -339,7 +339,7 @@ class Alter_table_ctx
339339

340340
#ifdef DBUG_ASSERT_EXISTS
341341
/** Indicates that we are altering temporary table. Used only in asserts. */
342-
bool tmp_table;
342+
bool tmp_table= false;
343343
#endif
344344

345345
Alter_table_ctx &operator=(const Alter_table_ctx &rhs); // not implemented

0 commit comments

Comments
 (0)