diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 5ed80d69ff8..05ebdbf144a 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -257,7 +257,7 @@ struct rename_param static int rename_check_preconditions(THD *thd, rename_param *param, - TABLE_LIST *ren_table, + Table_name *ren_table, const LEX_CSTRING *new_db, const LEX_CSTRING *new_table_name, const LEX_CSTRING *new_table_alias, @@ -333,7 +333,7 @@ rename_check_preconditions(THD *thd, rename_param *param, static bool rename_table_and_triggers(THD *thd, rename_param *param, DDL_LOG_STATE *ddl_log_state, - TABLE_LIST *ren_table, const LEX_CSTRING *new_db, + Table_name *ren_table, const LEX_CSTRING *new_db, bool skip_error, bool *force_if_exists) { int rc= 1; diff --git a/sql/table.h b/sql/table.h index cb917594131..02e8998adb9 100644 --- a/sql/table.h +++ b/sql/table.h @@ -705,12 +705,21 @@ public: void abort_stats_load() { stats_state.abort_load(); } }; + +struct Table_name +{ + LEX_CSTRING db; + LEX_CSTRING table_name; + LEX_CSTRING alias; +}; + + /** This structure is shared between different table objects. There is one instance of table share per one table in the database. */ -struct TABLE_SHARE +struct TABLE_SHARE: public Table_name { TABLE_SHARE() {} /* Remove gcc warning */ @@ -760,8 +769,6 @@ struct TABLE_SHARE To ensure this one can use set_table_cache() methods. */ LEX_CSTRING table_cache_key; - LEX_CSTRING db; /* Pointer to db */ - LEX_CSTRING table_name; /* Table name (for open) */ LEX_CSTRING path; /* Path to .frm file (from datadir) */ LEX_CSTRING normalized_path; /* unpack_filename(path) */ LEX_CSTRING connect_string; @@ -2192,7 +2199,8 @@ struct TABLE_CHAIN void set_end_pos(TABLE_LIST **pos) { end_pos= pos; } }; -struct TABLE_LIST + +struct TABLE_LIST: public Table_name { TABLE_LIST() {} /* Remove gcc warning */ @@ -2279,10 +2287,7 @@ struct TABLE_LIST TABLE_LIST *next_local; /* link in a global list of all queries tables */ TABLE_LIST *next_global, **prev_global; - LEX_CSTRING db; - LEX_CSTRING table_name; LEX_CSTRING schema_table_name; - LEX_CSTRING alias; const char *option; /* Used by cache index */ Item *on_expr; /* Used with outer join */ Name_resolution_context *on_context; /* For ON expressions */