Commit a4dc9561 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-10330: main.show_explain_ps fails sporadically in buildbot

The reason is that selecting from events_waits_history_long creates
a race condition: it can happen that SHOW EXPLAIN thread was kicked
off CPU exactly after posting a SHOW EXPLAIN request and then it wont
need to wait.

It doesn't seem to make sense to add more waits to stabilize the testcase.
Let's instead make a check that SHOW EXPLAIN statement has a
"stage/sql/show explain" stage.
parent d66e1119
......@@ -28,8 +28,13 @@ count(*)
10
set debug_dbug='';
select event_name
from performance_schema.events_waits_history_long
where event_name='wait/synch/cond/sql/show_explain';
from
performance_schema.events_stages_history_long
where
event_name like '%show explain' and
thread_id in(select thread_id
from performance_schema.events_statements_history_long
where EVENT_NAME='statement/sql/show_explain');
event_name
wait/synch/cond/sql/show_explain
stage/sql/show explain
drop table t0;
......@@ -6,6 +6,8 @@
# Like all other perfschema tests, we don't work on embedded server:
--source include/not_embedded.inc
--source include/restart_mysqld.inc
--disable_warnings
drop table if exists t0, t1;
--enable_warnings
......@@ -45,7 +47,11 @@ reap;
set debug_dbug='';
select event_name
from performance_schema.events_waits_history_long
where event_name='wait/synch/cond/sql/show_explain';
from
performance_schema.events_stages_history_long
where
event_name like '%show explain' and
thread_id in(select thread_id
from performance_schema.events_statements_history_long
where EVENT_NAME='statement/sql/show_explain');
drop table t0;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment