Commit 9599cbc2 authored by Nikita Malyavin's avatar Nikita Malyavin

online_alter: clean up usage of cleanup_cache_list

parent 50095046
...@@ -182,11 +182,8 @@ int online_alter_log_row(TABLE* table, const uchar *before_record, ...@@ -182,11 +182,8 @@ int online_alter_log_row(TABLE* table, const uchar *before_record,
} }
static void static void cleanup_cache_list(ilist<online_alter_cache_data> &list)
cleanup_cache_list(ilist<online_alter_cache_data> &list, bool ending_trans)
{ {
if (ending_trans)
{
auto it= list.begin(); auto it= list.begin();
while (it != list.end()) while (it != list.end())
{ {
...@@ -198,7 +195,6 @@ cleanup_cache_list(ilist<online_alter_cache_data> &list, bool ending_trans) ...@@ -198,7 +195,6 @@ cleanup_cache_list(ilist<online_alter_cache_data> &list, bool ending_trans)
} }
list.clear(); list.clear();
DBUG_ASSERT(list.empty()); DBUG_ASSERT(list.empty());
}
} }
...@@ -258,12 +254,12 @@ int online_alter_end_trans(Online_alter_cache_list &cache_list, THD *thd, ...@@ -258,12 +254,12 @@ int online_alter_end_trans(Online_alter_cache_list &cache_list, THD *thd,
{ {
my_error(ER_ERROR_ON_WRITE, MYF(ME_ERROR_LOG), my_error(ER_ERROR_ON_WRITE, MYF(ME_ERROR_LOG),
binlog->get_name(), errno); binlog->get_name(), errno);
cleanup_cache_list(cache_list, is_ending_transaction); break;
DBUG_RETURN(error);
} }
} }
cleanup_cache_list(cache_list, is_ending_transaction); if (is_ending_transaction)
cleanup_cache_list(cache_list);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
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