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