1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-3982: show_explain.test fails, times out or crashes

Backport the fix from 10.0 tree

- The problem was that thd_killed() may be called by innodb from 
  an internal innodb thread.
- Fixed by not processing APC requests when we're not in the thread
  that owns the APC target.
This commit is contained in:
Sergey Petrunya
2013-01-10 17:10:58 +04:00
parent 26b5351cac
commit 7b81b64166

View File

@@ -3860,12 +3860,16 @@ void THD::restore_backup_open_tables_state(Open_tables_backup *backup)
extern "C" int thd_killed(const MYSQL_THD thd) extern "C" int thd_killed(const MYSQL_THD thd)
{ {
THD* current= current_thd;
if (!thd) if (!thd)
thd= current_thd; thd= current_thd;
Apc_target *apc_target= (Apc_target*)&thd->apc_target; if (thd == current)
if (apc_target->have_apc_requests()) {
apc_target->process_apc_requests(); Apc_target *apc_target= (Apc_target*)&thd->apc_target;
if (apc_target->have_apc_requests())
apc_target->process_apc_requests();
}
if (!(thd->killed & KILL_HARD_BIT)) if (!(thd->killed & KILL_HARD_BIT))
return 0; return 0;