Commit 2a4a5d89 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-7426 - federated.federated_server fails

Fixed error path of close_cached_connection_tables() to unlock mutex.
parent 517c5c9e
...@@ -633,10 +633,7 @@ static my_bool close_cached_connection_tables_callback( ...@@ -633,10 +633,7 @@ static my_bool close_cached_connection_tables_callback(
/* Ignore if table is not open or does not have a connect_string */ /* Ignore if table is not open or does not have a connect_string */
if (!element->share || !element->share->connect_string.length || if (!element->share || !element->share->connect_string.length ||
!element->ref_count) !element->ref_count)
{ goto end;
mysql_mutex_unlock(&element->LOCK_table_share);
return FALSE;
}
/* Compare the connection string */ /* Compare the connection string */
if (arg->connection && if (arg->connection &&
...@@ -646,20 +643,23 @@ static my_bool close_cached_connection_tables_callback( ...@@ -646,20 +643,23 @@ static my_bool close_cached_connection_tables_callback(
element->share->connect_string.str[arg->connection->length] != '\\')) || element->share->connect_string.str[arg->connection->length] != '\\')) ||
strncasecmp(arg->connection->str, element->share->connect_string.str, strncasecmp(arg->connection->str, element->share->connect_string.str,
arg->connection->length))) arg->connection->length)))
return FALSE; goto end;
/* close_cached_tables() only uses these elements */ /* close_cached_tables() only uses these elements */
if (!(tmp= (TABLE_LIST*) alloc_root(arg->thd->mem_root, sizeof(TABLE_LIST))) || if (!(tmp= (TABLE_LIST*) alloc_root(arg->thd->mem_root, sizeof(TABLE_LIST))) ||
!(tmp->db= strdup_root(arg->thd->mem_root, element->share->db.str)) || !(tmp->db= strdup_root(arg->thd->mem_root, element->share->db.str)) ||
!(tmp->table_name= strdup_root(arg->thd->mem_root, !(tmp->table_name= strdup_root(arg->thd->mem_root,
element->share->table_name.str))) element->share->table_name.str)))
{
mysql_mutex_unlock(&element->LOCK_table_share);
return TRUE; return TRUE;
}
tmp->next_local= arg->tables; tmp->next_local= arg->tables;
arg->tables= tmp; arg->tables= tmp;
end:
mysql_mutex_unlock(&element->LOCK_table_share); mysql_mutex_unlock(&element->LOCK_table_share);
return FALSE; return FALSE;
} }
......
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