diff options
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/sp_head.cc | 1 | ||||
-rw-r--r-- | sql/sql_parse.cc | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9a7928b214f..99d66134405 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1681,6 +1681,12 @@ void end_thread(THD *thd, bool put_in_cache) thd->real_id=pthread_self(); thd->thread_stack= (char*) &thd; // For store_globals (void) thd->store_globals(); + /* + THD::mysys_var::abort is associated with physical thread rather + than with THD object. So we need to reset this flag before using + this thread for handling of new THD object/connection. + */ + thd->mysys_var->abort= 0; thd->thr_create_time= time(NULL); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index baeedc1c9b3..4cb56e003ee 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1087,6 +1087,7 @@ sp_head::execute(THD *thd) ctx->enter_handler(hip); thd->clear_error(); thd->killed= THD::NOT_KILLED; + thd->mysys_var->abort= 0; continue; } } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b503e147624..6500def76f7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1604,7 +1604,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, DBUG_ENTER("dispatch_command"); if (thd->killed == THD::KILL_QUERY || thd->killed == THD::KILL_BAD_DATA) + { thd->killed= THD::NOT_KILLED; + thd->mysys_var->abort= 0; + } thd->command=command; /* |