cleanup: InnoDB, remove index_field_t::col_name

* remnant of 5.6, does not exist in 5.7. bad merge?
* also remove dict_table_get_col_name_for_mysql(), it was only
  used when index_field_t::col_name was not NULL
This commit is contained in:
Sergei Golubchik 2016-11-26 14:43:30 +01:00
parent b66976abb4
commit 528dd5f20c
5 changed files with 1 additions and 52 deletions

View file

@ -654,41 +654,6 @@ dict_table_get_col_name(
return(s);
}
/**********************************************************************//**
Returns a column's name.
@return column name. NOTE: not guaranteed to stay valid if table is
modified in any way (columns added, etc.). */
UNIV_INTERN
const char*
dict_table_get_col_name_for_mysql(
/*==============================*/
const dict_table_t* table, /*!< in: table */
const char* col_name)/*! in: MySQL table column name */
{
ulint i;
const char* s;
ut_ad(table);
ut_ad(col_name);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
s = table->col_names;
if (s) {
/* If we have many virtual columns MySQL key_part->fieldnr
could be larger than number of columns in InnoDB table
when creating new indexes. */
for (i = 0; i < table->n_def; i++) {
if (!innobase_strcasecmp(s, col_name)) {
break; /* Found */
}
s += strlen(s) + 1;
}
}
return(s);
}
/** Returns a virtual column's name.
@param[in] table target table
@param[in] col_nr virtual column number (nth virtual column)

View file

@ -2183,7 +2183,6 @@ innobase_create_index_field_def(
#else
index_field->is_v_col = false;
index_field->col_no = key_part->fieldnr - num_m_v;
index_field->col_name = altered_table ? field->field_name : fields[key_part->fieldnr]->field_name;
#endif /* MYSQL_VIRTUAL_COLUMNS */
if (DATA_LARGE_MTYPE(col_type)

View file

@ -613,18 +613,6 @@ dict_table_get_col_name(
ulint col_nr) /*!< in: column number */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Returns a column's name.
@return column name. NOTE: not guaranteed to stay valid if table is
modified in any way (columns added, etc.). */
UNIV_INTERN
const char*
dict_table_get_col_name_for_mysql(
/*==============================*/
const dict_table_t* table, /*!< in: table */
const char* col_name)/*!< in: MySQL table column name */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Returns a virtual column's name.
@param[in] table table object
@param[in] col_nr virtual column number(nth virtual column)

View file

@ -114,7 +114,6 @@ struct index_field_t {
ulint col_no; /*!< column offset */
ulint prefix_len; /*!< column prefix length, or 0
if indexing the whole column */
const char* col_name; /*!< column name or NULL */
bool is_v_col; /*!< whether this is a virtual column */
};

View file

@ -4509,9 +4509,7 @@ row_merge_create_index(
if (col_names && col_names[i]) {
name = col_names[i];
} else {
name = ifield->col_name ?
dict_table_get_col_name_for_mysql(table, ifield->col_name) :
dict_table_get_col_name(table, ifield->col_no);
name = dict_table_get_col_name(table, ifield->col_no);
}
}