summaryrefslogtreecommitdiff
path: root/sql/my_apc.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-07-07 08:47:41 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-07-07 08:47:41 +0400
commita931467e17c4826ce4fa473de0479953d9bbcc59 (patch)
tree6e017fc3f244fa2a9a3f940ded632de0b96822a0 /sql/my_apc.cc
parentae3bc191613fdec05d4d84a74648d1e84edc8ce4 (diff)
downloadmariadb-git-a931467e17c4826ce4fa473de0479953d9bbcc59.tar.gz
Enable PERFORMANCE_SCHEMA tracking for SHOW EXPLAIN's conditions.
Diffstat (limited to 'sql/my_apc.cc')
-rw-r--r--sql/my_apc.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/sql/my_apc.cc b/sql/my_apc.cc
index 4a523fcd03e..c7ba25ad3ba 100644
--- a/sql/my_apc.cc
+++ b/sql/my_apc.cc
@@ -124,6 +124,26 @@ void Apc_target::dequeue_request(Call_request *qe)
qe->next->prev= qe->prev;
}
+#ifdef HAVE_PSI_INTERFACE
+
+/* One key for all conds */
+PSI_cond_key key_show_explain_request_COND;
+
+static PSI_cond_info show_explain_psi_conds[]=
+{
+ { &key_show_explain_request_COND, "show_explain", 0 /* not using PSI_FLAG_GLOBAL*/ }
+};
+
+void init_show_explain_psi_keys(void)
+{
+ if (PSI_server == NULL)
+ return;
+
+ PSI_server->register_cond("sql", show_explain_psi_conds,
+ array_elements(show_explain_psi_conds));
+}
+#endif
+
/*
Make an APC (Async Procedure Call) to another thread.
@@ -154,7 +174,8 @@ bool Apc_target::make_apc_call(THD *caller_thd, Apc_call *call,
Call_request apc_request;
apc_request.call= call;
apc_request.processed= FALSE;
- mysql_cond_init(0 /* do not track in PS */, &apc_request.COND_request, NULL);
+ mysql_cond_init(key_show_explain_request_COND, &apc_request.COND_request,
+ NULL);
enqueue_request(&apc_request);
apc_request.what="enqueued by make_apc_call";
@@ -174,9 +195,7 @@ bool Apc_target::make_apc_call(THD *caller_thd, Apc_call *call,
LOCK_thd_data_ptr, &abstime);
// &apc_request.LOCK_request, &abstime);
if (caller_thd->killed)
- {
break;
- }
}
if (!apc_request.processed)