Commit 562c8825 authored by Sergei Petrunia's avatar Sergei Petrunia Committed by Marko Mäkelä

MDEV-10674: main.show_explain failed in buildbot

Fix a race condition in the testcase. The testcase assumed that
State='Sending data' means that the thread is already in an
InnoDB lock wait. This is not case, there is a gap between the
state changing to Sending data and execution reaching the point
where it is waiting for a lock.

Use a more precise check instead, through I_S.INNODB_TRX.
parent a910e1ee
--enable-plugin-innodb-lock-waits --enable-plugin-innodb-trx
...@@ -861,7 +861,14 @@ select * from t1 where pk between 10 and 20 for update; ...@@ -861,7 +861,14 @@ select * from t1 where pk between 10 and 20 for update;
# run SHOW EXPLAIN on a frozen thread # run SHOW EXPLAIN on a frozen thread
connection default; connection default;
let $save_wait_condition= $wait_condition; let $save_wait_condition= $wait_condition;
let $wait_condition= select State='Sending data' from information_schema.processlist where id=$thr2; let $wait_condition=
select 1
from information_schema.INNODB_LOCK_WAITS
where
requesting_trx_id=(select trx_id
from information_schema.INNODB_TRX
where trx_mysql_thread_id=$thr2);
let $thr_default=`select connection_id()`; let $thr_default=`select connection_id()`;
--source include/wait_condition.inc --source include/wait_condition.inc
--echo # do: send_eval show explain for thr2; --echo # do: send_eval show explain for thr2;
......
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