Skip to content

Commit

Permalink
Simplifying the patch in kill_one_thread()
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaakola committed Apr 11, 2023
1 parent 09e3f40 commit 0b23494
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9274,9 +9274,7 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type
if (!tmp)
DBUG_RETURN(error);
DEBUG_SYNC(thd, "found_killee");
#ifdef WITH_WSREP
bool wsrep_abort_used= false;
#endif /* WITH_WSREP */

if (tmp->get_command() != COM_DAEMON)
{
/*
Expand Down Expand Up @@ -9330,7 +9328,8 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type
if (WSREP(thd))
{
wsrep_abort_thd(thd, tmp, 1);
wsrep_abort_used= true;
/* tmp is unlocked in wsrep_abort_thd call */
DBUG_RETURN(0);
}
else
#endif /* WITH_WSREP */
Expand All @@ -9341,14 +9340,8 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type
else
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
ER_KILL_DENIED_ERROR);
#ifdef WITH_WSREP
if (!WSREP(thd) || !wsrep_abort_used)
#endif /* WITH_WSREP */
mysql_mutex_unlock(&tmp->LOCK_thd_data);
}
#ifdef WITH_WSREP
if (!WSREP(thd) || !wsrep_abort_used)
#endif /* WITH_WSREP */
mysql_mutex_unlock(&tmp->LOCK_thd_kill);
DBUG_PRINT("exit", ("%u", error));
DBUG_RETURN(error);
Expand Down

0 comments on commit 0b23494

Please sign in to comment.