Commit a449f72a authored by Marko Mäkelä's avatar Marko Mäkelä

Remove the redundant function row_table_got_default_clust_index()

Use dict_index_is_auto_gen_clust() instead.
parent 74f677fc
...@@ -6689,11 +6689,8 @@ ha_innobase::open(const char* name, int, uint) ...@@ -6689,11 +6689,8 @@ ha_innobase::open(const char* name, int, uint)
a row in our table. Note that MySQL may also compare two row a row in our table. Note that MySQL may also compare two row
references for equality by doing a simple memcmp on the strings references for equality by doing a simple memcmp on the strings
of length ref_length! */ of length ref_length! */
if (!(m_prebuilt->clust_index_was_generated
if (!row_table_got_default_clust_index(ib_table)) { = dict_index_is_auto_gen_clust(ib_table->indexes.start))) {
m_prebuilt->clust_index_was_generated = FALSE;
if (m_primary_key >= MAX_KEY) { if (m_primary_key >= MAX_KEY) {
ib_table->dict_frm_mismatch = DICT_FRM_NO_PK; ib_table->dict_frm_mismatch = DICT_FRM_NO_PK;
...@@ -6759,8 +6756,6 @@ ha_innobase::open(const char* name, int, uint) ...@@ -6759,8 +6756,6 @@ ha_innobase::open(const char* name, int, uint)
ib_push_frm_error(thd, ib_table, table, 0, true); ib_push_frm_error(thd, ib_table, table, 0, true);
} }
m_prebuilt->clust_index_was_generated = TRUE;
ref_length = DATA_ROW_ID_LEN; ref_length = DATA_ROW_ID_LEN;
/* If we automatically created the clustered index, then /* If we automatically created the clustered index, then
...@@ -14462,7 +14457,8 @@ innobase_get_mysql_key_number_for_index( ...@@ -14462,7 +14457,8 @@ innobase_get_mysql_key_number_for_index(
i++; i++;
} }
if (row_table_got_default_clust_index(index->table)) { if (dict_index_is_clust(index)
&& dict_index_is_auto_gen_clust(index)) {
ut_a(i > 0); ut_a(i > 0);
i--; i--;
} }
......
...@@ -689,7 +689,8 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -689,7 +689,8 @@ ha_innobase::check_if_supported_inplace_alter(
/* See if MYSQL table has no pk but we do. */ /* See if MYSQL table has no pk but we do. */
if (UNIV_UNLIKELY(my_primary_key >= MAX_KEY) if (UNIV_UNLIKELY(my_primary_key >= MAX_KEY)
&& !row_table_got_default_clust_index(m_prebuilt->table)) { && !dict_index_is_auto_gen_clust(
dict_table_get_first_index(m_prebuilt->table))) {
ha_alter_info->unsupported_reason = innobase_get_err_msg( ha_alter_info->unsupported_reason = innobase_get_err_msg(
ER_PRIMARY_CANT_HAVE_NULL); ER_PRIMARY_CANT_HAVE_NULL);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
...@@ -4448,7 +4449,8 @@ prepare_inplace_alter_table_dict( ...@@ -4448,7 +4449,8 @@ prepare_inplace_alter_table_dict(
index_defs = innobase_create_key_defs( index_defs = innobase_create_key_defs(
ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index, ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index,
num_fts_index, num_fts_index,
row_table_got_default_clust_index(ctx->new_table), dict_index_is_auto_gen_clust(dict_table_get_first_index(
ctx->new_table)),
fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx, fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx,
old_table); old_table);
......
...@@ -262,15 +262,6 @@ row_get_prebuilt_update_vector( ...@@ -262,15 +262,6 @@ row_get_prebuilt_update_vector(
/*===========================*/ /*===========================*/
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
handle */ handle */
/*********************************************************************//**
Checks if a table is such that we automatically created a clustered
index on it (on row id).
@return TRUE if the clustered index was generated automatically */
ibool
row_table_got_default_clust_index(
/*==============================*/
const dict_table_t* table); /*!< in: table */
/** Does an update or delete of a row for MySQL. /** Does an update or delete of a row for MySQL.
@param[in,out] prebuilt prebuilt struct in MySQL handle @param[in,out] prebuilt prebuilt struct in MySQL handle
@return error code or DB_SUCCESS */ @return error code or DB_SUCCESS */
......
...@@ -2283,22 +2283,6 @@ row_unlock_for_mysql( ...@@ -2283,22 +2283,6 @@ row_unlock_for_mysql(
trx->op_info = ""; trx->op_info = "";
} }
/*********************************************************************//**
Checks if a table is such that we automatically created a clustered
index on it (on row id).
@return TRUE if the clustered index was generated automatically */
ibool
row_table_got_default_clust_index(
/*==============================*/
const dict_table_t* table) /*!< in: table */
{
const dict_index_t* clust_index;
clust_index = dict_table_get_first_index(table);
return(dict_index_get_nth_col(clust_index, 0)->mtype == DATA_SYS);
}
/*********************************************************************//** /*********************************************************************//**
Locks the data dictionary in shared mode from modifications, for performing Locks the data dictionary in shared mode from modifications, for performing
foreign key check, rollback, or other operation invisible to MySQL. */ foreign key check, rollback, or other operation invisible to MySQL. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment