summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/my_apc.cc2
-rw-r--r--sql/sql_class.cc1
-rw-r--r--sql/sql_parse.cc5
3 files changed, 7 insertions, 1 deletions
diff --git a/sql/my_apc.cc b/sql/my_apc.cc
index 06e4fdac9a3..a5c3d2a2822 100644
--- a/sql/my_apc.cc
+++ b/sql/my_apc.cc
@@ -132,6 +132,8 @@ int Apc_target::wait_for_completion(THD *caller_thd, Call_request *apc_request,
struct timespec abstime;
const int timeout= timeout_sec;
set_timespec(abstime, timeout);
+
+ DBUG_EXECUTE_IF("apc_timeout", set_timespec_nsec(abstime, 1000000););
int res = 1;
int wait_res= 0;
PSI_stage_info old_stage;
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 00af11862bb..b0c23269233 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4383,6 +4383,7 @@ void thd_net_process_apc_requests(THD *thd)
#endif
if (unlikely(thd->apc_target.have_apc_requests()))
thd->apc_target.process_apc_requests();
+ DEBUG_SYNC(thd, "net_after_apc");
#ifdef WIN32
SetLastError(last_error);
#else
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index eb2b52dbc18..ec86389d08f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1296,7 +1296,8 @@ dispatch_command_return do_command(THD *thd, bool blocking)
goto out;
}
- thd->apc_target.process_apc_requests();
+ if (unlikely(thd->apc_target.have_apc_requests()))
+ thd->apc_target.process_apc_requests();
packet= (char*) net->read_pos;
/*
@@ -1408,6 +1409,8 @@ dispatch_command_return do_command(THD *thd, bool blocking)
resume:
return_value= dispatch_command(command, thd, packet+1,
(uint) (packet_length-1), blocking);
+ DEBUG_SYNC(thd, "after_dispatch_command");
+
if (return_value == DISPATCH_COMMAND_WOULDBLOCK)
{
/* Save current state, and resume later.*/