summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2021-01-05 18:36:37 +1000
committerNikita Malyavin <nikitamalyavin@gmail.com>2021-01-05 18:39:01 +1000
commitfa4ce8d81ec63588d201fb2ec785612d5f120f2f (patch)
treedccb4d4d49442029fd44165243b44cc05523592b
parentaec3323ad927e58f161b6cc016efb6036770b7dc (diff)
downloadmariadb-git-bb-10.3-vcol-instant.tar.gz
small fixes regarding the refactoringbb-10.3-vcol-instant
* change char* to LEX_CSTRING and table_name_t * use strdup * move `!= DB_SUCCESS` on the one line with if
-rw-r--r--storage/innobase/handler/handler0alter.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 54f68201c71..2c386c3d889 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -8764,17 +8764,17 @@ innobase_page_compression_try(
static
void
-dict_stats_try_drop_table(THD *thd, const char* db_and_table, const char *maria_table_name)
+dict_stats_try_drop_table(THD *thd, const table_name_t &name,
+ const LEX_CSTRING &table_name)
{
char errstr[1024];
- if (dict_stats_drop_table(db_and_table, errstr, sizeof(errstr))
- != DB_SUCCESS)
+ if (dict_stats_drop_table(name.m_name, errstr, sizeof(errstr)) != DB_SUCCESS)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_ALTER_INFO,
"Deleting persistent statistics"
" for table '%s' in"
" InnoDB failed: %s",
- maria_table_name,
+ table_name.str,
errstr);
}
}
@@ -8786,18 +8786,18 @@ dict_stats_try_drop_table(THD *thd, const char* db_and_table, const char *maria_
@return newly opened table */
static
dict_table_t*
-innobase_discard_table(THD *thd, dict_table_t *table, const char *maria_table_name)
+innobase_discard_table(THD *thd, dict_table_t *table,
+ const LEX_CSTRING &table_name)
{
- /* FIXME: this workaround does not seem to work with partitioned tables */
- char tb_name[NAME_LEN * 2 + 1 + 1];
- strcpy(tb_name, table->name.m_name);
+ char *tb_name= strdup(table->name.m_name);
dict_table_close(table, true, false);
dict_table_remove_from_cache(table);
table = dict_table_open_on_name(tb_name, TRUE, TRUE,
DICT_ERR_IGNORE_FK_NOKEY);
/* Drop outdated table stats. */
- dict_stats_try_drop_table(thd, table->name.m_name, maria_table_name);
+ dict_stats_try_drop_table(thd, table->name.m_name, table_name);
+ free(tb_name);
return table;
}
@@ -9907,7 +9907,9 @@ foreign_fail:
DBUG_ASSERT(ctx0->old_table->get_ref_count() == 1);
trx_commit_for_mysql(m_prebuilt->trx);
- m_prebuilt->table= innobase_discard_table(m_user_thd, m_prebuilt->table, table->s->table_name.str);
+ m_prebuilt->table = innobase_discard_table(m_user_thd,
+ m_prebuilt->table,
+ table->s->table_name);
row_mysql_unlock_data_dictionary(trx);
trx->free();